diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index a4b92ac..f9539de 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -5,4 +5,5 @@ module.exports = { 'no-console': 'off', 'max-len': ['error', { ignoreStrings: true, code: 120 }], }, + ignorePatterns: ['src/proto-gen/*'], }; diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5351475..5acfeb6 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -14,10 +14,13 @@ "@massalabs/prettier-config-as": "^0.0.2", "@massalabs/react-ui-kit": "^0.0.5-dev", "@massalabs/wallet-provider": "^2.0.1-dev", + "@protobuf-ts/grpcweb-transport": "^2.9.4", + "@protobuf-ts/runtime-rpc": "^2.9.4", "axios": "^1.7.2", "dot-object": "^2.1.5", "eslint-plugin-html": "^8.1.1", "eslint-plugin-import": "^2.29.1", + "google-protobuf": "^3.21.4", "husky": "^9.0.11", "lodash": "^4.17.21", "react": "^18.2.0", @@ -258,17 +261,19 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", - "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz", - "integrity": "sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -309,9 +314,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.5.tgz", - "integrity": "sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.3" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -383,13 +392,13 @@ } }, "node_modules/@babel/types": { - "version": "7.24.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.5.tgz", - "integrity": "sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.24.1", - "@babel/helper-validator-identifier": "^7.24.5", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -992,9 +1001,10 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -1954,6 +1964,31 @@ "node": ">=14" } }, + "node_modules/@protobuf-ts/grpcweb-transport": { + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpcweb-transport/-/grpcweb-transport-2.9.4.tgz", + "integrity": "sha512-6aQgwPTgX6FkqWqmNts3uk8T/C5coJoH7U87zgaZY/Wo2EVa9SId5bXTM8uo4WR+CN8j9W4c9ij1yG13Hc3xUw==", + "license": "Apache-2.0", + "dependencies": { + "@protobuf-ts/runtime": "^2.9.4", + "@protobuf-ts/runtime-rpc": "^2.9.4" + } + }, + "node_modules/@protobuf-ts/runtime": { + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz", + "integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg==", + "license": "(Apache-2.0 AND BSD-3-Clause)" + }, + "node_modules/@protobuf-ts/runtime-rpc": { + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz", + "integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==", + "license": "Apache-2.0", + "dependencies": { + "@protobuf-ts/runtime": "^2.9.4" + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", @@ -2800,9 +2835,10 @@ } }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -3665,11 +3701,12 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -4922,6 +4959,12 @@ "csstype": "^3.0.10" } }, + "node_modules/google-protobuf": { + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", + "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", + "license": "(BSD-3-Clause AND Apache-2.0)" + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -5738,9 +5781,10 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, "node_modules/mz": { "version": "2.7.0", @@ -7006,14 +7050,6 @@ "node": ">=0.8" } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index d17a380..5ef311d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,10 +22,13 @@ "@massalabs/prettier-config-as": "^0.0.2", "@massalabs/react-ui-kit": "^0.0.5-dev", "@massalabs/wallet-provider": "^2.0.1-dev", + "@protobuf-ts/grpcweb-transport": "^2.9.4", + "@protobuf-ts/runtime-rpc": "^2.9.4", "axios": "^1.7.2", "dot-object": "^2.1.5", "eslint-plugin-html": "^8.1.1", "eslint-plugin-import": "^2.29.1", + "google-protobuf": "^3.21.4", "husky": "^9.0.11", "lodash": "^4.17.21", "react": "^18.2.0", diff --git a/frontend/src/components/MNSManagement.tsx b/frontend/src/components/MNSManagement.tsx index 9cae970..34c4e1d 100644 --- a/frontend/src/components/MNSManagement.tsx +++ b/frontend/src/components/MNSManagement.tsx @@ -13,7 +13,7 @@ export function MNSManagement(props: MNSManagementProps) { const { massaClient, connectedAccount, currentProvider, chainId } = useAccountStore(); const { - list, + domainsList, listSpinning, getUserEntryList, dnsAlloc, @@ -28,7 +28,7 @@ export function MNSManagement(props: MNSManagementProps) { useEffect(() => { if (!connectedAccount || !massaClient || listSpinning || !chainId) return; getUserEntryList({ address: connectedAccount.address() }); - }, [connectedAccount, massaClient, chainId]); + }, [connectedAccount, massaClient, chainId, listSpinning, getUserEntryList]); return (
{!connected ? ( @@ -44,7 +44,7 @@ export function MNSManagement(props: MNSManagementProps) { deleteDnsEntry={deleteDnsEntry} changeTargetAddressDnsEntry={changeTargetAddressDnsEntry} changeOwnershipDnsEntry={changeOwnershipDnsEntry} - list={list} + list={domainsList} listSpinning={listSpinning} />
diff --git a/frontend/src/proto-gen/google/api/http.ts b/frontend/src/proto-gen/google/api/http.ts new file mode 100644 index 0000000..9e6b5a8 --- /dev/null +++ b/frontend/src/proto-gen/google/api/http.ts @@ -0,0 +1,852 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "google/api/http.proto" (package "google.api", syntax proto3) +// tslint:disable +// +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + * + * @generated from protobuf message google.api.Http + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * @generated from protobuf field: repeated google.api.HttpRule rules = 1; + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + * + * @generated from protobuf field: bool fully_decode_reserved_expansion = 2; + */ + fullyDecodeReservedExpansion: boolean; +} +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The commons usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most commons use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + * + * @generated from protobuf message google.api.HttpRule + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * @generated from protobuf field: string selector = 1; + */ + selector: string; + /** + * @generated from protobuf oneof: pattern + */ + pattern: + | { + oneofKind: 'get'; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + * + * @generated from protobuf field: string get = 2; + */ + get: string; + } + | { + oneofKind: 'put'; + /** + * Maps to HTTP PUT. Used for replacing a resource. + * + * @generated from protobuf field: string put = 3; + */ + put: string; + } + | { + oneofKind: 'post'; + /** + * Maps to HTTP POST. Used for creating a resource or performing an action. + * + * @generated from protobuf field: string post = 4; + */ + post: string; + } + | { + oneofKind: 'delete'; + /** + * Maps to HTTP DELETE. Used for deleting a resource. + * + * @generated from protobuf field: string delete = 5; + */ + delete: string; + } + | { + oneofKind: 'patch'; + /** + * Maps to HTTP PATCH. Used for updating a resource. + * + * @generated from protobuf field: string patch = 6; + */ + patch: string; + } + | { + oneofKind: 'custom'; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + * + * @generated from protobuf field: google.api.CustomHttpPattern custom = 8; + */ + custom: CustomHttpPattern; + } + | { + oneofKind: undefined; + }; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + * + * @generated from protobuf field: string body = 7; + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + * + * @generated from protobuf field: string response_body = 12; + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + * + * @generated from protobuf field: repeated google.api.HttpRule additional_bindings = 11; + */ + additionalBindings: HttpRule[]; +} +/** + * A custom pattern is used for defining custom HTTP verb. + * + * @generated from protobuf message google.api.CustomHttpPattern + */ +export interface CustomHttpPattern { + /** + * The name of this custom HTTP verb. + * + * @generated from protobuf field: string kind = 1; + */ + kind: string; + /** + * The path matched by this custom verb. + * + * @generated from protobuf field: string path = 2; + */ + path: string; +} +// @generated message type with reflection information, may provide speed optimized methods +class Http$Type extends MessageType { + constructor() { + super('google.api.Http', [ + { + no: 1, + name: 'rules', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => HttpRule, + }, + { + no: 2, + name: 'fully_decode_reserved_expansion', + kind: 'scalar', + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create(value?: PartialMessage): Http { + const message = { rules: [], fullyDecodeReservedExpansion: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Http, + ): Http { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.api.HttpRule rules */ 1: + message.rules.push( + HttpRule.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + case /* bool fully_decode_reserved_expansion */ 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Http, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated google.api.HttpRule rules = 1; */ + for (let i = 0; i < message.rules.length; i++) + HttpRule.internalBinaryWrite( + message.rules[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bool fully_decode_reserved_expansion = 2; */ + if (message.fullyDecodeReservedExpansion !== false) + writer.tag(2, WireType.Varint).bool(message.fullyDecodeReservedExpansion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.api.Http + */ +export const Http = new Http$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HttpRule$Type extends MessageType { + constructor() { + super('google.api.HttpRule', [ + { no: 1, name: 'selector', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'get', + kind: 'scalar', + oneof: 'pattern', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'put', + kind: 'scalar', + oneof: 'pattern', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'post', + kind: 'scalar', + oneof: 'pattern', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'delete', + kind: 'scalar', + oneof: 'pattern', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'patch', + kind: 'scalar', + oneof: 'pattern', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 8, + name: 'custom', + kind: 'message', + oneof: 'pattern', + T: () => CustomHttpPattern, + }, + { no: 7, name: 'body', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 12, + name: 'response_body', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 11, + name: 'additional_bindings', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => HttpRule, + }, + ]); + } + create(value?: PartialMessage): HttpRule { + const message = { + selector: '', + pattern: { oneofKind: undefined }, + body: '', + responseBody: '', + additionalBindings: [], + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: HttpRule, + ): HttpRule { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string selector */ 1: + message.selector = reader.string(); + break; + case /* string get */ 2: + message.pattern = { + oneofKind: 'get', + get: reader.string(), + }; + break; + case /* string put */ 3: + message.pattern = { + oneofKind: 'put', + put: reader.string(), + }; + break; + case /* string post */ 4: + message.pattern = { + oneofKind: 'post', + post: reader.string(), + }; + break; + case /* string delete */ 5: + message.pattern = { + oneofKind: 'delete', + delete: reader.string(), + }; + break; + case /* string patch */ 6: + message.pattern = { + oneofKind: 'patch', + patch: reader.string(), + }; + break; + case /* google.api.CustomHttpPattern custom */ 8: + message.pattern = { + oneofKind: 'custom', + custom: CustomHttpPattern.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.pattern as any).custom, + ), + }; + break; + case /* string body */ 7: + message.body = reader.string(); + break; + case /* string response_body */ 12: + message.responseBody = reader.string(); + break; + case /* repeated google.api.HttpRule additional_bindings */ 11: + message.additionalBindings.push( + HttpRule.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: HttpRule, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string selector = 1; */ + if (message.selector !== '') + writer.tag(1, WireType.LengthDelimited).string(message.selector); + /* string get = 2; */ + if (message.pattern.oneofKind === 'get') + writer.tag(2, WireType.LengthDelimited).string(message.pattern.get); + /* string put = 3; */ + if (message.pattern.oneofKind === 'put') + writer.tag(3, WireType.LengthDelimited).string(message.pattern.put); + /* string post = 4; */ + if (message.pattern.oneofKind === 'post') + writer.tag(4, WireType.LengthDelimited).string(message.pattern.post); + /* string delete = 5; */ + if (message.pattern.oneofKind === 'delete') + writer.tag(5, WireType.LengthDelimited).string(message.pattern.delete); + /* string patch = 6; */ + if (message.pattern.oneofKind === 'patch') + writer.tag(6, WireType.LengthDelimited).string(message.pattern.patch); + /* google.api.CustomHttpPattern custom = 8; */ + if (message.pattern.oneofKind === 'custom') + CustomHttpPattern.internalBinaryWrite( + message.pattern.custom, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string body = 7; */ + if (message.body !== '') + writer.tag(7, WireType.LengthDelimited).string(message.body); + /* string response_body = 12; */ + if (message.responseBody !== '') + writer.tag(12, WireType.LengthDelimited).string(message.responseBody); + /* repeated google.api.HttpRule additional_bindings = 11; */ + for (let i = 0; i < message.additionalBindings.length; i++) + HttpRule.internalBinaryWrite( + message.additionalBindings[i], + writer.tag(11, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.api.HttpRule + */ +export const HttpRule = new HttpRule$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CustomHttpPattern$Type extends MessageType { + constructor() { + super('google.api.CustomHttpPattern', [ + { no: 1, name: 'kind', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'path', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): CustomHttpPattern { + const message = { kind: '', path: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CustomHttpPattern, + ): CustomHttpPattern { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string kind */ 1: + message.kind = reader.string(); + break; + case /* string path */ 2: + message.path = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CustomHttpPattern, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string kind = 1; */ + if (message.kind !== '') + writer.tag(1, WireType.LengthDelimited).string(message.kind); + /* string path = 2; */ + if (message.path !== '') + writer.tag(2, WireType.LengthDelimited).string(message.path); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.api.CustomHttpPattern + */ +export const CustomHttpPattern = new CustomHttpPattern$Type(); diff --git a/frontend/src/proto-gen/google/protobuf/descriptor.ts b/frontend/src/proto-gen/google/protobuf/descriptor.ts new file mode 100644 index 0000000..5a2d6be --- /dev/null +++ b/frontend/src/proto-gen/google/protobuf/descriptor.ts @@ -0,0 +1,5526 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "google/protobuf/descriptor.proto" (package "google.protobuf", syntax proto2) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + * + * @generated from protobuf message google.protobuf.FileDescriptorSet + */ +export interface FileDescriptorSet { + /** + * @generated from protobuf field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file: FileDescriptorProto[]; +} +/** + * Describes a complete .proto file. + * + * @generated from protobuf message google.protobuf.FileDescriptorProto + */ +export interface FileDescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; // file name, relative to root of source tree + /** + * @generated from protobuf field: optional string package = 2; + */ + package?: string; // e.g. "foo", "foo.bar", etc. + /** + * Names of files imported by this file. + * + * @generated from protobuf field: repeated string dependency = 3; + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from protobuf field: repeated int32 public_dependency = 10; + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from protobuf field: repeated int32 weak_dependency = 11; + */ + weakDependency: number[]; + /** + * All top-level definitions in this file. + * + * @generated from protobuf field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + messageType: DescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + service: ServiceDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.FileOptions options = 8; + */ + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + * + * @generated from protobuf field: optional google.protobuf.SourceCodeInfo source_code_info = 9; + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * + * @generated from protobuf field: optional string syntax = 12; + */ + syntax?: string; + /** + * The edition of the proto file, which is an opaque string. + * + * @generated from protobuf field: optional string edition = 13; + */ + edition?: string; +} +/** + * Describes a message type. + * + * @generated from protobuf message google.protobuf.DescriptorProto + */ +export interface DescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + field: FieldDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + nestedType: DescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + extensionRange: DescriptorProto_ExtensionRange[]; + /** + * @generated from protobuf field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + oneofDecl: OneofDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.MessageOptions options = 7; + */ + options?: MessageOptions; + /** + * @generated from protobuf field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + * + * @generated from protobuf field: repeated string reserved_name = 10; + */ + reservedName: string[]; +} +/** + * @generated from protobuf message google.protobuf.DescriptorProto.ExtensionRange + */ +export interface DescriptorProto_ExtensionRange { + /** + * @generated from protobuf field: optional int32 start = 1; + */ + start?: number; // Inclusive. + /** + * @generated from protobuf field: optional int32 end = 2; + */ + end?: number; // Exclusive. + /** + * @generated from protobuf field: optional google.protobuf.ExtensionRangeOptions options = 3; + */ + options?: ExtensionRangeOptions; +} +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + * + * @generated from protobuf message google.protobuf.DescriptorProto.ReservedRange + */ +export interface DescriptorProto_ReservedRange { + /** + * @generated from protobuf field: optional int32 start = 1; + */ + start?: number; // Inclusive. + /** + * @generated from protobuf field: optional int32 end = 2; + */ + end?: number; // Exclusive. +} +/** + * @generated from protobuf message google.protobuf.ExtensionRangeOptions + */ +export interface ExtensionRangeOptions { + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * Describes a field within a message. + * + * @generated from protobuf message google.protobuf.FieldDescriptorProto + */ +export interface FieldDescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: optional int32 number = 3; + */ + number?: number; + /** + * @generated from protobuf field: optional google.protobuf.FieldDescriptorProto.Label label = 4; + */ + label?: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + * + * @generated from protobuf field: optional google.protobuf.FieldDescriptorProto.Type type = 5; + */ + type?: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + * + * @generated from protobuf field: optional string type_name = 6; + */ + typeName?: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * @generated from protobuf field: optional string extendee = 2; + */ + extendee?: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * + * @generated from protobuf field: optional string default_value = 7; + */ + defaultValue?: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * @generated from protobuf field: optional int32 oneof_index = 9; + */ + oneofIndex?: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + * + * @generated from protobuf field: optional string json_name = 10; + */ + jsonName?: string; + /** + * @generated from protobuf field: optional google.protobuf.FieldOptions options = 8; + */ + options?: FieldOptions; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + * + * @generated from protobuf field: optional bool proto3_optional = 17; + */ + proto3Optional?: boolean; +} +/** + * @generated from protobuf enum google.protobuf.FieldDescriptorProto.Type + */ +export enum FieldDescriptorProto_Type { + /** + * @generated synthetic value - protobuf-ts requires all enums to have a 0 value + */ + UNSPECIFIED$ = 0, + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from protobuf enum value: TYPE_DOUBLE = 1; + */ + DOUBLE = 1, + /** + * @generated from protobuf enum value: TYPE_FLOAT = 2; + */ + FLOAT = 2, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from protobuf enum value: TYPE_INT64 = 3; + */ + INT64 = 3, + /** + * @generated from protobuf enum value: TYPE_UINT64 = 4; + */ + UINT64 = 4, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from protobuf enum value: TYPE_INT32 = 5; + */ + INT32 = 5, + /** + * @generated from protobuf enum value: TYPE_FIXED64 = 6; + */ + FIXED64 = 6, + /** + * @generated from protobuf enum value: TYPE_FIXED32 = 7; + */ + FIXED32 = 7, + /** + * @generated from protobuf enum value: TYPE_BOOL = 8; + */ + BOOL = 8, + /** + * @generated from protobuf enum value: TYPE_STRING = 9; + */ + STRING = 9, + /** + * Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + * + * @generated from protobuf enum value: TYPE_GROUP = 10; + */ + GROUP = 10, + /** + * Length-delimited aggregate. + * + * @generated from protobuf enum value: TYPE_MESSAGE = 11; + */ + MESSAGE = 11, + /** + * New in version 2. + * + * @generated from protobuf enum value: TYPE_BYTES = 12; + */ + BYTES = 12, + /** + * @generated from protobuf enum value: TYPE_UINT32 = 13; + */ + UINT32 = 13, + /** + * @generated from protobuf enum value: TYPE_ENUM = 14; + */ + ENUM = 14, + /** + * @generated from protobuf enum value: TYPE_SFIXED32 = 15; + */ + SFIXED32 = 15, + /** + * @generated from protobuf enum value: TYPE_SFIXED64 = 16; + */ + SFIXED64 = 16, + /** + * Uses ZigZag encoding. + * + * @generated from protobuf enum value: TYPE_SINT32 = 17; + */ + SINT32 = 17, + /** + * Uses ZigZag encoding. + * + * @generated from protobuf enum value: TYPE_SINT64 = 18; + */ + SINT64 = 18, +} +/** + * @generated from protobuf enum google.protobuf.FieldDescriptorProto.Label + */ +export enum FieldDescriptorProto_Label { + /** + * @generated synthetic value - protobuf-ts requires all enums to have a 0 value + */ + UNSPECIFIED$ = 0, + /** + * 0 is reserved for errors + * + * @generated from protobuf enum value: LABEL_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * @generated from protobuf enum value: LABEL_REQUIRED = 2; + */ + REQUIRED = 2, + /** + * @generated from protobuf enum value: LABEL_REPEATED = 3; + */ + REPEATED = 3, +} +/** + * Describes a oneof. + * + * @generated from protobuf message google.protobuf.OneofDescriptorProto + */ +export interface OneofDescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: optional google.protobuf.OneofOptions options = 2; + */ + options?: OneofOptions; +} +/** + * Describes an enum type. + * + * @generated from protobuf message google.protobuf.EnumDescriptorProto + */ +export interface EnumDescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + value: EnumValueDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.EnumOptions options = 3; + */ + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + * + * @generated from protobuf field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from protobuf field: repeated string reserved_name = 5; + */ + reservedName: string[]; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + * + * @generated from protobuf message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** + * @generated from protobuf field: optional int32 start = 1; + */ + start?: number; // Inclusive. + /** + * @generated from protobuf field: optional int32 end = 2; + */ + end?: number; // Inclusive. +} +/** + * Describes a value within an enum. + * + * @generated from protobuf message google.protobuf.EnumValueDescriptorProto + */ +export interface EnumValueDescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: optional int32 number = 2; + */ + number?: number; + /** + * @generated from protobuf field: optional google.protobuf.EnumValueOptions options = 3; + */ + options?: EnumValueOptions; +} +/** + * Describes a service. + * + * @generated from protobuf message google.protobuf.ServiceDescriptorProto + */ +export interface ServiceDescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + method: MethodDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.ServiceOptions options = 3; + */ + options?: ServiceOptions; +} +/** + * Describes a method of a service. + * + * @generated from protobuf message google.protobuf.MethodDescriptorProto + */ +export interface MethodDescriptorProto { + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * @generated from protobuf field: optional string input_type = 2; + */ + inputType?: string; + /** + * @generated from protobuf field: optional string output_type = 3; + */ + outputType?: string; + /** + * @generated from protobuf field: optional google.protobuf.MethodOptions options = 4; + */ + options?: MethodOptions; + /** + * Identifies if client streams multiple client messages + * + * @generated from protobuf field: optional bool client_streaming = 5; + */ + clientStreaming?: boolean; + /** + * Identifies if server streams multiple server messages + * + * @generated from protobuf field: optional bool server_streaming = 6; + */ + serverStreaming?: boolean; +} +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +/** + * @generated from protobuf message google.protobuf.FileOptions + */ +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + * + * @generated from protobuf field: optional string java_package = 1; + */ + javaPackage?: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + * + * @generated from protobuf field: optional string java_outer_classname = 8; + */ + javaOuterClassname?: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + * + * @generated from protobuf field: optional bool java_multiple_files = 10; + */ + javaMultipleFiles?: boolean; + /** + * This option does nothing. + * + * @deprecated + * @generated from protobuf field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + */ + javaGenerateEqualsAndHash?: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + * + * @generated from protobuf field: optional bool java_string_check_utf8 = 27; + */ + javaStringCheckUtf8?: boolean; + /** + * @generated from protobuf field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9; + */ + optimizeFor?: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + * + * @generated from protobuf field: optional string go_package = 11; + */ + goPackage?: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + * + * @generated from protobuf field: optional bool cc_generic_services = 16; + */ + ccGenericServices?: boolean; + /** + * @generated from protobuf field: optional bool java_generic_services = 17; + */ + javaGenericServices?: boolean; + /** + * @generated from protobuf field: optional bool py_generic_services = 18; + */ + pyGenericServices?: boolean; + /** + * @generated from protobuf field: optional bool php_generic_services = 42; + */ + phpGenericServices?: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + * + * @generated from protobuf field: optional bool deprecated = 23; + */ + deprecated?: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * @generated from protobuf field: optional bool cc_enable_arenas = 31; + */ + ccEnableArenas?: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * @generated from protobuf field: optional string objc_class_prefix = 36; + */ + objcClassPrefix?: string; + /** + * Namespace for generated classes; defaults to the package. + * + * @generated from protobuf field: optional string csharp_namespace = 37; + */ + csharpNamespace?: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + * + * @generated from protobuf field: optional string swift_prefix = 39; + */ + swiftPrefix?: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * @generated from protobuf field: optional string php_class_prefix = 40; + */ + phpClassPrefix?: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + * + * @generated from protobuf field: optional string php_namespace = 41; + */ + phpNamespace?: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + * + * @generated from protobuf field: optional string php_metadata_namespace = 44; + */ + phpMetadataNamespace?: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + * + * @generated from protobuf field: optional string ruby_package = 45; + */ + rubyPackage?: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from protobuf enum google.protobuf.FileOptions.OptimizeMode + */ +export enum FileOptions_OptimizeMode { + /** + * @generated synthetic value - protobuf-ts requires all enums to have a 0 value + */ + UNSPECIFIED$ = 0, + /** + * Generate complete code for parsing, serialization, + * + * @generated from protobuf enum value: SPEED = 1; + */ + SPEED = 1, + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from protobuf enum value: CODE_SIZE = 2; + */ + CODE_SIZE = 2, + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from protobuf enum value: LITE_RUNTIME = 3; + */ + LITE_RUNTIME = 3, +} +/** + * @generated from protobuf message google.protobuf.MessageOptions + */ +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + * + * @generated from protobuf field: optional bool message_set_wire_format = 1; + */ + messageSetWireFormat?: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + * + * @generated from protobuf field: optional bool no_standard_descriptor_accessor = 2; + */ + noStandardDescriptorAccessor?: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + * + * @generated from protobuf field: optional bool deprecated = 3; + */ + deprecated?: boolean; + /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * @generated from protobuf field: optional bool map_entry = 7; + */ + mapEntry?: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO(b/261750190) This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @deprecated + * @generated from protobuf field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * @generated from protobuf message google.protobuf.FieldOptions + */ +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + * + * @generated from protobuf field: optional google.protobuf.FieldOptions.CType ctype = 1; + */ + ctype?: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + * + * @generated from protobuf field: optional bool packed = 2; + */ + packed?: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + * + * @generated from protobuf field: optional google.protobuf.FieldOptions.JSType jstype = 6; + */ + jstype?: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * + * As of May 2022, lazy verifies the contents of the byte stream during + * parsing. An invalid byte stream will cause the overall parsing to fail. + * + * @generated from protobuf field: optional bool lazy = 5; + */ + lazy?: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * @generated from protobuf field: optional bool unverified_lazy = 15; + */ + unverifiedLazy?: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + * + * @generated from protobuf field: optional bool deprecated = 3; + */ + deprecated?: boolean; + /** + * For Google-internal migration only. Do not use. + * + * @generated from protobuf field: optional bool weak = 10; + */ + weak?: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * @generated from protobuf field: optional bool debug_redact = 16; + */ + debugRedact?: boolean; + /** + * @generated from protobuf field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + retention?: FieldOptions_OptionRetention; + /** + * @generated from protobuf field: optional google.protobuf.FieldOptions.OptionTargetType target = 18; + */ + target?: FieldOptions_OptionTargetType; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * @generated from protobuf enum google.protobuf.FieldOptions.CType + */ +export enum FieldOptions_CType { + /** + * Default mode. + * + * @generated from protobuf enum value: STRING = 0; + */ + STRING = 0, + /** + * @generated from protobuf enum value: CORD = 1; + */ + CORD = 1, + /** + * @generated from protobuf enum value: STRING_PIECE = 2; + */ + STRING_PIECE = 2, +} +/** + * @generated from protobuf enum google.protobuf.FieldOptions.JSType + */ +export enum FieldOptions_JSType { + /** + * Use the default type. + * + * @generated from protobuf enum value: JS_NORMAL = 0; + */ + JS_NORMAL = 0, + /** + * Use JavaScript strings. + * + * @generated from protobuf enum value: JS_STRING = 1; + */ + JS_STRING = 1, + /** + * Use JavaScript numbers. + * + * @generated from protobuf enum value: JS_NUMBER = 2; + */ + JS_NUMBER = 2, +} +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * Note: as of January 2023, support for this is in progress and does not yet + * have an effect (b/264593489). + * + * @generated from protobuf enum google.protobuf.FieldOptions.OptionRetention + */ +export enum FieldOptions_OptionRetention { + /** + * @generated from protobuf enum value: RETENTION_UNKNOWN = 0; + */ + RETENTION_UNKNOWN = 0, + /** + * @generated from protobuf enum value: RETENTION_RUNTIME = 1; + */ + RETENTION_RUNTIME = 1, + /** + * @generated from protobuf enum value: RETENTION_SOURCE = 2; + */ + RETENTION_SOURCE = 2, +} +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. Note: as of January 2023, support for this is + * in progress and does not yet have an effect (b/264593489). + * + * @generated from protobuf enum google.protobuf.FieldOptions.OptionTargetType + */ +export enum FieldOptions_OptionTargetType { + /** + * @generated from protobuf enum value: TARGET_TYPE_UNKNOWN = 0; + */ + TARGET_TYPE_UNKNOWN = 0, + /** + * @generated from protobuf enum value: TARGET_TYPE_FILE = 1; + */ + TARGET_TYPE_FILE = 1, + /** + * @generated from protobuf enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + TARGET_TYPE_EXTENSION_RANGE = 2, + /** + * @generated from protobuf enum value: TARGET_TYPE_MESSAGE = 3; + */ + TARGET_TYPE_MESSAGE = 3, + /** + * @generated from protobuf enum value: TARGET_TYPE_FIELD = 4; + */ + TARGET_TYPE_FIELD = 4, + /** + * @generated from protobuf enum value: TARGET_TYPE_ONEOF = 5; + */ + TARGET_TYPE_ONEOF = 5, + /** + * @generated from protobuf enum value: TARGET_TYPE_ENUM = 6; + */ + TARGET_TYPE_ENUM = 6, + /** + * @generated from protobuf enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + TARGET_TYPE_ENUM_ENTRY = 7, + /** + * @generated from protobuf enum value: TARGET_TYPE_SERVICE = 8; + */ + TARGET_TYPE_SERVICE = 8, + /** + * @generated from protobuf enum value: TARGET_TYPE_METHOD = 9; + */ + TARGET_TYPE_METHOD = 9, +} +/** + * @generated from protobuf message google.protobuf.OneofOptions + */ +export interface OneofOptions { + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * @generated from protobuf message google.protobuf.EnumOptions + */ +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * @generated from protobuf field: optional bool allow_alias = 2; + */ + allowAlias?: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + * + * @generated from protobuf field: optional bool deprecated = 3; + */ + deprecated?: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO(b/261750190) Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @deprecated + * @generated from protobuf field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * @generated from protobuf message google.protobuf.EnumValueOptions + */ +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + * + * @generated from protobuf field: optional bool deprecated = 1; + */ + deprecated?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * @generated from protobuf message google.protobuf.ServiceOptions + */ +export interface ServiceOptions { + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + * + * @generated from protobuf field: optional bool deprecated = 33; + */ + deprecated?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * @generated from protobuf message google.protobuf.MethodOptions + */ +export interface MethodOptions { + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + * + * @generated from protobuf field: optional bool deprecated = 33; + */ + deprecated?: boolean; + /** + * @generated from protobuf field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34; + */ + idempotencyLevel?: MethodOptions_IdempotencyLevel; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + * + * @generated from protobuf enum google.protobuf.MethodOptions.IdempotencyLevel + */ +export enum MethodOptions_IdempotencyLevel { + /** + * @generated from protobuf enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + IDEMPOTENCY_UNKNOWN = 0, + /** + * implies idempotent + * + * @generated from protobuf enum value: NO_SIDE_EFFECTS = 1; + */ + NO_SIDE_EFFECTS = 1, + /** + * idempotent, but may have side effects + * + * @generated from protobuf enum value: IDEMPOTENT = 2; + */ + IDEMPOTENT = 2, +} +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + * + * @generated from protobuf message google.protobuf.UninterpretedOption + */ +export interface UninterpretedOption { + /** + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + * + * @generated from protobuf field: optional string identifier_value = 3; + */ + identifierValue?: string; + /** + * @generated from protobuf field: optional uint64 positive_int_value = 4; + */ + positiveIntValue?: bigint; + /** + * @generated from protobuf field: optional int64 negative_int_value = 5; + */ + negativeIntValue?: bigint; + /** + * @generated from protobuf field: optional double double_value = 6; + */ + doubleValue?: number; + /** + * @generated from protobuf field: optional bytes string_value = 7; + */ + stringValue?: Uint8Array; + /** + * @generated from protobuf field: optional string aggregate_value = 8; + */ + aggregateValue?: string; +} +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + * + * @generated from protobuf message google.protobuf.UninterpretedOption.NamePart + */ +export interface UninterpretedOption_NamePart { + /** + * @generated from protobuf field: string name_part = 1; + */ + namePart: string; + /** + * @generated from protobuf field: bool is_extension = 2; + */ + isExtension: boolean; +} +// =================================================================== +// Optional source code info + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + * + * @generated from protobuf message google.protobuf.SourceCodeInfo + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + * + * @generated from protobuf field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + location: SourceCodeInfo_Location[]; +} +/** + * @generated from protobuf message google.protobuf.SourceCodeInfo.Location + */ +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + * + * @generated from protobuf field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + * + * @generated from protobuf field: repeated int32 span = 2 [packed = true]; + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. *\/ + * /* Block comment attached to + * * grault. *\/ + * optional int32 grault = 6; + * + * // ignored detached comments. + * + * @generated from protobuf field: optional string leading_comments = 3; + */ + leadingComments?: string; + /** + * @generated from protobuf field: optional string trailing_comments = 4; + */ + trailingComments?: string; + /** + * @generated from protobuf field: repeated string leading_detached_comments = 6; + */ + leadingDetachedComments: string[]; +} +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + * + * @generated from protobuf message google.protobuf.GeneratedCodeInfo + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from protobuf field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + annotation: GeneratedCodeInfo_Annotation[]; +} +/** + * @generated from protobuf message google.protobuf.GeneratedCodeInfo.Annotation + */ +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from protobuf field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Identifies the filesystem path to the original source .proto. + * + * @generated from protobuf field: optional string source_file = 2; + */ + sourceFile?: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * @generated from protobuf field: optional int32 begin = 3; + */ + begin?: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + * + * @generated from protobuf field: optional int32 end = 4; + */ + end?: number; + /** + * @generated from protobuf field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + semantic?: GeneratedCodeInfo_Annotation_Semantic; +} +/** + * Represents the identified object's effect on the element in the original + * .proto file. + * + * @generated from protobuf enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic + */ +export enum GeneratedCodeInfo_Annotation_Semantic { + /** + * There is no effect or the effect is indescribable. + * + * @generated from protobuf enum value: NONE = 0; + */ + NONE = 0, + /** + * The element is set or otherwise mutated. + * + * @generated from protobuf enum value: SET = 1; + */ + SET = 1, + /** + * An alias to the element is returned. + * + * @generated from protobuf enum value: ALIAS = 2; + */ + ALIAS = 2, +} +// @generated message type with reflection information, may provide speed optimized methods +class FileDescriptorSet$Type extends MessageType { + constructor() { + super('google.protobuf.FileDescriptorSet', [ + { + no: 1, + name: 'file', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => FileDescriptorProto, + }, + ]); + } + create(value?: PartialMessage): FileDescriptorSet { + const message = { file: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FileDescriptorSet, + ): FileDescriptorSet { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.FileDescriptorProto file */ 1: + message.file.push( + FileDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FileDescriptorSet, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated google.protobuf.FileDescriptorProto file = 1; */ + for (let i = 0; i < message.file.length; i++) + FileDescriptorProto.internalBinaryWrite( + message.file[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.FileDescriptorSet + */ +export const FileDescriptorSet = new FileDescriptorSet$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FileDescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.FileDescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'package', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'dependency', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 10, + name: 'public_dependency', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 11, + name: 'weak_dependency', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 4, + name: 'message_type', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => DescriptorProto, + }, + { + no: 5, + name: 'enum_type', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => EnumDescriptorProto, + }, + { + no: 6, + name: 'service', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => ServiceDescriptorProto, + }, + { + no: 7, + name: 'extension', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => FieldDescriptorProto, + }, + { no: 8, name: 'options', kind: 'message', T: () => FileOptions }, + { + no: 9, + name: 'source_code_info', + kind: 'message', + T: () => SourceCodeInfo, + }, + { + no: 12, + name: 'syntax', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 13, + name: 'edition', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): FileDescriptorProto { + const message = { + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FileDescriptorProto, + ): FileDescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional string package */ 2: + message.package = reader.string(); + break; + case /* repeated string dependency */ 3: + message.dependency.push(reader.string()); + break; + case /* repeated int32 public_dependency */ 10: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.publicDependency.push(reader.int32()); + else message.publicDependency.push(reader.int32()); + break; + case /* repeated int32 weak_dependency */ 11: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.weakDependency.push(reader.int32()); + else message.weakDependency.push(reader.int32()); + break; + case /* repeated google.protobuf.DescriptorProto message_type */ 4: + message.messageType.push( + DescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.EnumDescriptorProto enum_type */ 5: + message.enumType.push( + EnumDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.ServiceDescriptorProto service */ 6: + message.service.push( + ServiceDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.FieldDescriptorProto extension */ 7: + message.extension.push( + FieldDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* optional google.protobuf.FileOptions options */ 8: + message.options = FileOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + case /* optional google.protobuf.SourceCodeInfo source_code_info */ 9: + message.sourceCodeInfo = SourceCodeInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sourceCodeInfo, + ); + break; + case /* optional string syntax */ 12: + message.syntax = reader.string(); + break; + case /* optional string edition */ 13: + message.edition = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FileDescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional string package = 2; */ + if (message.package !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.package); + /* repeated string dependency = 3; */ + for (let i = 0; i < message.dependency.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.dependency[i]); + /* repeated int32 public_dependency = 10; */ + for (let i = 0; i < message.publicDependency.length; i++) + writer.tag(10, WireType.Varint).int32(message.publicDependency[i]); + /* repeated int32 weak_dependency = 11; */ + for (let i = 0; i < message.weakDependency.length; i++) + writer.tag(11, WireType.Varint).int32(message.weakDependency[i]); + /* repeated google.protobuf.DescriptorProto message_type = 4; */ + for (let i = 0; i < message.messageType.length; i++) + DescriptorProto.internalBinaryWrite( + message.messageType[i], + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.EnumDescriptorProto enum_type = 5; */ + for (let i = 0; i < message.enumType.length; i++) + EnumDescriptorProto.internalBinaryWrite( + message.enumType[i], + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.ServiceDescriptorProto service = 6; */ + for (let i = 0; i < message.service.length; i++) + ServiceDescriptorProto.internalBinaryWrite( + message.service[i], + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.FieldDescriptorProto extension = 7; */ + for (let i = 0; i < message.extension.length; i++) + FieldDescriptorProto.internalBinaryWrite( + message.extension[i], + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional google.protobuf.FileOptions options = 8; */ + if (message.options) + FileOptions.internalBinaryWrite( + message.options, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional google.protobuf.SourceCodeInfo source_code_info = 9; */ + if (message.sourceCodeInfo) + SourceCodeInfo.internalBinaryWrite( + message.sourceCodeInfo, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional string syntax = 12; */ + if (message.syntax !== undefined) + writer.tag(12, WireType.LengthDelimited).string(message.syntax); + /* optional string edition = 13; */ + if (message.edition !== undefined) + writer.tag(13, WireType.LengthDelimited).string(message.edition); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.FileDescriptorProto + */ +export const FileDescriptorProto = new FileDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.DescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'field', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => FieldDescriptorProto, + }, + { + no: 6, + name: 'extension', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => FieldDescriptorProto, + }, + { + no: 3, + name: 'nested_type', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => DescriptorProto, + }, + { + no: 4, + name: 'enum_type', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => EnumDescriptorProto, + }, + { + no: 5, + name: 'extension_range', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => DescriptorProto_ExtensionRange, + }, + { + no: 8, + name: 'oneof_decl', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => OneofDescriptorProto, + }, + { no: 7, name: 'options', kind: 'message', T: () => MessageOptions }, + { + no: 9, + name: 'reserved_range', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => DescriptorProto_ReservedRange, + }, + { + no: 10, + name: 'reserved_name', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): DescriptorProto { + const message = { + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + reservedRange: [], + reservedName: [], + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DescriptorProto, + ): DescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.protobuf.FieldDescriptorProto field */ 2: + message.field.push( + FieldDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.FieldDescriptorProto extension */ 6: + message.extension.push( + FieldDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.DescriptorProto nested_type */ 3: + message.nestedType.push( + DescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.EnumDescriptorProto enum_type */ 4: + message.enumType.push( + EnumDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.DescriptorProto.ExtensionRange extension_range */ 5: + message.extensionRange.push( + DescriptorProto_ExtensionRange.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated google.protobuf.OneofDescriptorProto oneof_decl */ 8: + message.oneofDecl.push( + OneofDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* optional google.protobuf.MessageOptions options */ 7: + message.options = MessageOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + case /* repeated google.protobuf.DescriptorProto.ReservedRange reserved_range */ 9: + message.reservedRange.push( + DescriptorProto_ReservedRange.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated string reserved_name */ 10: + message.reservedName.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.FieldDescriptorProto field = 2; */ + for (let i = 0; i < message.field.length; i++) + FieldDescriptorProto.internalBinaryWrite( + message.field[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.FieldDescriptorProto extension = 6; */ + for (let i = 0; i < message.extension.length; i++) + FieldDescriptorProto.internalBinaryWrite( + message.extension[i], + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.DescriptorProto nested_type = 3; */ + for (let i = 0; i < message.nestedType.length; i++) + DescriptorProto.internalBinaryWrite( + message.nestedType[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.EnumDescriptorProto enum_type = 4; */ + for (let i = 0; i < message.enumType.length; i++) + EnumDescriptorProto.internalBinaryWrite( + message.enumType[i], + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; */ + for (let i = 0; i < message.extensionRange.length; i++) + DescriptorProto_ExtensionRange.internalBinaryWrite( + message.extensionRange[i], + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; */ + for (let i = 0; i < message.oneofDecl.length; i++) + OneofDescriptorProto.internalBinaryWrite( + message.oneofDecl[i], + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional google.protobuf.MessageOptions options = 7; */ + if (message.options) + MessageOptions.internalBinaryWrite( + message.options, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; */ + for (let i = 0; i < message.reservedRange.length; i++) + DescriptorProto_ReservedRange.internalBinaryWrite( + message.reservedRange[i], + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated string reserved_name = 10; */ + for (let i = 0; i < message.reservedName.length; i++) + writer.tag(10, WireType.LengthDelimited).string(message.reservedName[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.DescriptorProto + */ +export const DescriptorProto = new DescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DescriptorProto_ExtensionRange$Type extends MessageType { + constructor() { + super('google.protobuf.DescriptorProto.ExtensionRange', [ + { + no: 1, + name: 'start', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 2, + name: 'end', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 3, + name: 'options', + kind: 'message', + T: () => ExtensionRangeOptions, + }, + ]); + } + create( + value?: PartialMessage, + ): DescriptorProto_ExtensionRange { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DescriptorProto_ExtensionRange, + ): DescriptorProto_ExtensionRange { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 start */ 1: + message.start = reader.int32(); + break; + case /* optional int32 end */ 2: + message.end = reader.int32(); + break; + case /* optional google.protobuf.ExtensionRangeOptions options */ 3: + message.options = ExtensionRangeOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DescriptorProto_ExtensionRange, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional int32 start = 1; */ + if (message.start !== undefined) + writer.tag(1, WireType.Varint).int32(message.start); + /* optional int32 end = 2; */ + if (message.end !== undefined) + writer.tag(2, WireType.Varint).int32(message.end); + /* optional google.protobuf.ExtensionRangeOptions options = 3; */ + if (message.options) + ExtensionRangeOptions.internalBinaryWrite( + message.options, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.DescriptorProto.ExtensionRange + */ +export const DescriptorProto_ExtensionRange = + new DescriptorProto_ExtensionRange$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DescriptorProto_ReservedRange$Type extends MessageType { + constructor() { + super('google.protobuf.DescriptorProto.ReservedRange', [ + { + no: 1, + name: 'start', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 2, + name: 'end', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + ]); + } + create( + value?: PartialMessage, + ): DescriptorProto_ReservedRange { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DescriptorProto_ReservedRange, + ): DescriptorProto_ReservedRange { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 start */ 1: + message.start = reader.int32(); + break; + case /* optional int32 end */ 2: + message.end = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DescriptorProto_ReservedRange, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional int32 start = 1; */ + if (message.start !== undefined) + writer.tag(1, WireType.Varint).int32(message.start); + /* optional int32 end = 2; */ + if (message.end !== undefined) + writer.tag(2, WireType.Varint).int32(message.end); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.DescriptorProto.ReservedRange + */ +export const DescriptorProto_ReservedRange = + new DescriptorProto_ReservedRange$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExtensionRangeOptions$Type extends MessageType { + constructor() { + super('google.protobuf.ExtensionRangeOptions', [ + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): ExtensionRangeOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExtensionRangeOptions, + ): ExtensionRangeOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExtensionRangeOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.ExtensionRangeOptions + */ +export const ExtensionRangeOptions = new ExtensionRangeOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FieldDescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.FieldDescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'number', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 4, + name: 'label', + kind: 'enum', + opt: true, + T: () => [ + 'google.protobuf.FieldDescriptorProto.Label', + FieldDescriptorProto_Label, + 'LABEL_', + ], + }, + { + no: 5, + name: 'type', + kind: 'enum', + opt: true, + T: () => [ + 'google.protobuf.FieldDescriptorProto.Type', + FieldDescriptorProto_Type, + 'TYPE_', + ], + }, + { + no: 6, + name: 'type_name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'extendee', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 7, + name: 'default_value', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 9, + name: 'oneof_index', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 10, + name: 'json_name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { no: 8, name: 'options', kind: 'message', T: () => FieldOptions }, + { + no: 17, + name: 'proto3_optional', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create(value?: PartialMessage): FieldDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FieldDescriptorProto, + ): FieldDescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional int32 number */ 3: + message.number = reader.int32(); + break; + case /* optional google.protobuf.FieldDescriptorProto.Label label */ 4: + message.label = reader.int32(); + break; + case /* optional google.protobuf.FieldDescriptorProto.Type type */ 5: + message.type = reader.int32(); + break; + case /* optional string type_name */ 6: + message.typeName = reader.string(); + break; + case /* optional string extendee */ 2: + message.extendee = reader.string(); + break; + case /* optional string default_value */ 7: + message.defaultValue = reader.string(); + break; + case /* optional int32 oneof_index */ 9: + message.oneofIndex = reader.int32(); + break; + case /* optional string json_name */ 10: + message.jsonName = reader.string(); + break; + case /* optional google.protobuf.FieldOptions options */ 8: + message.options = FieldOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + case /* optional bool proto3_optional */ 17: + message.proto3Optional = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FieldDescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional int32 number = 3; */ + if (message.number !== undefined) + writer.tag(3, WireType.Varint).int32(message.number); + /* optional google.protobuf.FieldDescriptorProto.Label label = 4; */ + if (message.label !== undefined) + writer.tag(4, WireType.Varint).int32(message.label); + /* optional google.protobuf.FieldDescriptorProto.Type type = 5; */ + if (message.type !== undefined) + writer.tag(5, WireType.Varint).int32(message.type); + /* optional string type_name = 6; */ + if (message.typeName !== undefined) + writer.tag(6, WireType.LengthDelimited).string(message.typeName); + /* optional string extendee = 2; */ + if (message.extendee !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.extendee); + /* optional string default_value = 7; */ + if (message.defaultValue !== undefined) + writer.tag(7, WireType.LengthDelimited).string(message.defaultValue); + /* optional int32 oneof_index = 9; */ + if (message.oneofIndex !== undefined) + writer.tag(9, WireType.Varint).int32(message.oneofIndex); + /* optional string json_name = 10; */ + if (message.jsonName !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.jsonName); + /* optional google.protobuf.FieldOptions options = 8; */ + if (message.options) + FieldOptions.internalBinaryWrite( + message.options, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional bool proto3_optional = 17; */ + if (message.proto3Optional !== undefined) + writer.tag(17, WireType.Varint).bool(message.proto3Optional); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.FieldDescriptorProto + */ +export const FieldDescriptorProto = new FieldDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OneofDescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.OneofDescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { no: 2, name: 'options', kind: 'message', T: () => OneofOptions }, + ]); + } + create(value?: PartialMessage): OneofDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OneofDescriptorProto, + ): OneofDescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional google.protobuf.OneofOptions options */ 2: + message.options = OneofOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OneofDescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional google.protobuf.OneofOptions options = 2; */ + if (message.options) + OneofOptions.internalBinaryWrite( + message.options, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.OneofDescriptorProto + */ +export const OneofDescriptorProto = new OneofDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumDescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.EnumDescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'value', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => EnumValueDescriptorProto, + }, + { no: 3, name: 'options', kind: 'message', T: () => EnumOptions }, + { + no: 4, + name: 'reserved_range', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => EnumDescriptorProto_EnumReservedRange, + }, + { + no: 5, + name: 'reserved_name', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): EnumDescriptorProto { + const message = { value: [], reservedRange: [], reservedName: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EnumDescriptorProto, + ): EnumDescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.protobuf.EnumValueDescriptorProto value */ 2: + message.value.push( + EnumValueDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* optional google.protobuf.EnumOptions options */ 3: + message.options = EnumOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + case /* repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range */ 4: + message.reservedRange.push( + EnumDescriptorProto_EnumReservedRange.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated string reserved_name */ 5: + message.reservedName.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EnumDescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.EnumValueDescriptorProto value = 2; */ + for (let i = 0; i < message.value.length; i++) + EnumValueDescriptorProto.internalBinaryWrite( + message.value[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional google.protobuf.EnumOptions options = 3; */ + if (message.options) + EnumOptions.internalBinaryWrite( + message.options, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; */ + for (let i = 0; i < message.reservedRange.length; i++) + EnumDescriptorProto_EnumReservedRange.internalBinaryWrite( + message.reservedRange[i], + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated string reserved_name = 5; */ + for (let i = 0; i < message.reservedName.length; i++) + writer.tag(5, WireType.LengthDelimited).string(message.reservedName[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumDescriptorProto + */ +export const EnumDescriptorProto = new EnumDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumDescriptorProto_EnumReservedRange$Type extends MessageType { + constructor() { + super('google.protobuf.EnumDescriptorProto.EnumReservedRange', [ + { + no: 1, + name: 'start', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 2, + name: 'end', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + ]); + } + create( + value?: PartialMessage, + ): EnumDescriptorProto_EnumReservedRange { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EnumDescriptorProto_EnumReservedRange, + ): EnumDescriptorProto_EnumReservedRange { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 start */ 1: + message.start = reader.int32(); + break; + case /* optional int32 end */ 2: + message.end = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EnumDescriptorProto_EnumReservedRange, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional int32 start = 1; */ + if (message.start !== undefined) + writer.tag(1, WireType.Varint).int32(message.start); + /* optional int32 end = 2; */ + if (message.end !== undefined) + writer.tag(2, WireType.Varint).int32(message.end); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export const EnumDescriptorProto_EnumReservedRange = + new EnumDescriptorProto_EnumReservedRange$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumValueDescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.EnumValueDescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'number', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { no: 3, name: 'options', kind: 'message', T: () => EnumValueOptions }, + ]); + } + create( + value?: PartialMessage, + ): EnumValueDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EnumValueDescriptorProto, + ): EnumValueDescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional int32 number */ 2: + message.number = reader.int32(); + break; + case /* optional google.protobuf.EnumValueOptions options */ 3: + message.options = EnumValueOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EnumValueDescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional int32 number = 2; */ + if (message.number !== undefined) + writer.tag(2, WireType.Varint).int32(message.number); + /* optional google.protobuf.EnumValueOptions options = 3; */ + if (message.options) + EnumValueOptions.internalBinaryWrite( + message.options, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumValueDescriptorProto + */ +export const EnumValueDescriptorProto = new EnumValueDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ServiceDescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.ServiceDescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'method', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => MethodDescriptorProto, + }, + { no: 3, name: 'options', kind: 'message', T: () => ServiceOptions }, + ]); + } + create( + value?: PartialMessage, + ): ServiceDescriptorProto { + const message = { method: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ServiceDescriptorProto, + ): ServiceDescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.protobuf.MethodDescriptorProto method */ 2: + message.method.push( + MethodDescriptorProto.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* optional google.protobuf.ServiceOptions options */ 3: + message.options = ServiceOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ServiceDescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.MethodDescriptorProto method = 2; */ + for (let i = 0; i < message.method.length; i++) + MethodDescriptorProto.internalBinaryWrite( + message.method[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional google.protobuf.ServiceOptions options = 3; */ + if (message.options) + ServiceOptions.internalBinaryWrite( + message.options, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.ServiceDescriptorProto + */ +export const ServiceDescriptorProto = new ServiceDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MethodDescriptorProto$Type extends MessageType { + constructor() { + super('google.protobuf.MethodDescriptorProto', [ + { + no: 1, + name: 'name', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'input_type', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'output_type', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { no: 4, name: 'options', kind: 'message', T: () => MethodOptions }, + { + no: 5, + name: 'client_streaming', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 6, + name: 'server_streaming', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create(value?: PartialMessage): MethodDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: MethodDescriptorProto, + ): MethodDescriptorProto { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional string input_type */ 2: + message.inputType = reader.string(); + break; + case /* optional string output_type */ 3: + message.outputType = reader.string(); + break; + case /* optional google.protobuf.MethodOptions options */ 4: + message.options = MethodOptions.internalBinaryRead( + reader, + reader.uint32(), + options, + message.options, + ); + break; + case /* optional bool client_streaming */ 5: + message.clientStreaming = reader.bool(); + break; + case /* optional bool server_streaming */ 6: + message.serverStreaming = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: MethodDescriptorProto, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional string input_type = 2; */ + if (message.inputType !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.inputType); + /* optional string output_type = 3; */ + if (message.outputType !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.outputType); + /* optional google.protobuf.MethodOptions options = 4; */ + if (message.options) + MethodOptions.internalBinaryWrite( + message.options, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional bool client_streaming = 5; */ + if (message.clientStreaming !== undefined) + writer.tag(5, WireType.Varint).bool(message.clientStreaming); + /* optional bool server_streaming = 6; */ + if (message.serverStreaming !== undefined) + writer.tag(6, WireType.Varint).bool(message.serverStreaming); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.MethodDescriptorProto + */ +export const MethodDescriptorProto = new MethodDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FileOptions$Type extends MessageType { + constructor() { + super('google.protobuf.FileOptions', [ + { + no: 1, + name: 'java_package', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 8, + name: 'java_outer_classname', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 10, + name: 'java_multiple_files', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 20, + name: 'java_generate_equals_and_hash', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 27, + name: 'java_string_check_utf8', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 9, + name: 'optimize_for', + kind: 'enum', + opt: true, + T: () => [ + 'google.protobuf.FileOptions.OptimizeMode', + FileOptions_OptimizeMode, + ], + }, + { + no: 11, + name: 'go_package', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 16, + name: 'cc_generic_services', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 17, + name: 'java_generic_services', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 18, + name: 'py_generic_services', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 42, + name: 'php_generic_services', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 23, + name: 'deprecated', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 31, + name: 'cc_enable_arenas', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 36, + name: 'objc_class_prefix', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 37, + name: 'csharp_namespace', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 39, + name: 'swift_prefix', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 40, + name: 'php_class_prefix', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 41, + name: 'php_namespace', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 44, + name: 'php_metadata_namespace', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 45, + name: 'ruby_package', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): FileOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FileOptions, + ): FileOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string java_package */ 1: + message.javaPackage = reader.string(); + break; + case /* optional string java_outer_classname */ 8: + message.javaOuterClassname = reader.string(); + break; + case /* optional bool java_multiple_files */ 10: + message.javaMultipleFiles = reader.bool(); + break; + case /* optional bool java_generate_equals_and_hash = 20 [deprecated = true];*/ 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case /* optional bool java_string_check_utf8 */ 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case /* optional google.protobuf.FileOptions.OptimizeMode optimize_for */ 9: + message.optimizeFor = reader.int32(); + break; + case /* optional string go_package */ 11: + message.goPackage = reader.string(); + break; + case /* optional bool cc_generic_services */ 16: + message.ccGenericServices = reader.bool(); + break; + case /* optional bool java_generic_services */ 17: + message.javaGenericServices = reader.bool(); + break; + case /* optional bool py_generic_services */ 18: + message.pyGenericServices = reader.bool(); + break; + case /* optional bool php_generic_services */ 42: + message.phpGenericServices = reader.bool(); + break; + case /* optional bool deprecated */ 23: + message.deprecated = reader.bool(); + break; + case /* optional bool cc_enable_arenas */ 31: + message.ccEnableArenas = reader.bool(); + break; + case /* optional string objc_class_prefix */ 36: + message.objcClassPrefix = reader.string(); + break; + case /* optional string csharp_namespace */ 37: + message.csharpNamespace = reader.string(); + break; + case /* optional string swift_prefix */ 39: + message.swiftPrefix = reader.string(); + break; + case /* optional string php_class_prefix */ 40: + message.phpClassPrefix = reader.string(); + break; + case /* optional string php_namespace */ 41: + message.phpNamespace = reader.string(); + break; + case /* optional string php_metadata_namespace */ 44: + message.phpMetadataNamespace = reader.string(); + break; + case /* optional string ruby_package */ 45: + message.rubyPackage = reader.string(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FileOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional string java_package = 1; */ + if (message.javaPackage !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.javaPackage); + /* optional string java_outer_classname = 8; */ + if (message.javaOuterClassname !== undefined) + writer + .tag(8, WireType.LengthDelimited) + .string(message.javaOuterClassname); + /* optional bool java_multiple_files = 10; */ + if (message.javaMultipleFiles !== undefined) + writer.tag(10, WireType.Varint).bool(message.javaMultipleFiles); + /* optional bool java_generate_equals_and_hash = 20 [deprecated = true]; */ + if (message.javaGenerateEqualsAndHash !== undefined) + writer.tag(20, WireType.Varint).bool(message.javaGenerateEqualsAndHash); + /* optional bool java_string_check_utf8 = 27; */ + if (message.javaStringCheckUtf8 !== undefined) + writer.tag(27, WireType.Varint).bool(message.javaStringCheckUtf8); + /* optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9; */ + if (message.optimizeFor !== undefined) + writer.tag(9, WireType.Varint).int32(message.optimizeFor); + /* optional string go_package = 11; */ + if (message.goPackage !== undefined) + writer.tag(11, WireType.LengthDelimited).string(message.goPackage); + /* optional bool cc_generic_services = 16; */ + if (message.ccGenericServices !== undefined) + writer.tag(16, WireType.Varint).bool(message.ccGenericServices); + /* optional bool java_generic_services = 17; */ + if (message.javaGenericServices !== undefined) + writer.tag(17, WireType.Varint).bool(message.javaGenericServices); + /* optional bool py_generic_services = 18; */ + if (message.pyGenericServices !== undefined) + writer.tag(18, WireType.Varint).bool(message.pyGenericServices); + /* optional bool php_generic_services = 42; */ + if (message.phpGenericServices !== undefined) + writer.tag(42, WireType.Varint).bool(message.phpGenericServices); + /* optional bool deprecated = 23; */ + if (message.deprecated !== undefined) + writer.tag(23, WireType.Varint).bool(message.deprecated); + /* optional bool cc_enable_arenas = 31; */ + if (message.ccEnableArenas !== undefined) + writer.tag(31, WireType.Varint).bool(message.ccEnableArenas); + /* optional string objc_class_prefix = 36; */ + if (message.objcClassPrefix !== undefined) + writer.tag(36, WireType.LengthDelimited).string(message.objcClassPrefix); + /* optional string csharp_namespace = 37; */ + if (message.csharpNamespace !== undefined) + writer.tag(37, WireType.LengthDelimited).string(message.csharpNamespace); + /* optional string swift_prefix = 39; */ + if (message.swiftPrefix !== undefined) + writer.tag(39, WireType.LengthDelimited).string(message.swiftPrefix); + /* optional string php_class_prefix = 40; */ + if (message.phpClassPrefix !== undefined) + writer.tag(40, WireType.LengthDelimited).string(message.phpClassPrefix); + /* optional string php_namespace = 41; */ + if (message.phpNamespace !== undefined) + writer.tag(41, WireType.LengthDelimited).string(message.phpNamespace); + /* optional string php_metadata_namespace = 44; */ + if (message.phpMetadataNamespace !== undefined) + writer + .tag(44, WireType.LengthDelimited) + .string(message.phpMetadataNamespace); + /* optional string ruby_package = 45; */ + if (message.rubyPackage !== undefined) + writer.tag(45, WireType.LengthDelimited).string(message.rubyPackage); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.FileOptions + */ +export const FileOptions = new FileOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MessageOptions$Type extends MessageType { + constructor() { + super('google.protobuf.MessageOptions', [ + { + no: 1, + name: 'message_set_wire_format', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 2, + name: 'no_standard_descriptor_accessor', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 3, + name: 'deprecated', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 7, + name: 'map_entry', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 11, + name: 'deprecated_legacy_json_field_conflicts', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): MessageOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: MessageOptions, + ): MessageOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool message_set_wire_format */ 1: + message.messageSetWireFormat = reader.bool(); + break; + case /* optional bool no_standard_descriptor_accessor */ 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case /* optional bool deprecated */ 3: + message.deprecated = reader.bool(); + break; + case /* optional bool map_entry */ 7: + message.mapEntry = reader.bool(); + break; + case /* optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];*/ 11: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: MessageOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional bool message_set_wire_format = 1; */ + if (message.messageSetWireFormat !== undefined) + writer.tag(1, WireType.Varint).bool(message.messageSetWireFormat); + /* optional bool no_standard_descriptor_accessor = 2; */ + if (message.noStandardDescriptorAccessor !== undefined) + writer.tag(2, WireType.Varint).bool(message.noStandardDescriptorAccessor); + /* optional bool deprecated = 3; */ + if (message.deprecated !== undefined) + writer.tag(3, WireType.Varint).bool(message.deprecated); + /* optional bool map_entry = 7; */ + if (message.mapEntry !== undefined) + writer.tag(7, WireType.Varint).bool(message.mapEntry); + /* optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; */ + if (message.deprecatedLegacyJsonFieldConflicts !== undefined) + writer + .tag(11, WireType.Varint) + .bool(message.deprecatedLegacyJsonFieldConflicts); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.MessageOptions + */ +export const MessageOptions = new MessageOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FieldOptions$Type extends MessageType { + constructor() { + super('google.protobuf.FieldOptions', [ + { + no: 1, + name: 'ctype', + kind: 'enum', + opt: true, + T: () => ['google.protobuf.FieldOptions.CType', FieldOptions_CType], + }, + { + no: 2, + name: 'packed', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 6, + name: 'jstype', + kind: 'enum', + opt: true, + T: () => ['google.protobuf.FieldOptions.JSType', FieldOptions_JSType], + }, + { + no: 5, + name: 'lazy', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 15, + name: 'unverified_lazy', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 3, + name: 'deprecated', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 10, + name: 'weak', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 16, + name: 'debug_redact', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 17, + name: 'retention', + kind: 'enum', + opt: true, + T: () => [ + 'google.protobuf.FieldOptions.OptionRetention', + FieldOptions_OptionRetention, + ], + }, + { + no: 18, + name: 'target', + kind: 'enum', + opt: true, + T: () => [ + 'google.protobuf.FieldOptions.OptionTargetType', + FieldOptions_OptionTargetType, + ], + }, + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): FieldOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FieldOptions, + ): FieldOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.FieldOptions.CType ctype */ 1: + message.ctype = reader.int32(); + break; + case /* optional bool packed */ 2: + message.packed = reader.bool(); + break; + case /* optional google.protobuf.FieldOptions.JSType jstype */ 6: + message.jstype = reader.int32(); + break; + case /* optional bool lazy */ 5: + message.lazy = reader.bool(); + break; + case /* optional bool unverified_lazy */ 15: + message.unverifiedLazy = reader.bool(); + break; + case /* optional bool deprecated */ 3: + message.deprecated = reader.bool(); + break; + case /* optional bool weak */ 10: + message.weak = reader.bool(); + break; + case /* optional bool debug_redact */ 16: + message.debugRedact = reader.bool(); + break; + case /* optional google.protobuf.FieldOptions.OptionRetention retention */ 17: + message.retention = reader.int32(); + break; + case /* optional google.protobuf.FieldOptions.OptionTargetType target */ 18: + message.target = reader.int32(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FieldOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional google.protobuf.FieldOptions.CType ctype = 1; */ + if (message.ctype !== undefined) + writer.tag(1, WireType.Varint).int32(message.ctype); + /* optional bool packed = 2; */ + if (message.packed !== undefined) + writer.tag(2, WireType.Varint).bool(message.packed); + /* optional google.protobuf.FieldOptions.JSType jstype = 6; */ + if (message.jstype !== undefined) + writer.tag(6, WireType.Varint).int32(message.jstype); + /* optional bool lazy = 5; */ + if (message.lazy !== undefined) + writer.tag(5, WireType.Varint).bool(message.lazy); + /* optional bool unverified_lazy = 15; */ + if (message.unverifiedLazy !== undefined) + writer.tag(15, WireType.Varint).bool(message.unverifiedLazy); + /* optional bool deprecated = 3; */ + if (message.deprecated !== undefined) + writer.tag(3, WireType.Varint).bool(message.deprecated); + /* optional bool weak = 10; */ + if (message.weak !== undefined) + writer.tag(10, WireType.Varint).bool(message.weak); + /* optional bool debug_redact = 16; */ + if (message.debugRedact !== undefined) + writer.tag(16, WireType.Varint).bool(message.debugRedact); + /* optional google.protobuf.FieldOptions.OptionRetention retention = 17; */ + if (message.retention !== undefined) + writer.tag(17, WireType.Varint).int32(message.retention); + /* optional google.protobuf.FieldOptions.OptionTargetType target = 18; */ + if (message.target !== undefined) + writer.tag(18, WireType.Varint).int32(message.target); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.FieldOptions + */ +export const FieldOptions = new FieldOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OneofOptions$Type extends MessageType { + constructor() { + super('google.protobuf.OneofOptions', [ + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): OneofOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OneofOptions, + ): OneofOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OneofOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.OneofOptions + */ +export const OneofOptions = new OneofOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumOptions$Type extends MessageType { + constructor() { + super('google.protobuf.EnumOptions', [ + { + no: 2, + name: 'allow_alias', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 3, + name: 'deprecated', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 6, + name: 'deprecated_legacy_json_field_conflicts', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): EnumOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EnumOptions, + ): EnumOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool allow_alias */ 2: + message.allowAlias = reader.bool(); + break; + case /* optional bool deprecated */ 3: + message.deprecated = reader.bool(); + break; + case /* optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];*/ 6: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EnumOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional bool allow_alias = 2; */ + if (message.allowAlias !== undefined) + writer.tag(2, WireType.Varint).bool(message.allowAlias); + /* optional bool deprecated = 3; */ + if (message.deprecated !== undefined) + writer.tag(3, WireType.Varint).bool(message.deprecated); + /* optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; */ + if (message.deprecatedLegacyJsonFieldConflicts !== undefined) + writer + .tag(6, WireType.Varint) + .bool(message.deprecatedLegacyJsonFieldConflicts); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumOptions + */ +export const EnumOptions = new EnumOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumValueOptions$Type extends MessageType { + constructor() { + super('google.protobuf.EnumValueOptions', [ + { + no: 1, + name: 'deprecated', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): EnumValueOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EnumValueOptions, + ): EnumValueOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool deprecated */ 1: + message.deprecated = reader.bool(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EnumValueOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional bool deprecated = 1; */ + if (message.deprecated !== undefined) + writer.tag(1, WireType.Varint).bool(message.deprecated); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumValueOptions + */ +export const EnumValueOptions = new EnumValueOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ServiceOptions$Type extends MessageType { + constructor() { + super('google.protobuf.ServiceOptions', [ + { + no: 33, + name: 'deprecated', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): ServiceOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ServiceOptions, + ): ServiceOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool deprecated */ 33: + message.deprecated = reader.bool(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ServiceOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional bool deprecated = 33; */ + if (message.deprecated !== undefined) + writer.tag(33, WireType.Varint).bool(message.deprecated); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.ServiceOptions + */ +export const ServiceOptions = new ServiceOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MethodOptions$Type extends MessageType { + constructor() { + super('google.protobuf.MethodOptions', [ + { + no: 33, + name: 'deprecated', + kind: 'scalar', + opt: true, + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 34, + name: 'idempotency_level', + kind: 'enum', + opt: true, + T: () => [ + 'google.protobuf.MethodOptions.IdempotencyLevel', + MethodOptions_IdempotencyLevel, + ], + }, + { + no: 999, + name: 'uninterpreted_option', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption, + }, + ]); + } + create(value?: PartialMessage): MethodOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: MethodOptions, + ): MethodOptions { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool deprecated */ 33: + message.deprecated = reader.bool(); + break; + case /* optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level */ 34: + message.idempotencyLevel = reader.int32(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push( + UninterpretedOption.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: MethodOptions, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional bool deprecated = 33; */ + if (message.deprecated !== undefined) + writer.tag(33, WireType.Varint).bool(message.deprecated); + /* optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34; */ + if (message.idempotencyLevel !== undefined) + writer.tag(34, WireType.Varint).int32(message.idempotencyLevel); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite( + message.uninterpretedOption[i], + writer.tag(999, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.MethodOptions + */ +export const MethodOptions = new MethodOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UninterpretedOption$Type extends MessageType { + constructor() { + super('google.protobuf.UninterpretedOption', [ + { + no: 2, + name: 'name', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => UninterpretedOption_NamePart, + }, + { + no: 3, + name: 'identifier_value', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'positive_int_value', + kind: 'scalar', + opt: true, + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 5, + name: 'negative_int_value', + kind: 'scalar', + opt: true, + T: 3 /* ScalarType.INT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 6, + name: 'double_value', + kind: 'scalar', + opt: true, + T: 1 /* ScalarType.DOUBLE*/, + }, + { + no: 7, + name: 'string_value', + kind: 'scalar', + opt: true, + T: 12 /* ScalarType.BYTES*/, + }, + { + no: 8, + name: 'aggregate_value', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): UninterpretedOption { + const message = { name: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UninterpretedOption, + ): UninterpretedOption { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.UninterpretedOption.NamePart name */ 2: + message.name.push( + UninterpretedOption_NamePart.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* optional string identifier_value */ 3: + message.identifierValue = reader.string(); + break; + case /* optional uint64 positive_int_value */ 4: + message.positiveIntValue = reader.uint64().toBigInt(); + break; + case /* optional int64 negative_int_value */ 5: + message.negativeIntValue = reader.int64().toBigInt(); + break; + case /* optional double double_value */ 6: + message.doubleValue = reader.double(); + break; + case /* optional bytes string_value */ 7: + message.stringValue = reader.bytes(); + break; + case /* optional string aggregate_value */ 8: + message.aggregateValue = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UninterpretedOption, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated google.protobuf.UninterpretedOption.NamePart name = 2; */ + for (let i = 0; i < message.name.length; i++) + UninterpretedOption_NamePart.internalBinaryWrite( + message.name[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional string identifier_value = 3; */ + if (message.identifierValue !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.identifierValue); + /* optional uint64 positive_int_value = 4; */ + if (message.positiveIntValue !== undefined) + writer.tag(4, WireType.Varint).uint64(message.positiveIntValue); + /* optional int64 negative_int_value = 5; */ + if (message.negativeIntValue !== undefined) + writer.tag(5, WireType.Varint).int64(message.negativeIntValue); + /* optional double double_value = 6; */ + if (message.doubleValue !== undefined) + writer.tag(6, WireType.Bit64).double(message.doubleValue); + /* optional bytes string_value = 7; */ + if (message.stringValue !== undefined) + writer.tag(7, WireType.LengthDelimited).bytes(message.stringValue); + /* optional string aggregate_value = 8; */ + if (message.aggregateValue !== undefined) + writer.tag(8, WireType.LengthDelimited).string(message.aggregateValue); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.UninterpretedOption + */ +export const UninterpretedOption = new UninterpretedOption$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UninterpretedOption_NamePart$Type extends MessageType { + constructor() { + super('google.protobuf.UninterpretedOption.NamePart', [ + { no: 1, name: 'name_part', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'is_extension', + kind: 'scalar', + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create( + value?: PartialMessage, + ): UninterpretedOption_NamePart { + const message = { namePart: '', isExtension: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UninterpretedOption_NamePart, + ): UninterpretedOption_NamePart { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name_part */ 1: + message.namePart = reader.string(); + break; + case /* bool is_extension */ 2: + message.isExtension = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UninterpretedOption_NamePart, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string name_part = 1; */ + if (message.namePart !== '') + writer.tag(1, WireType.LengthDelimited).string(message.namePart); + /* bool is_extension = 2; */ + if (message.isExtension !== false) + writer.tag(2, WireType.Varint).bool(message.isExtension); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.UninterpretedOption.NamePart + */ +export const UninterpretedOption_NamePart = + new UninterpretedOption_NamePart$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourceCodeInfo$Type extends MessageType { + constructor() { + super('google.protobuf.SourceCodeInfo', [ + { + no: 1, + name: 'location', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => SourceCodeInfo_Location, + }, + ]); + } + create(value?: PartialMessage): SourceCodeInfo { + const message = { location: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SourceCodeInfo, + ): SourceCodeInfo { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.SourceCodeInfo.Location location */ 1: + message.location.push( + SourceCodeInfo_Location.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SourceCodeInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated google.protobuf.SourceCodeInfo.Location location = 1; */ + for (let i = 0; i < message.location.length; i++) + SourceCodeInfo_Location.internalBinaryWrite( + message.location[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.SourceCodeInfo + */ +export const SourceCodeInfo = new SourceCodeInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourceCodeInfo_Location$Type extends MessageType { + constructor() { + super('google.protobuf.SourceCodeInfo.Location', [ + { + no: 1, + name: 'path', + kind: 'scalar', + repeat: 1 /* RepeatType.PACKED*/, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 2, + name: 'span', + kind: 'scalar', + repeat: 1 /* RepeatType.PACKED*/, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 3, + name: 'leading_comments', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'trailing_comments', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'leading_detached_comments', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): SourceCodeInfo_Location { + const message = { path: [], span: [], leadingDetachedComments: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SourceCodeInfo_Location, + ): SourceCodeInfo_Location { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated int32 path = 1 [packed = true];*/ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.path.push(reader.int32()); + else message.path.push(reader.int32()); + break; + case /* repeated int32 span = 2 [packed = true];*/ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.span.push(reader.int32()); + else message.span.push(reader.int32()); + break; + case /* optional string leading_comments */ 3: + message.leadingComments = reader.string(); + break; + case /* optional string trailing_comments */ 4: + message.trailingComments = reader.string(); + break; + case /* repeated string leading_detached_comments */ 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SourceCodeInfo_Location, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated int32 path = 1 [packed = true]; */ + if (message.path.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.path.length; i++) + writer.int32(message.path[i]); + writer.join(); + } + /* repeated int32 span = 2 [packed = true]; */ + if (message.span.length) { + writer.tag(2, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.span.length; i++) + writer.int32(message.span[i]); + writer.join(); + } + /* optional string leading_comments = 3; */ + if (message.leadingComments !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.leadingComments); + /* optional string trailing_comments = 4; */ + if (message.trailingComments !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.trailingComments); + /* repeated string leading_detached_comments = 6; */ + for (let i = 0; i < message.leadingDetachedComments.length; i++) + writer + .tag(6, WireType.LengthDelimited) + .string(message.leadingDetachedComments[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.SourceCodeInfo.Location + */ +export const SourceCodeInfo_Location = new SourceCodeInfo_Location$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GeneratedCodeInfo$Type extends MessageType { + constructor() { + super('google.protobuf.GeneratedCodeInfo', [ + { + no: 1, + name: 'annotation', + kind: 'message', + repeat: 2 /* RepeatType.UNPACKED*/, + T: () => GeneratedCodeInfo_Annotation, + }, + ]); + } + create(value?: PartialMessage): GeneratedCodeInfo { + const message = { annotation: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GeneratedCodeInfo, + ): GeneratedCodeInfo { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.GeneratedCodeInfo.Annotation annotation */ 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GeneratedCodeInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; */ + for (let i = 0; i < message.annotation.length; i++) + GeneratedCodeInfo_Annotation.internalBinaryWrite( + message.annotation[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.GeneratedCodeInfo + */ +export const GeneratedCodeInfo = new GeneratedCodeInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GeneratedCodeInfo_Annotation$Type extends MessageType { + constructor() { + super('google.protobuf.GeneratedCodeInfo.Annotation', [ + { + no: 1, + name: 'path', + kind: 'scalar', + repeat: 1 /* RepeatType.PACKED*/, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 2, + name: 'source_file', + kind: 'scalar', + opt: true, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'begin', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 4, + name: 'end', + kind: 'scalar', + opt: true, + T: 5 /* ScalarType.INT32*/, + }, + { + no: 5, + name: 'semantic', + kind: 'enum', + opt: true, + T: () => [ + 'google.protobuf.GeneratedCodeInfo.Annotation.Semantic', + GeneratedCodeInfo_Annotation_Semantic, + ], + }, + ]); + } + create( + value?: PartialMessage, + ): GeneratedCodeInfo_Annotation { + const message = { path: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GeneratedCodeInfo_Annotation, + ): GeneratedCodeInfo_Annotation { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated int32 path = 1 [packed = true];*/ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.path.push(reader.int32()); + else message.path.push(reader.int32()); + break; + case /* optional string source_file */ 2: + message.sourceFile = reader.string(); + break; + case /* optional int32 begin */ 3: + message.begin = reader.int32(); + break; + case /* optional int32 end */ 4: + message.end = reader.int32(); + break; + case /* optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic */ 5: + message.semantic = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GeneratedCodeInfo_Annotation, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated int32 path = 1 [packed = true]; */ + if (message.path.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.path.length; i++) + writer.int32(message.path[i]); + writer.join(); + } + /* optional string source_file = 2; */ + if (message.sourceFile !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.sourceFile); + /* optional int32 begin = 3; */ + if (message.begin !== undefined) + writer.tag(3, WireType.Varint).int32(message.begin); + /* optional int32 end = 4; */ + if (message.end !== undefined) + writer.tag(4, WireType.Varint).int32(message.end); + /* optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; */ + if (message.semantic !== undefined) + writer.tag(5, WireType.Varint).int32(message.semantic); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.GeneratedCodeInfo.Annotation + */ +export const GeneratedCodeInfo_Annotation = + new GeneratedCodeInfo_Annotation$Type(); diff --git a/frontend/src/proto-gen/google/protobuf/wrappers.ts b/frontend/src/proto-gen/google/protobuf/wrappers.ts new file mode 100644 index 0000000..f37473a --- /dev/null +++ b/frontend/src/proto-gen/google/protobuf/wrappers.ts @@ -0,0 +1,1086 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "google/protobuf/wrappers.proto" (package "google.protobuf", syntax proto3) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. +// +// @ts-nocheck + +import { ScalarType } from '@protobuf-ts/runtime'; +import { LongType } from '@protobuf-ts/runtime'; +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import type { JsonValue } from '@protobuf-ts/runtime'; +import type { JsonReadOptions } from '@protobuf-ts/runtime'; +import type { JsonWriteOptions } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + * + * @generated from protobuf message google.protobuf.DoubleValue + */ +export interface DoubleValue { + /** + * The double value. + * + * @generated from protobuf field: double value = 1; + */ + value: number; +} +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + * + * @generated from protobuf message google.protobuf.FloatValue + */ +export interface FloatValue { + /** + * The float value. + * + * @generated from protobuf field: float value = 1; + */ + value: number; +} +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + * + * @generated from protobuf message google.protobuf.Int64Value + */ +export interface Int64Value { + /** + * The int64 value. + * + * @generated from protobuf field: int64 value = 1; + */ + value: bigint; +} +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + * + * @generated from protobuf message google.protobuf.UInt64Value + */ +export interface UInt64Value { + /** + * The uint64 value. + * + * @generated from protobuf field: uint64 value = 1; + */ + value: bigint; +} +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + * + * @generated from protobuf message google.protobuf.Int32Value + */ +export interface Int32Value { + /** + * The int32 value. + * + * @generated from protobuf field: int32 value = 1; + */ + value: number; +} +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + * + * @generated from protobuf message google.protobuf.UInt32Value + */ +export interface UInt32Value { + /** + * The uint32 value. + * + * @generated from protobuf field: uint32 value = 1; + */ + value: number; +} +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + * + * @generated from protobuf message google.protobuf.BoolValue + */ +export interface BoolValue { + /** + * The bool value. + * + * @generated from protobuf field: bool value = 1; + */ + value: boolean; +} +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + * + * @generated from protobuf message google.protobuf.StringValue + */ +export interface StringValue { + /** + * The string value. + * + * @generated from protobuf field: string value = 1; + */ + value: string; +} +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + * + * @generated from protobuf message google.protobuf.BytesValue + */ +export interface BytesValue { + /** + * The bytes value. + * + * @generated from protobuf field: bytes value = 1; + */ + value: Uint8Array; +} +// @generated message type with reflection information, may provide speed optimized methods +class DoubleValue$Type extends MessageType { + constructor() { + super('google.protobuf.DoubleValue', [ + { no: 1, name: 'value', kind: 'scalar', T: 1 /* ScalarType.DOUBLE*/ }, + ]); + } + /** + * Encode `DoubleValue` to JSON number. + */ + internalJsonWrite( + message: DoubleValue, + options: JsonWriteOptions, + ): JsonValue { + return this.refJsonWriter.scalar(2, message.value, 'value', false, true); + } + /** + * Decode `DoubleValue` from JSON number. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: DoubleValue, + ): DoubleValue { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + 1, + undefined, + 'value', + ) as number; + return target; + } + create(value?: PartialMessage): DoubleValue { + const message = { value: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DoubleValue, + ): DoubleValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* double value */ 1: + message.value = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DoubleValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* double value = 1; */ + if (message.value !== 0) + writer.tag(1, WireType.Bit64).double(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.DoubleValue + */ +export const DoubleValue = new DoubleValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FloatValue$Type extends MessageType { + constructor() { + super('google.protobuf.FloatValue', [ + { no: 1, name: 'value', kind: 'scalar', T: 2 /* ScalarType.FLOAT*/ }, + ]); + } + /** + * Encode `FloatValue` to JSON number. + */ + internalJsonWrite(message: FloatValue, options: JsonWriteOptions): JsonValue { + return this.refJsonWriter.scalar(1, message.value, 'value', false, true); + } + /** + * Decode `FloatValue` from JSON number. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: FloatValue, + ): FloatValue { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + 1, + undefined, + 'value', + ) as number; + return target; + } + create(value?: PartialMessage): FloatValue { + const message = { value: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FloatValue, + ): FloatValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* float value */ 1: + message.value = reader.float(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FloatValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* float value = 1; */ + if (message.value !== 0) writer.tag(1, WireType.Bit32).float(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.FloatValue + */ +export const FloatValue = new FloatValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Int64Value$Type extends MessageType { + constructor() { + super('google.protobuf.Int64Value', [ + { + no: 1, + name: 'value', + kind: 'scalar', + T: 3 /* ScalarType.INT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + /** + * Encode `Int64Value` to JSON string. + */ + internalJsonWrite(message: Int64Value, options: JsonWriteOptions): JsonValue { + return this.refJsonWriter.scalar( + ScalarType.INT64, + message.value, + 'value', + false, + true, + ); + } + /** + * Decode `Int64Value` from JSON string. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: Int64Value, + ): Int64Value { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + ScalarType.INT64, + LongType.BIGINT, + 'value', + ) as any; + return target; + } + create(value?: PartialMessage): Int64Value { + const message = { value: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Int64Value, + ): Int64Value { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 value */ 1: + message.value = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Int64Value, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* int64 value = 1; */ + if (message.value !== 0n) + writer.tag(1, WireType.Varint).int64(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.Int64Value + */ +export const Int64Value = new Int64Value$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UInt64Value$Type extends MessageType { + constructor() { + super('google.protobuf.UInt64Value', [ + { + no: 1, + name: 'value', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + /** + * Encode `UInt64Value` to JSON string. + */ + internalJsonWrite( + message: UInt64Value, + options: JsonWriteOptions, + ): JsonValue { + return this.refJsonWriter.scalar( + ScalarType.UINT64, + message.value, + 'value', + false, + true, + ); + } + /** + * Decode `UInt64Value` from JSON string. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: UInt64Value, + ): UInt64Value { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + ScalarType.UINT64, + LongType.BIGINT, + 'value', + ) as any; + return target; + } + create(value?: PartialMessage): UInt64Value { + const message = { value: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UInt64Value, + ): UInt64Value { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 value */ 1: + message.value = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UInt64Value, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 value = 1; */ + if (message.value !== 0n) + writer.tag(1, WireType.Varint).uint64(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.UInt64Value + */ +export const UInt64Value = new UInt64Value$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Int32Value$Type extends MessageType { + constructor() { + super('google.protobuf.Int32Value', [ + { no: 1, name: 'value', kind: 'scalar', T: 5 /* ScalarType.INT32*/ }, + ]); + } + /** + * Encode `Int32Value` to JSON string. + */ + internalJsonWrite(message: Int32Value, options: JsonWriteOptions): JsonValue { + return this.refJsonWriter.scalar(5, message.value, 'value', false, true); + } + /** + * Decode `Int32Value` from JSON string. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: Int32Value, + ): Int32Value { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + 5, + undefined, + 'value', + ) as number; + return target; + } + create(value?: PartialMessage): Int32Value { + const message = { value: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Int32Value, + ): Int32Value { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 value */ 1: + message.value = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Int32Value, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* int32 value = 1; */ + if (message.value !== 0) + writer.tag(1, WireType.Varint).int32(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.Int32Value + */ +export const Int32Value = new Int32Value$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UInt32Value$Type extends MessageType { + constructor() { + super('google.protobuf.UInt32Value', [ + { no: 1, name: 'value', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + ]); + } + /** + * Encode `UInt32Value` to JSON string. + */ + internalJsonWrite( + message: UInt32Value, + options: JsonWriteOptions, + ): JsonValue { + return this.refJsonWriter.scalar(13, message.value, 'value', false, true); + } + /** + * Decode `UInt32Value` from JSON string. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: UInt32Value, + ): UInt32Value { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + 13, + undefined, + 'value', + ) as number; + return target; + } + create(value?: PartialMessage): UInt32Value { + const message = { value: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UInt32Value, + ): UInt32Value { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 value */ 1: + message.value = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UInt32Value, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint32 value = 1; */ + if (message.value !== 0) + writer.tag(1, WireType.Varint).uint32(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.UInt32Value + */ +export const UInt32Value = new UInt32Value$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BoolValue$Type extends MessageType { + constructor() { + super('google.protobuf.BoolValue', [ + { no: 1, name: 'value', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + /** + * Encode `BoolValue` to JSON bool. + */ + internalJsonWrite(message: BoolValue, options: JsonWriteOptions): JsonValue { + return message.value; + } + /** + * Decode `BoolValue` from JSON bool. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: BoolValue, + ): BoolValue { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + 8, + undefined, + 'value', + ) as boolean; + return target; + } + create(value?: PartialMessage): BoolValue { + const message = { value: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BoolValue, + ): BoolValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool value */ 1: + message.value = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BoolValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool value = 1; */ + if (message.value !== false) + writer.tag(1, WireType.Varint).bool(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.BoolValue + */ +export const BoolValue = new BoolValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StringValue$Type extends MessageType { + constructor() { + super('google.protobuf.StringValue', [ + { no: 1, name: 'value', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + /** + * Encode `StringValue` to JSON string. + */ + internalJsonWrite( + message: StringValue, + options: JsonWriteOptions, + ): JsonValue { + return message.value; + } + /** + * Decode `StringValue` from JSON string. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: StringValue, + ): StringValue { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + 9, + undefined, + 'value', + ) as string; + return target; + } + create(value?: PartialMessage): StringValue { + const message = { value: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: StringValue, + ): StringValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string value */ 1: + message.value = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: StringValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string value = 1; */ + if (message.value !== '') + writer.tag(1, WireType.LengthDelimited).string(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.StringValue + */ +export const StringValue = new StringValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BytesValue$Type extends MessageType { + constructor() { + super('google.protobuf.BytesValue', [ + { no: 1, name: 'value', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + /** + * Encode `BytesValue` to JSON string. + */ + internalJsonWrite(message: BytesValue, options: JsonWriteOptions): JsonValue { + return this.refJsonWriter.scalar(12, message.value, 'value', false, true); + } + /** + * Decode `BytesValue` from JSON string. + */ + internalJsonRead( + json: JsonValue, + options: JsonReadOptions, + target?: BytesValue, + ): BytesValue { + if (!target) target = this.create(); + target.value = this.refJsonReader.scalar( + json, + 12, + undefined, + 'value', + ) as Uint8Array; + return target; + } + create(value?: PartialMessage): BytesValue { + const message = { value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BytesValue, + ): BytesValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes value */ 1: + message.value = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BytesValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes value = 1; */ + if (message.value.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.BytesValue + */ +export const BytesValue = new BytesValue$Type(); diff --git a/frontend/src/proto-gen/massa/abi/v1/abi.ts b/frontend/src/proto-gen/massa/abi/v1/abi.ts new file mode 100644 index 0000000..1f65f0c --- /dev/null +++ b/frontend/src/proto-gen/massa/abi/v1/abi.ts @@ -0,0 +1,14173 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/abi/v1/abi.proto" (package "massa.abi.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { AddressCategory } from '../../model/v1/address'; +import { Slot } from '../../model/v1/slot'; +import { BytesValue } from '../../../google/protobuf/wrappers'; +import { ComparisonResult } from '../../model/v1/commons'; +import { NativeTime } from '../../model/v1/time'; +import { StringValue } from '../../../google/protobuf/wrappers'; +import { NativeAmount } from '../../model/v1/amount'; +/** + * Error message used in abi Response + * + * @generated from protobuf message massa.abi.v1.Error + */ +export interface Error { + /** + * a string representing the error + * + * @generated from protobuf field: string message = 1; + */ + message: string; +} +/** + * Create SC request + * + * @generated from protobuf message massa.abi.v1.CreateScRequest + */ +export interface CreateScRequest { + /** + * Bytecode is the compiled code of the smart contract + * + * @generated from protobuf field: bytes bytecode = 1; + */ + bytecode: Uint8Array; +} +/** + * Create SC result + * + * @generated from protobuf message massa.abi.v1.CreateScResult + */ +export interface CreateScResult { + /** + * Address of the just created smart contract + * + * @generated from protobuf field: string sc_address = 1; + */ + scAddress: string; +} +/** + * Call SC request + * + * @generated from protobuf message massa.abi.v1.CallRequest + */ +export interface CallRequest { + /** + * Address of the smart contract to call + * + * @generated from protobuf field: string target_sc_address = 1; + */ + targetScAddress: string; + /** + * Function to call in the targeted smart contract + * + * @generated from protobuf field: string target_function_name = 2; + */ + targetFunctionName: string; + /** + * Argument to the function serialized in a byte array. + * + * @generated from protobuf field: bytes function_arg = 3; + */ + functionArg: Uint8Array; + /** + * call_coins is the amount of coins to pay for the call + * + * @generated from protobuf field: massa.model.v1.NativeAmount call_coins = 4; + */ + callCoins?: NativeAmount; +} +/** + * Call SC response + * + * @generated from protobuf message massa.abi.v1.CallResponse + */ +export interface CallResponse { + /** + * Return_data is the return value of the function + * + * @generated from protobuf field: bytes data = 1; + */ + data: Uint8Array; +} +/** + * Local execution request + * + * @generated from protobuf message massa.abi.v1.LocalExecutionRequest + */ +export interface LocalExecutionRequest { + /** + * Bytecode is the compiled code of the smart contract + * + * @generated from protobuf field: bytes bytecode = 1; + */ + bytecode: Uint8Array; + /** + * Function to call in the targeted smart contract + * + * @generated from protobuf field: string target_function_name = 2; + */ + targetFunctionName: string; + /** + * Argument to the function serialized in a byte array. + * + * @generated from protobuf field: bytes function_arg = 3; + */ + functionArg: Uint8Array; +} +/** + * Local call response + * + * @generated from protobuf message massa.abi.v1.LocalExecutionResponse + */ +export interface LocalExecutionResponse { + /** + * Return_data is the return value of the function + * + * @generated from protobuf field: bytes data = 1; + */ + data: Uint8Array; +} +/** + * Generate event request + * + * @generated from protobuf message massa.abi.v1.GenerateEventRequest + */ +export interface GenerateEventRequest { + /** + * Event + * + * @generated from protobuf field: bytes event = 1; + */ + event: Uint8Array; +} +/** + * Generate event resulst + * + * @generated from protobuf message massa.abi.v1.GenerateEventResult + */ +export interface GenerateEventResult {} +/** + * Transfer coins request + * + * @generated from protobuf message massa.abi.v1.TransferCoinsRequest + */ +export interface TransferCoinsRequest { + /** + * The address of the recipient + * + * @generated from protobuf field: string target_address = 1; + */ + targetAddress: string; + /** + * The amount of coins to transfer + * + * @generated from protobuf field: massa.model.v1.NativeAmount amount_to_transfer = 2; + */ + amountToTransfer?: NativeAmount; + /** + * The address of the sender, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue sender_address = 3; + */ + senderAddress?: StringValue; +} +/** + * Transfer coin result + * + * @generated from protobuf message massa.abi.v1.TransferCoinsResult + */ +export interface TransferCoinsResult {} +/** + * Function exists request + * + * @generated from protobuf message massa.abi.v1.FunctionExistsRequest + */ +export interface FunctionExistsRequest { + /** + * Address of the smart contract to call + * + * @generated from protobuf field: string target_sc_address = 1; + */ + targetScAddress: string; + /** + * The name of the function to check the existance of + * + * @generated from protobuf field: string function_name = 2; + */ + functionName: string; +} +/** + * Function exists result + * + * @generated from protobuf message massa.abi.v1.FunctionExistsResult + */ +export interface FunctionExistsResult { + /** + * Exists is true if the function exists + * + * @generated from protobuf field: bool exists = 1; + */ + exists: boolean; +} +// Message returned in case of success of an ABI call. +// See the documentation of the specific result for the meaning of the fields. +// Call RespResult because Result will conflict with the Result type in Rust +// data MUST have the same name as they type in Rust they are converted to type + +/** + * Tips to check for completeness exec: + * `rg message | rg "\{" | rg "Result" | wc -l` + * the given count should be equal to the number of messages in RespResult + 1 + * the +1 comes from ResResult itself which is counted above + * + * @generated from protobuf message massa.abi.v1.RespResult + */ +export interface RespResult { + /** + * @generated from protobuf oneof: res + */ + res: + | { + oneofKind: 'addNativeAmountResult'; + /** + * @generated from protobuf field: massa.abi.v1.AddNativeAmountResult add_native_amount_result = 1; + */ + addNativeAmountResult: AddNativeAmountResult; + } + | { + oneofKind: 'addressFromPubKeyResult'; + /** + * @generated from protobuf field: massa.abi.v1.AddressFromPubKeyResult address_from_pub_key_result = 2; + */ + addressFromPubKeyResult: AddressFromPubKeyResult; + } + | { + oneofKind: 'appendDsValueResult'; + /** + * @generated from protobuf field: massa.abi.v1.AppendDsValueResult append_ds_value_result = 3; + */ + appendDsValueResult: AppendDsValueResult; + } + | { + oneofKind: 'base58CheckToBytesResult'; + /** + * @generated from protobuf field: massa.abi.v1.Base58CheckToBytesResult base58_check_to_bytes_result = 4; + */ + base58CheckToBytesResult: Base58CheckToBytesResult; + } + | { + oneofKind: 'bytesToBase58CheckResult'; + /** + * @generated from protobuf field: massa.abi.v1.BytesToBase58CheckResult bytes_to_base58_check_result = 5; + */ + bytesToBase58CheckResult: BytesToBase58CheckResult; + } + | { + oneofKind: 'callerHasWriteAccessResult'; + /** + * @generated from protobuf field: massa.abi.v1.CallerHasWriteAccessResult caller_has_write_access_result = 6; + */ + callerHasWriteAccessResult: CallerHasWriteAccessResult; + } + | { + oneofKind: 'checkAddressResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckAddressResult check_address_result = 7; + */ + checkAddressResult: CheckAddressResult; + } + | { + oneofKind: 'checkNativeAmountResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckNativeAmountResult check_native_amount_result = 8; + */ + checkNativeAmountResult: CheckNativeAmountResult; + } + | { + oneofKind: 'checkPubKeyResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckPubKeyResult check_pub_key_result = 9; + */ + checkPubKeyResult: CheckPubKeyResult; + } + | { + oneofKind: 'checkSigResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckSigResult check_sig_result = 10; + */ + checkSigResult: CheckSigResult; + } + | { + oneofKind: 'checkedAddNativeTimeResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckedAddNativeTimeResult checked_add_native_time_result = 11; + */ + checkedAddNativeTimeResult: CheckedAddNativeTimeResult; + } + | { + oneofKind: 'checkedDivRemNativeTimeResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckedDivRemNativeTimeResult checked_div_rem_native_time_result = 12; + */ + checkedDivRemNativeTimeResult: CheckedDivRemNativeTimeResult; + } + | { + oneofKind: 'checkedScalarDivRemNativeTimeResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckedScalarDivRemNativeTimeResult checked_scalar_div_rem_native_time_result = 13; + */ + checkedScalarDivRemNativeTimeResult: CheckedScalarDivRemNativeTimeResult; + } + | { + oneofKind: 'checkedScalarMulNativeTimeResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckedScalarMulNativeTimeResult checked_scalar_mul_native_time_result = 14; + */ + checkedScalarMulNativeTimeResult: CheckedScalarMulNativeTimeResult; + } + | { + oneofKind: 'checkedSubNativeTimeResult'; + /** + * @generated from protobuf field: massa.abi.v1.CheckedSubNativeTimeResult checked_sub_native_time_result = 15; + */ + checkedSubNativeTimeResult: CheckedSubNativeTimeResult; + } + | { + oneofKind: 'compareAddressResult'; + /** + * @generated from protobuf field: massa.abi.v1.CompareAddressResult compare_address_result = 16; + */ + compareAddressResult: CompareAddressResult; + } + | { + oneofKind: 'compareNativeAmountResult'; + /** + * @generated from protobuf field: massa.abi.v1.CompareNativeAmountResult compare_native_amount_result = 17; + */ + compareNativeAmountResult: CompareNativeAmountResult; + } + | { + oneofKind: 'compareNativeTimeResult'; + /** + * @generated from protobuf field: massa.abi.v1.CompareNativeTimeResult compare_native_time_result = 18; + */ + compareNativeTimeResult: CompareNativeTimeResult; + } + | { + oneofKind: 'comparePubKeyResult'; + /** + * @generated from protobuf field: massa.abi.v1.ComparePubKeyResult compare_pub_key_result = 19; + */ + comparePubKeyResult: ComparePubKeyResult; + } + | { + oneofKind: 'createScResult'; + /** + * @generated from protobuf field: massa.abi.v1.CreateScResult create_sc_result = 20; + */ + createScResult: CreateScResult; + } + | { + oneofKind: 'deleteDsEntryResult'; + /** + * @generated from protobuf field: massa.abi.v1.DeleteDsEntryResult delete_ds_entry_result = 21; + */ + deleteDsEntryResult: DeleteDsEntryResult; + } + | { + oneofKind: 'divRemNativeAmountResult'; + /** + * @generated from protobuf field: massa.abi.v1.DivRemNativeAmountResult div_rem_native_amount_result = 22; + */ + divRemNativeAmountResult: DivRemNativeAmountResult; + } + | { + oneofKind: 'dsEntryExistsResult'; + /** + * @generated from protobuf field: massa.abi.v1.DsEntryExistsResult ds_entry_exists_result = 23; + */ + dsEntryExistsResult: DsEntryExistsResult; + } + | { + oneofKind: 'functionExistsResult'; + /** + * @generated from protobuf field: massa.abi.v1.FunctionExistsResult function_exists_result = 24; + */ + functionExistsResult: FunctionExistsResult; + } + | { + oneofKind: 'generateEventResult'; + /** + * @generated from protobuf field: massa.abi.v1.GenerateEventResult generate_event_result = 25; + */ + generateEventResult: GenerateEventResult; + } + | { + oneofKind: 'getAddressCategoryResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetAddressCategoryResult get_address_category_result = 26; + */ + getAddressCategoryResult: GetAddressCategoryResult; + } + | { + oneofKind: 'getAddressVersionResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetAddressVersionResult get_address_version_result = 27; + */ + getAddressVersionResult: GetAddressVersionResult; + } + | { + oneofKind: 'getBalanceResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetBalanceResult get_balance_result = 28; + */ + getBalanceResult: GetBalanceResult; + } + | { + oneofKind: 'getBytecodeResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetBytecodeResult get_bytecode_result = 29; + */ + getBytecodeResult: GetBytecodeResult; + } + | { + oneofKind: 'getCallCoinsResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetCallCoinsResult get_call_coins_result = 30; + */ + getCallCoinsResult: GetCallCoinsResult; + } + | { + oneofKind: 'getCallStackResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetCallStackResult get_call_stack_result = 31; + */ + getCallStackResult: GetCallStackResult; + } + | { + oneofKind: 'getCurrentSlotResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetCurrentSlotResult get_current_slot_result = 32; + */ + getCurrentSlotResult: GetCurrentSlotResult; + } + | { + oneofKind: 'getDsKeysResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetDsKeysResult get_ds_keys_result = 33; + */ + getDsKeysResult: GetDsKeysResult; + } + | { + oneofKind: 'getDsValueResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetDsValueResult get_ds_value_result = 34; + */ + getDsValueResult: GetDsValueResult; + } + | { + oneofKind: 'getNativeTimeResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetNativeTimeResult get_native_time_result = 35; + */ + getNativeTimeResult: GetNativeTimeResult; + } + | { + oneofKind: 'getOpDataResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetOpDataResult get_op_data_result = 36; + */ + getOpDataResult: GetOpDataResult; + } + | { + oneofKind: 'getOpKeysResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetOpKeysResult get_op_keys_result = 37; + */ + getOpKeysResult: GetOpKeysResult; + } + | { + oneofKind: 'getOriginOperationIdResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetOriginOperationIdResult get_origin_operation_id_result = 38; + */ + getOriginOperationIdResult: GetOriginOperationIdResult; + } + | { + oneofKind: 'getOwnedAddressesResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetOwnedAddressesResult get_owned_addresses_result = 39; + */ + getOwnedAddressesResult: GetOwnedAddressesResult; + } + | { + oneofKind: 'getPubKeyVersionResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetPubKeyVersionResult get_pub_key_version_result = 40; + */ + getPubKeyVersionResult: GetPubKeyVersionResult; + } + | { + oneofKind: 'getRemainingGasResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetRemainingGasResult get_remaining_gas_result = 41; + */ + getRemainingGasResult: GetRemainingGasResult; + } + | { + oneofKind: 'getSignatureVersionResult'; + /** + * @generated from protobuf field: massa.abi.v1.GetSignatureVersionResult get_signature_version_result = 42; + */ + getSignatureVersionResult: GetSignatureVersionResult; + } + | { + oneofKind: 'hashBlake3Result'; + /** + * @generated from protobuf field: massa.abi.v1.HashBlake3Result hash_blake3_result = 43; + */ + hashBlake3Result: HashBlake3Result; + } + | { + oneofKind: 'hashSha256Result'; + /** + * @generated from protobuf field: massa.abi.v1.HashSha256Result hash_sha256_result = 44; + */ + hashSha256Result: HashSha256Result; + } + | { + oneofKind: 'opEntryExistsResult'; + /** + * @generated from protobuf field: massa.abi.v1.OpEntryExistsResult op_entry_exists_result = 45; + */ + opEntryExistsResult: OpEntryExistsResult; + } + | { + oneofKind: 'keccak256Result'; + /** + * @generated from protobuf field: massa.abi.v1.Keccak256Result keccak256_result = 46; + */ + keccak256Result: Keccak256Result; + } + | { + oneofKind: 'localExecutionResponse'; + /** + * @generated from protobuf field: massa.abi.v1.LocalExecutionResponse local_execution_response = 47; + */ + localExecutionResponse: LocalExecutionResponse; + } + | { + oneofKind: 'nativeAmountFromStringResult'; + /** + * @generated from protobuf field: massa.abi.v1.NativeAmountFromStringResult native_amount_from_string_result = 48; + */ + nativeAmountFromStringResult: NativeAmountFromStringResult; + } + | { + oneofKind: 'nativeAmountToStringResult'; + /** + * @generated from protobuf field: massa.abi.v1.NativeAmountToStringResult native_amount_to_string_result = 49; + */ + nativeAmountToStringResult: NativeAmountToStringResult; + } + | { + oneofKind: 'scalarDivRemNativeAmountResult'; + /** + * @generated from protobuf field: massa.abi.v1.ScalarDivRemNativeAmountResult scalar_div_rem_native_amount_result = 50; + */ + scalarDivRemNativeAmountResult: ScalarDivRemNativeAmountResult; + } + | { + oneofKind: 'scalarMulNativeAmountResult'; + /** + * @generated from protobuf field: massa.abi.v1.ScalarMulNativeAmountResult scalar_mul_native_amount_result = 51; + */ + scalarMulNativeAmountResult: ScalarMulNativeAmountResult; + } + | { + oneofKind: 'sendAsyncMessageResult'; + /** + * @generated from protobuf field: massa.abi.v1.SendAsyncMessageResult send_async_message_result = 52; + */ + sendAsyncMessageResult: SendAsyncMessageResult; + } + | { + oneofKind: 'setBytecodeResult'; + /** + * @generated from protobuf field: massa.abi.v1.SetBytecodeResult set_bytecode_result = 53; + */ + setBytecodeResult: SetBytecodeResult; + } + | { + oneofKind: 'setDsValueResult'; + /** + * @generated from protobuf field: massa.abi.v1.SetDsValueResult set_ds_value_result = 54; + */ + setDsValueResult: SetDsValueResult; + } + | { + oneofKind: 'subNativeAmountResult'; + /** + * @generated from protobuf field: massa.abi.v1.SubNativeAmountResult sub_native_amount_result = 55; + */ + subNativeAmountResult: SubNativeAmountResult; + } + | { + oneofKind: 'transferCoinsResult'; + /** + * @generated from protobuf field: massa.abi.v1.TransferCoinsResult transfer_coins_result = 56; + */ + transferCoinsResult: TransferCoinsResult; + } + | { + oneofKind: 'unsafeRandomResult'; + /** + * @generated from protobuf field: massa.abi.v1.UnsafeRandomResult unsafe_random_result = 57; + */ + unsafeRandomResult: UnsafeRandomResult; + } + | { + oneofKind: 'evmVerifySigResult'; + /** + * @generated from protobuf field: massa.abi.v1.EvmVerifySigResult evm_verify_sig_result = 58; + */ + evmVerifySigResult: EvmVerifySigResult; + } + | { + oneofKind: 'verifySigResult'; + /** + * @generated from protobuf field: massa.abi.v1.VerifySigResult verify_sig_result = 59; + */ + verifySigResult: VerifySigResult; + } + | { + oneofKind: 'evmGetAddressFromPubkeyResult'; + /** + * @generated from protobuf field: massa.abi.v1.EvmGetAddressFromPubkeyResult evm_get_address_from_pubkey_result = 60; + */ + evmGetAddressFromPubkeyResult: EvmGetAddressFromPubkeyResult; + } + | { + oneofKind: 'evmGetPubkeyFromSignatureResult'; + /** + * @generated from protobuf field: massa.abi.v1.EvmGetPubkeyFromSignatureResult evm_get_pubkey_from_signature_result = 61; + */ + evmGetPubkeyFromSignatureResult: EvmGetPubkeyFromSignatureResult; + } + | { + oneofKind: 'isAddressEoaResult'; + /** + * @generated from protobuf field: massa.abi.v1.IsAddressEoaResult is_address_eoa_result = 62; + */ + isAddressEoaResult: IsAddressEoaResult; + } + | { + oneofKind: undefined; + }; +} +/** + * Generic message that encapsulate response from ABI calls. + * + * @generated from protobuf message massa.abi.v1.AbiResponse + */ +export interface AbiResponse { + /** + * @generated from protobuf oneof: resp + */ + resp: + | { + oneofKind: 'res'; + /** + * variant for success + * + * @generated from protobuf field: massa.abi.v1.RespResult res = 1; + */ + res: RespResult; + } + | { + oneofKind: 'error'; + /** + * variant for error + * + * @generated from protobuf field: massa.abi.v1.Error error = 2; + */ + error: Error; + } + | { + oneofKind: undefined; + }; +} +/** + * Amount to string request + * + * @generated from protobuf message massa.abi.v1.NativeAmountToStringRequest + */ +export interface NativeAmountToStringRequest { + /** + * Amount to convert to string + * + * @generated from protobuf field: massa.model.v1.NativeAmount to_convert = 1; + */ + toConvert?: NativeAmount; +} +/** + * Amount to string result + * + * @generated from protobuf message massa.abi.v1.NativeAmountToStringResult + */ +export interface NativeAmountToStringResult { + /** + * Converted Amount + * + * @generated from protobuf field: string converted_amount = 1; + */ + convertedAmount: string; +} +/** + * Amount from string request + * + * @generated from protobuf message massa.abi.v1.NativeAmountFromStringRequest + */ +export interface NativeAmountFromStringRequest { + /** + * String to convert to Amount + * + * @generated from protobuf field: string to_convert = 1; + */ + toConvert: string; +} +/** + * Amount from string result + * + * @generated from protobuf message massa.abi.v1.NativeAmountFromStringResult + */ +export interface NativeAmountFromStringResult { + /** + * Converted Amount + * + * @generated from protobuf field: massa.model.v1.NativeAmount converted_amount = 1; + */ + convertedAmount?: NativeAmount; +} +/** + * Check address request + * + * @generated from protobuf message massa.abi.v1.CheckAddressRequest + */ +export interface CheckAddressRequest { + /** + * Address to check + * + * @generated from protobuf field: string to_check = 1; + */ + toCheck: string; +} +/** + * Check address result + * + * @generated from protobuf message massa.abi.v1.CheckAddressResult + */ +export interface CheckAddressResult { + /** + * Is address valid + * + * @generated from protobuf field: bool is_valid = 1; + */ + isValid: boolean; +} +/** + * Check PubKey request + * + * @generated from protobuf message massa.abi.v1.CheckPubKeyRequest + */ +export interface CheckPubKeyRequest { + /** + * PubKey to check + * + * @generated from protobuf field: string to_check = 1; + */ + toCheck: string; +} +/** + * Check PubKey result + * + * @generated from protobuf message massa.abi.v1.CheckPubKeyResult + */ +export interface CheckPubKeyResult { + /** + * Is PubKey valid + * + * @generated from protobuf field: bool is_valid = 1; + */ + isValid: boolean; +} +/** + * Check Sig request + * + * @generated from protobuf message massa.abi.v1.CheckSigRequest + */ +export interface CheckSigRequest { + /** + * Sig to check + * + * @generated from protobuf field: string to_check = 1; + */ + toCheck: string; +} +/** + * Check Sig result + * + * @generated from protobuf message massa.abi.v1.CheckSigResult + */ +export interface CheckSigResult { + /** + * Is Sig valid + * + * @generated from protobuf field: bool is_valid = 1; + */ + isValid: boolean; +} +/** + * Check Amount request + * + * @generated from protobuf message massa.abi.v1.CheckNativeAmountRequest + */ +export interface CheckNativeAmountRequest { + /** + * Amount to check + * + * @generated from protobuf field: massa.model.v1.NativeAmount to_check = 1; + */ + toCheck?: NativeAmount; +} +/** + * Check Amount result + * + * @generated from protobuf message massa.abi.v1.CheckNativeAmountResult + */ +export interface CheckNativeAmountResult { + /** + * Is Amount valid + * + * @generated from protobuf field: bool is_valid = 1; + */ + isValid: boolean; +} +/** + * Amount addition request + * + * @generated from protobuf message massa.abi.v1.AddNativeAmountRequest + */ +export interface AddNativeAmountRequest { + /** + * First amount to add + * + * @generated from protobuf field: massa.model.v1.NativeAmount amount1 = 1; + */ + amount1?: NativeAmount; + /** + * Second amount to add + * + * @generated from protobuf field: massa.model.v1.NativeAmount amount2 = 2; + */ + amount2?: NativeAmount; +} +/** + * Amount addition result + * + * @generated from protobuf message massa.abi.v1.AddNativeAmountResult + */ +export interface AddNativeAmountResult { + /** + * Sum of amounts + * + * @generated from protobuf field: massa.model.v1.NativeAmount sum = 1; + */ + sum?: NativeAmount; +} +/** + * Amount subtraction request + * try to compute difference = left - right + * fails if right > left + * + * @generated from protobuf message massa.abi.v1.SubNativeAmountRequest + */ +export interface SubNativeAmountRequest { + /** + * First amount to subtract from + * + * @generated from protobuf field: massa.model.v1.NativeAmount left = 1; + */ + left?: NativeAmount; + /** + * Second amount to subtract + * + * @generated from protobuf field: massa.model.v1.NativeAmount right = 2; + */ + right?: NativeAmount; +} +/** + * Amount subtraction result + * + * @generated from protobuf message massa.abi.v1.SubNativeAmountResult + */ +export interface SubNativeAmountResult { + /** + * Difference of amounts (left - right) + * + * @generated from protobuf field: massa.model.v1.NativeAmount difference = 1; + */ + difference?: NativeAmount; +} +/** + * Amount multiplication request + * Try to compute product = amount * coefficient (fail if overflow) + * + * @generated from protobuf message massa.abi.v1.ScalarMulNativeAmountRequest + */ +export interface ScalarMulNativeAmountRequest { + /** + * Amount to multiply + * + * @generated from protobuf field: massa.model.v1.NativeAmount amount = 1; + */ + amount?: NativeAmount; + /** + * Coefficient to multiply by + * + * @generated from protobuf field: uint64 coefficient = 2; + */ + coefficient: bigint; +} +/** + * Amount multiplication result + * + * @generated from protobuf message massa.abi.v1.ScalarMulNativeAmountResult + */ +export interface ScalarMulNativeAmountResult { + /** + * Product of amount and coefficient + * + * @generated from protobuf field: massa.model.v1.NativeAmount product = 1; + */ + product?: NativeAmount; +} +/** + * Amount division by scalar request + * Try to compute quotient = dividend / divisor + * Fails if divisor == 0 + * Fails if underflow + * + * @generated from protobuf message massa.abi.v1.ScalarDivRemNativeAmountRequest + */ +export interface ScalarDivRemNativeAmountRequest { + /** + * Amount to divide + * + * @generated from protobuf field: massa.model.v1.NativeAmount dividend = 1; + */ + dividend?: NativeAmount; + /** + * Divisor to divide by + * + * @generated from protobuf field: uint64 divisor = 2; + */ + divisor: bigint; +} +/** + * Amount division by scalar result + * + * @generated from protobuf message massa.abi.v1.ScalarDivRemNativeAmountResult + */ +export interface ScalarDivRemNativeAmountResult { + /** + * Quotient of amount and divisor + * + * @generated from protobuf field: massa.model.v1.NativeAmount quotient = 1; + */ + quotient?: NativeAmount; + /** + * Remainder of amount and divisor + * + * @generated from protobuf field: massa.model.v1.NativeAmount remainder = 2; + */ + remainder?: NativeAmount; +} +/** + * Amount division request + * + * @generated from protobuf message massa.abi.v1.DivRemNativeAmountRequest + */ +export interface DivRemNativeAmountRequest { + /** + * Amount to divide + * + * @generated from protobuf field: massa.model.v1.NativeAmount dividend = 1; + */ + dividend?: NativeAmount; + /** + * Divisor to divide by + * + * @generated from protobuf field: massa.model.v1.NativeAmount divisor = 2; + */ + divisor?: NativeAmount; +} +/** + * Amount division result + * + * @generated from protobuf message massa.abi.v1.DivRemNativeAmountResult + */ +export interface DivRemNativeAmountResult { + /** + * Quotient of amount and divisor + * + * @generated from protobuf field: uint64 quotient = 1; + */ + quotient: bigint; + /** + * Remainder of amount and divisor + * + * @generated from protobuf field: massa.model.v1.NativeAmount remainder = 2; + */ + remainder?: NativeAmount; +} +/** + * Time addition checked request + * + * @generated from protobuf message massa.abi.v1.CheckedAddNativeTimeRequest + */ +export interface CheckedAddNativeTimeRequest { + /** + * First time to add + * + * @generated from protobuf field: massa.model.v1.NativeTime left = 1; + */ + left?: NativeTime; + /** + * Second time to add + * + * @generated from protobuf field: massa.model.v1.NativeTime right = 2; + */ + right?: NativeTime; +} +/** + * Time addition checked result + * + * @generated from protobuf message massa.abi.v1.CheckedAddNativeTimeResult + */ +export interface CheckedAddNativeTimeResult { + /** + * Sum of times + * + * @generated from protobuf field: massa.model.v1.NativeTime sum = 1; + */ + sum?: NativeTime; +} +/** + * Time subtraction checked request + * + * @generated from protobuf message massa.abi.v1.CheckedSubNativeTimeRequest + */ +export interface CheckedSubNativeTimeRequest { + /** + * First time to subtract from + * + * @generated from protobuf field: massa.model.v1.NativeTime left = 1; + */ + left?: NativeTime; + /** + * Second time to subtract + * + * @generated from protobuf field: massa.model.v1.NativeTime right = 2; + */ + right?: NativeTime; +} +/** + * Time subtraction checked result + * + * @generated from protobuf message massa.abi.v1.CheckedSubNativeTimeResult + */ +export interface CheckedSubNativeTimeResult { + /** + * Difference of times (left - right) + * + * @generated from protobuf field: massa.model.v1.NativeTime difference = 1; + */ + difference?: NativeTime; +} +/** + * Time scalar mult checked request + * + * @generated from protobuf message massa.abi.v1.CheckedScalarMulNativeTimeRequest + */ +export interface CheckedScalarMulNativeTimeRequest { + /** + * Time to multiply + * + * @generated from protobuf field: massa.model.v1.NativeTime time = 1; + */ + time?: NativeTime; + /** + * Coefficient to multiply by + * + * @generated from protobuf field: uint64 coefficient = 2; + */ + coefficient: bigint; +} +/** + * Time scalar mult checked result + * + * @generated from protobuf message massa.abi.v1.CheckedScalarMulNativeTimeResult + */ +export interface CheckedScalarMulNativeTimeResult { + /** + * Product of time and coefficient + * + * @generated from protobuf field: massa.model.v1.NativeTime product = 1; + */ + product?: NativeTime; +} +/** + * Time scalar divrem checked request + * + * @generated from protobuf message massa.abi.v1.CheckedScalarDivRemNativeTimeRequest + */ +export interface CheckedScalarDivRemNativeTimeRequest { + /** + * Time to divide + * + * @generated from protobuf field: massa.model.v1.NativeTime dividend = 1; + */ + dividend?: NativeTime; + /** + * Divisor to divide by + * + * @generated from protobuf field: uint64 divisor = 2; + */ + divisor: bigint; +} +/** + * Time scalar divrem checked result + * + * @generated from protobuf message massa.abi.v1.CheckedScalarDivRemNativeTimeResult + */ +export interface CheckedScalarDivRemNativeTimeResult { + /** + * Quotient of time and divisor + * + * @generated from protobuf field: massa.model.v1.NativeTime quotient = 1; + */ + quotient?: NativeTime; + /** + * Remainder of time and divisor + * + * @generated from protobuf field: massa.model.v1.NativeTime remainder = 2; + */ + remainder?: NativeTime; +} +/** + * Time division checked request + * + * @generated from protobuf message massa.abi.v1.CheckedDivRemNativeTimeRequest + */ +export interface CheckedDivRemNativeTimeRequest { + /** + * Time to divide + * + * @generated from protobuf field: massa.model.v1.NativeTime dividend = 1; + */ + dividend?: NativeTime; + /** + * Divisor to divide by + * + * @generated from protobuf field: massa.model.v1.NativeTime divisor = 2; + */ + divisor?: NativeTime; +} +/** + * Time division checked result + * + * @generated from protobuf message massa.abi.v1.CheckedDivRemNativeTimeResult + */ +export interface CheckedDivRemNativeTimeResult { + /** + * Quotient of time and divisor + * + * @generated from protobuf field: uint64 quotient = 1; + */ + quotient: bigint; + /** + * Remainder of time and divisor + * + * @generated from protobuf field: massa.model.v1.NativeTime remainder = 2; + */ + remainder?: NativeTime; +} +/** + * Time comparison request + * + * @generated from protobuf message massa.abi.v1.CompareNativeTimeRequest + */ +export interface CompareNativeTimeRequest { + /** + * First time to compare + * + * @generated from protobuf field: massa.model.v1.NativeTime left = 1; + */ + left?: NativeTime; + /** + * Second time to compare + * + * @generated from protobuf field: massa.model.v1.NativeTime right = 2; + */ + right?: NativeTime; +} +/** + * Time comparison result + * + * @generated from protobuf message massa.abi.v1.CompareNativeTimeResult + */ +export interface CompareNativeTimeResult { + /** + * Comparison result + * + * @generated from protobuf field: massa.model.v1.ComparisonResult result = 1; + */ + result: ComparisonResult; +} +/** + * Compare Address request + * + * @generated from protobuf message massa.abi.v1.CompareAddressRequest + */ +export interface CompareAddressRequest { + /** + * First address to compare + * + * @generated from protobuf field: string left = 1; + */ + left: string; + /** + * Second address to compare + * + * @generated from protobuf field: string right = 2; + */ + right: string; +} +/** + * Compare Address result + * + * @generated from protobuf message massa.abi.v1.CompareAddressResult + */ +export interface CompareAddressResult { + /** + * Comparison result + * + * @generated from protobuf field: massa.model.v1.ComparisonResult result = 1; + */ + result: ComparisonResult; +} +/** + * Compare PubKey request + * + * @generated from protobuf message massa.abi.v1.ComparePubKeyRequest + */ +export interface ComparePubKeyRequest { + /** + * First public key to compare + * + * @generated from protobuf field: string left = 1; + */ + left: string; + /** + * Second public key to compare + * + * @generated from protobuf field: string right = 2; + */ + right: string; +} +/** + * Compare PubKey result + * + * @generated from protobuf message massa.abi.v1.ComparePubKeyResult + */ +export interface ComparePubKeyResult { + /** + * Comparison result + * + * @generated from protobuf field: massa.model.v1.ComparisonResult result = 1; + */ + result: ComparisonResult; +} +/** + * Verify Sig request + * + * @generated from protobuf message massa.abi.v1.VerifySigRequest + */ +export interface VerifySigRequest { + /** + * Signature to verify + * + * @generated from protobuf field: string sig = 1; + */ + sig: string; + /** + * Message to verify + * + * @generated from protobuf field: bytes message = 2; + */ + message: Uint8Array; + /** + * Public key to verify with + * + * @generated from protobuf field: string pub_key = 3; + */ + pubKey: string; +} +/** + * Verify Sig result + * + * @generated from protobuf message massa.abi.v1.VerifySigResult + */ +export interface VerifySigResult { + /** + * Verification result + * + * @generated from protobuf field: bool is_verified = 1; + */ + isVerified: boolean; +} +/** + * Compare NativeAmount request + * + * @generated from protobuf message massa.abi.v1.CompareNativeAmountRequest + */ +export interface CompareNativeAmountRequest { + /** + * First amount to compare + * + * @generated from protobuf field: massa.model.v1.NativeAmount left = 1; + */ + left?: NativeAmount; + /** + * Second amount to compare + * + * @generated from protobuf field: massa.model.v1.NativeAmount right = 2; + */ + right?: NativeAmount; +} +/** + * Compare NativeAmount result + * + * @generated from protobuf message massa.abi.v1.CompareNativeAmountResult + */ +export interface CompareNativeAmountResult { + /** + * Comparison result + * + * @generated from protobuf field: massa.model.v1.ComparisonResult result = 1; + */ + result: ComparisonResult; +} +/** + * Keccak256 hash request + * + * @generated from protobuf message massa.abi.v1.Keccak256Request + */ +export interface Keccak256Request { + /** + * Data to hash + * + * @generated from protobuf field: bytes data = 1; + */ + data: Uint8Array; +} +/** + * Keccak256 hash result + * + * @generated from protobuf message massa.abi.v1.Keccak256Result + */ +export interface Keccak256Result { + /** + * Hash of data + * + * @generated from protobuf field: bytes hash = 1; + */ + hash: Uint8Array; +} +/** + * EVM signature verification request + * + * @generated from protobuf message massa.abi.v1.EvmVerifySigRequest + */ +export interface EvmVerifySigRequest { + /** + * Signature to verify + * + * @generated from protobuf field: bytes sig = 1; + */ + sig: Uint8Array; + /** + * Message to verify + * + * @generated from protobuf field: bytes message = 2; + */ + message: Uint8Array; + /** + * Public key to verify with + * + * @generated from protobuf field: bytes pub_key = 3; + */ + pubKey: Uint8Array; +} +/** + * EVM signature verification result + * + * @generated from protobuf message massa.abi.v1.EvmVerifySigResult + */ +export interface EvmVerifySigResult { + /** + * Verification result + * + * @generated from protobuf field: bool is_verified = 1; + */ + isVerified: boolean; +} +/** + * EVM get address from public key request + * + * @generated from protobuf message massa.abi.v1.EvmGetAddressFromPubkeyRequest + */ +export interface EvmGetAddressFromPubkeyRequest { + /** + * Public key to get address from + * + * @generated from protobuf field: bytes pub_key = 1; + */ + pubKey: Uint8Array; +} +/** + * EVM get address from public key result + * + * @generated from protobuf message massa.abi.v1.EvmGetAddressFromPubkeyResult + */ +export interface EvmGetAddressFromPubkeyResult { + /** + * Address + * + * @generated from protobuf field: bytes address = 1; + */ + address: Uint8Array; +} +/** + * EVM get public key from signature request + * + * @generated from protobuf message massa.abi.v1.EvmGetPubkeyFromSignatureRequest + */ +export interface EvmGetPubkeyFromSignatureRequest { + /** + * Signed hash to verify + * + * @generated from protobuf field: bytes hash = 1; + */ + hash: Uint8Array; + /** + * Signature to verify + * + * @generated from protobuf field: bytes sig = 2; + */ + sig: Uint8Array; +} +/** + * EVM get public key from signature result + * + * @generated from protobuf message massa.abi.v1.EvmGetPubkeyFromSignatureResult + */ +export interface EvmGetPubkeyFromSignatureResult { + /** + * Public key + * + * @generated from protobuf field: bytes pub_key = 1; + */ + pubKey: Uint8Array; +} +/** + * Is address EOA request + * + * @generated from protobuf message massa.abi.v1.IsAddressEoaRequest + */ +export interface IsAddressEoaRequest { + /** + * Address to check + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Is address EOA result + * + * @generated from protobuf message massa.abi.v1.IsAddressEoaResult + */ +export interface IsAddressEoaResult { + /** + * Is address EOA + * + * @generated from protobuf field: bool is_eoa = 1; + */ + isEoa: boolean; +} +/** + * Blake3 hash request + * + * @generated from protobuf message massa.abi.v1.HashBlake3Request + */ +export interface HashBlake3Request { + /** + * Data to hash + * + * @generated from protobuf field: bytes data = 1; + */ + data: Uint8Array; +} +/** + * Blake3 hash result + * + * @generated from protobuf message massa.abi.v1.HashBlake3Result + */ +export interface HashBlake3Result { + /** + * Hash of data + * + * @generated from protobuf field: bytes hash = 1; + */ + hash: Uint8Array; +} +/** + * Get keys request + * + * @generated from protobuf message massa.abi.v1.GetDsKeysRequest + */ +export interface GetDsKeysRequest { + /** + * keys prefix + * + * @generated from protobuf field: bytes prefix = 1; + */ + prefix: Uint8Array; + /** + * Address to get keys for + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 2; + */ + address?: StringValue; +} +/** + * Get keys result + * + * @generated from protobuf message massa.abi.v1.GetDsKeysResult + */ +export interface GetDsKeysResult { + /** + * keys + * + * @generated from protobuf field: repeated bytes keys = 1; + */ + keys: Uint8Array[]; +} +/** + * Set data store value request + * + * @generated from protobuf message massa.abi.v1.SetDsValueRequest + */ +export interface SetDsValueRequest { + /** + * key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; + /** + * value + * + * @generated from protobuf field: bytes value = 2; + */ + value: Uint8Array; + /** + * Address to set data for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 3; + */ + address?: StringValue; +} +/** + * Set data store value result + * + * @generated from protobuf message massa.abi.v1.SetDsValueResult + */ +export interface SetDsValueResult {} +/** + * Append data request + * + * @generated from protobuf message massa.abi.v1.AppendDsValueRequest + */ +export interface AppendDsValueRequest { + /** + * key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; + /** + * value + * + * @generated from protobuf field: bytes value = 2; + */ + value: Uint8Array; + /** + * Address to append data for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 3; + */ + address?: StringValue; +} +/** + * Append data result + * + * @generated from protobuf message massa.abi.v1.AppendDsValueResult + */ +export interface AppendDsValueResult {} +/** + * Get data request + * + * @generated from protobuf message massa.abi.v1.GetDsValueRequest + */ +export interface GetDsValueRequest { + /** + * key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; + /** + * Address to get data for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 2; + */ + address?: StringValue; +} +/** + * Get data result + * + * @generated from protobuf message massa.abi.v1.GetDsValueResult + */ +export interface GetDsValueResult { + /** + * value + * + * @generated from protobuf field: bytes value = 1; + */ + value: Uint8Array; +} +/** + * Delete data store entry request + * + * @generated from protobuf message massa.abi.v1.DeleteDsEntryRequest + */ +export interface DeleteDsEntryRequest { + /** + * key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; + /** + * Address to delete data for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 2; + */ + address?: StringValue; +} +/** + * Delete data store entry result + * + * @generated from protobuf message massa.abi.v1.DeleteDsEntryResult + */ +export interface DeleteDsEntryResult {} +/** + * Data store entry exists request + * + * @generated from protobuf message massa.abi.v1.DsEntryExistsRequest + */ +export interface DsEntryExistsRequest { + /** + * key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; + /** + * Address to check data for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 2; + */ + address?: StringValue; +} +/** + * Data store entry exists result + * + * @generated from protobuf message massa.abi.v1.DsEntryExistsResult + */ +export interface DsEntryExistsResult { + /** + * has data + * + * @generated from protobuf field: bool has_data = 1; + */ + hasData: boolean; +} +/** + * Get owned addresses request + * + * @generated from protobuf message massa.abi.v1.GetOwnedAddressesRequest + */ +export interface GetOwnedAddressesRequest {} +/** + * Get owned addresses result + * + * @generated from protobuf message massa.abi.v1.GetOwnedAddressesResult + */ +export interface GetOwnedAddressesResult { + /** + * owned addresses + * + * @generated from protobuf field: repeated string addresses = 1; + */ + addresses: string[]; +} +/** + * Get call stack request + * + * @generated from protobuf message massa.abi.v1.GetCallStackRequest + */ +export interface GetCallStackRequest {} +/** + * Get call stack result + * + * @generated from protobuf message massa.abi.v1.GetCallStackResult + */ +export interface GetCallStackResult { + /** + * call stack + * + * @generated from protobuf field: repeated string calls = 1; + */ + calls: string[]; +} +/** + * Address from public key request + * + * @generated from protobuf message massa.abi.v1.AddressFromPubKeyRequest + */ +export interface AddressFromPubKeyRequest { + /** + * Native public key + * + * @generated from protobuf field: string pub_key = 1; + */ + pubKey: string; +} +/** + * Address from public key result + * + * @generated from protobuf message massa.abi.v1.AddressFromPubKeyResult + */ +export interface AddressFromPubKeyResult { + /** + * Address + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Unsafe random request + * + * @generated from protobuf message massa.abi.v1.UnsafeRandomRequest + */ +export interface UnsafeRandomRequest { + /** + * @generated from protobuf field: uint32 num_bytes = 2; + */ + numBytes: number; +} +/** + * Unsafe random result + * + * @generated from protobuf message massa.abi.v1.UnsafeRandomResult + */ +export interface UnsafeRandomResult { + /** + * Random bytes generated + * + * @generated from protobuf field: bytes random_bytes = 1; + */ + randomBytes: Uint8Array; +} +/** + * Send async message request filter + * + * @generated from protobuf message massa.abi.v1.SendAsyncMessageFilter + */ +export interface SendAsyncMessageFilter { + /** + * Target address + * + * @generated from protobuf field: string target_address = 1; + */ + targetAddress: string; + /** + * Target key + * + * @generated from protobuf field: google.protobuf.BytesValue target_key = 2; + */ + targetKey?: BytesValue; +} +/** + * Send async message request + * + * @generated from protobuf message massa.abi.v1.SendAsyncMessageRequest + */ +export interface SendAsyncMessageRequest { + /** + * Target address + * + * @generated from protobuf field: string target_address = 1; + */ + targetAddress: string; + /** + * Target handler (function name) + * + * @generated from protobuf field: string target_handler = 2; + */ + targetHandler: string; + /** + * Start slot for the message execution + * + * @generated from protobuf field: massa.model.v1.Slot validity_start = 3; + */ + validityStart?: Slot; + /** + * End slot for the message execution + * + * @generated from protobuf field: massa.model.v1.Slot validity_end = 4; + */ + validityEnd?: Slot; + /** + * Gas given for the execution + * + * @generated from protobuf field: uint64 execution_gas = 5; + */ + executionGas: bigint; + /** + * Message fee + * + * @generated from protobuf field: uint64 raw_fee = 6; + */ + rawFee: bigint; + /** + * Coins sent to the execution context + * + * @generated from protobuf field: uint64 raw_coins = 7; + */ + rawCoins: bigint; + /** + * Message data + * + * @generated from protobuf field: bytes data = 8; + */ + data: Uint8Array; + /** + * Filter for the message + * + * @generated from protobuf field: massa.abi.v1.SendAsyncMessageFilter filter = 9; + */ + filter?: SendAsyncMessageFilter; +} +/** + * Send async message result + * + * @generated from protobuf message massa.abi.v1.SendAsyncMessageResult + */ +export interface SendAsyncMessageResult {} +/** + * Get origin operation id request + * + * @generated from protobuf message massa.abi.v1.GetOriginOperationIdRequest + */ +export interface GetOriginOperationIdRequest {} +/** + * Get origin operation id result + * + * @generated from protobuf message massa.abi.v1.GetOriginOperationIdResult + */ +export interface GetOriginOperationIdResult { + /** + * @generated from protobuf field: optional google.protobuf.StringValue operation_id = 1; + */ + operationId?: StringValue; +} +/** + * Get native time request + * + * @generated from protobuf message massa.abi.v1.GetNativeTimeRequest + */ +export interface GetNativeTimeRequest {} +/** + * Get native time result + * + * @generated from protobuf message massa.abi.v1.GetNativeTimeResult + */ +export interface GetNativeTimeResult { + /** + * Native time + * + * @generated from protobuf field: massa.model.v1.NativeTime time = 1; + */ + time?: NativeTime; +} +/** + * Get current slot request + * + * @generated from protobuf message massa.abi.v1.GetCurrentSlotRequest + */ +export interface GetCurrentSlotRequest {} +/** + * Get current slot result + * + * @generated from protobuf message massa.abi.v1.GetCurrentSlotResult + */ +export interface GetCurrentSlotResult { + /** + * Current slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; +} +/** + * Set bytecode request + * + * @generated from protobuf message massa.abi.v1.SetBytecodeRequest + */ +export interface SetBytecodeRequest { + /** + * Bytecode + * + * @generated from protobuf field: bytes bytecode = 1; + */ + bytecode: Uint8Array; + /** + * Address to set bytecode for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 2; + */ + address?: StringValue; +} +/** + * Set bytecode result + * + * @generated from protobuf message massa.abi.v1.SetBytecodeResult + */ +export interface SetBytecodeResult {} +/** + * Get bytecode request + * + * @generated from protobuf message massa.abi.v1.GetBytecodeRequest + */ +export interface GetBytecodeRequest { + /** + * Address to get bytecode for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 1; + */ + address?: StringValue; +} +/** + * Get bytecode result + * + * @generated from protobuf message massa.abi.v1.GetBytecodeResult + */ +export interface GetBytecodeResult { + /** + * Bytecode + * + * @generated from protobuf field: bytes bytecode = 1; + */ + bytecode: Uint8Array; +} +/** + * Caller has write access request + * + * @generated from protobuf message massa.abi.v1.CallerHasWriteAccessRequest + */ +export interface CallerHasWriteAccessRequest {} +/** + * Caller has write access result + * + * @generated from protobuf message massa.abi.v1.CallerHasWriteAccessResult + */ +export interface CallerHasWriteAccessResult { + /** + * Caller has write access + * + * @generated from protobuf field: bool has_write_access = 1; + */ + hasWriteAccess: boolean; +} +/** + * Hash sha256 request + * + * @generated from protobuf message massa.abi.v1.HashSha256Request + */ +export interface HashSha256Request { + /** + * data + * + * @generated from protobuf field: bytes data = 1; + */ + data: Uint8Array; +} +/** + * Hash sha256 result + * + * @generated from protobuf message massa.abi.v1.HashSha256Result + */ +export interface HashSha256Result { + /** + * hash + * + * @generated from protobuf field: bytes hash = 1; + */ + hash: Uint8Array; +} +/** + * Get op data request + * + * @generated from protobuf message massa.abi.v1.GetOpDataRequest + */ +export interface GetOpDataRequest { + /** + * key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; +} +/** + * Get op data result + * + * @generated from protobuf message massa.abi.v1.GetOpDataResult + */ +export interface GetOpDataResult { + /** + * value + * + * @generated from protobuf field: bytes value = 1; + */ + value: Uint8Array; +} +/** + * Op entry exists request + * + * @generated from protobuf message massa.abi.v1.OpEntryExistsRequest + */ +export interface OpEntryExistsRequest { + /** + * key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; +} +/** + * Op entry exists result + * + * @generated from protobuf message massa.abi.v1.OpEntryExistsResult + */ +export interface OpEntryExistsResult { + /** + * has key + * + * @generated from protobuf field: bool has_key = 1; + */ + hasKey: boolean; +} +/** + * Get op keys request + * + * @generated from protobuf message massa.abi.v1.GetOpKeysRequest + */ +export interface GetOpKeysRequest { + /** + * keys prefix + * + * @generated from protobuf field: bytes prefix = 1; + */ + prefix: Uint8Array; +} +/** + * Get op keys result + * + * @generated from protobuf message massa.abi.v1.GetOpKeysResult + */ +export interface GetOpKeysResult { + /** + * keys + * + * @generated from protobuf field: repeated bytes keys = 1; + */ + keys: Uint8Array[]; +} +/** + * Get remaining gas request + * + * @generated from protobuf message massa.abi.v1.GetRemainingGasRequest + */ +export interface GetRemainingGasRequest {} +/** + * Get remaining gas result + * + * @generated from protobuf message massa.abi.v1.GetRemainingGasResult + */ +export interface GetRemainingGasResult { + /** + * remaining gas + * + * @generated from protobuf field: uint64 remaining_gas = 1; + */ + remainingGas: bigint; +} +/** + * Get balance request + * + * @generated from protobuf message massa.abi.v1.GetBalanceRequest + */ +export interface GetBalanceRequest { + /** + * Address to get balance for, if none, use current address + * + * @generated from protobuf field: optional google.protobuf.StringValue address = 1; + */ + address?: StringValue; +} +/** + * Get balance result + * + * @generated from protobuf message massa.abi.v1.GetBalanceResult + */ +export interface GetBalanceResult { + /** + * balance + * + * @generated from protobuf field: massa.model.v1.NativeAmount balance = 1; + */ + balance?: NativeAmount; +} +/** + * Get call coins request + * + * @generated from protobuf message massa.abi.v1.GetCallCoinsRequest + */ +export interface GetCallCoinsRequest {} +/** + * Get call coins result + * + * @generated from protobuf message massa.abi.v1.GetCallCoinsResult + */ +export interface GetCallCoinsResult { + /** + * coins + * + * @generated from protobuf field: massa.model.v1.NativeAmount coins = 1; + */ + coins?: NativeAmount; +} +/** + * Get the version of the address request + * + * @generated from protobuf message massa.abi.v1.GetAddressVersionRequest + */ +export interface GetAddressVersionRequest { + /** + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Get the version of the address result + * + * @generated from protobuf message massa.abi.v1.GetAddressVersionResult + */ +export interface GetAddressVersionResult { + /** + * @generated from protobuf field: uint64 version = 1; + */ + version: bigint; +} +/** + * Get the category of the address request + * + * @generated from protobuf message massa.abi.v1.GetAddressCategoryRequest + */ +export interface GetAddressCategoryRequest { + /** + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Get the category of the address result + * + * @generated from protobuf message massa.abi.v1.GetAddressCategoryResult + */ +export interface GetAddressCategoryResult { + /** + * @generated from protobuf field: massa.model.v1.AddressCategory category = 1; + */ + category: AddressCategory; +} +/** + * Get the version of the public key request + * + * @generated from protobuf message massa.abi.v1.GetPubKeyVersionRequest + */ +export interface GetPubKeyVersionRequest { + /** + * @generated from protobuf field: string pub_key = 1; + */ + pubKey: string; +} +/** + * Get the version of the public key result + * + * @generated from protobuf message massa.abi.v1.GetPubKeyVersionResult + */ +export interface GetPubKeyVersionResult { + /** + * @generated from protobuf field: uint64 version = 1; + */ + version: bigint; +} +/** + * Get the version of the signature request + * + * @generated from protobuf message massa.abi.v1.GetSignatureVersionRequest + */ +export interface GetSignatureVersionRequest { + /** + * @generated from protobuf field: string signature = 1; + */ + signature: string; +} +/** + * Get the version of the signature result + * + * @generated from protobuf message massa.abi.v1.GetSignatureVersionResult + */ +export interface GetSignatureVersionResult { + /** + * @generated from protobuf field: uint64 version = 1; + */ + version: bigint; +} +/** + * bytes to base58 request + * + * @generated from protobuf message massa.abi.v1.BytesToBase58CheckRequest + */ +export interface BytesToBase58CheckRequest { + /** + * @generated from protobuf field: bytes bytes = 1; + */ + bytes: Uint8Array; +} +/** + * bytes to base58 result + * + * @generated from protobuf message massa.abi.v1.BytesToBase58CheckResult + */ +export interface BytesToBase58CheckResult { + /** + * @generated from protobuf field: string base58_check = 1; + */ + base58Check: string; +} +/** + * base58 to bytes request + * + * @generated from protobuf message massa.abi.v1.Base58CheckToBytesRequest + */ +export interface Base58CheckToBytesRequest { + /** + * @generated from protobuf field: string base58_check = 1; + */ + base58Check: string; +} +/** + * base58 to bytes result + * + * @generated from protobuf message massa.abi.v1.Base58CheckToBytesResult + */ +export interface Base58CheckToBytesResult { + /** + * @generated from protobuf field: bytes bytes = 1; + */ + bytes: Uint8Array; +} +// @generated message type with reflection information, may provide speed optimized methods +class Error$Type extends MessageType { + constructor() { + super('massa.abi.v1.Error', [ + { no: 1, name: 'message', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): Error { + const message = { message: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Error, + ): Error { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string message */ 1: + message.message = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Error, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string message = 1; */ + if (message.message !== '') + writer.tag(1, WireType.LengthDelimited).string(message.message); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.Error + */ +export const Error = new Error$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CreateScRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CreateScRequest', [ + { no: 1, name: 'bytecode', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): CreateScRequest { + const message = { bytecode: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CreateScRequest, + ): CreateScRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes bytecode */ 1: + message.bytecode = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CreateScRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes bytecode = 1; */ + if (message.bytecode.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.bytecode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CreateScRequest + */ +export const CreateScRequest = new CreateScRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CreateScResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CreateScResult', [ + { + no: 1, + name: 'sc_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): CreateScResult { + const message = { scAddress: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CreateScResult, + ): CreateScResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string sc_address */ 1: + message.scAddress = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CreateScResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string sc_address = 1; */ + if (message.scAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.scAddress); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CreateScResult + */ +export const CreateScResult = new CreateScResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CallRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CallRequest', [ + { + no: 1, + name: 'target_sc_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'target_function_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'function_arg', + kind: 'scalar', + T: 12 /* ScalarType.BYTES*/, + }, + { no: 4, name: 'call_coins', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): CallRequest { + const message = { + targetScAddress: '', + targetFunctionName: '', + functionArg: new Uint8Array(0), + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CallRequest, + ): CallRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string target_sc_address */ 1: + message.targetScAddress = reader.string(); + break; + case /* string target_function_name */ 2: + message.targetFunctionName = reader.string(); + break; + case /* bytes function_arg */ 3: + message.functionArg = reader.bytes(); + break; + case /* massa.model.v1.NativeAmount call_coins */ 4: + message.callCoins = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.callCoins, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CallRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string target_sc_address = 1; */ + if (message.targetScAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.targetScAddress); + /* string target_function_name = 2; */ + if (message.targetFunctionName !== '') + writer + .tag(2, WireType.LengthDelimited) + .string(message.targetFunctionName); + /* bytes function_arg = 3; */ + if (message.functionArg.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.functionArg); + /* massa.model.v1.NativeAmount call_coins = 4; */ + if (message.callCoins) + NativeAmount.internalBinaryWrite( + message.callCoins, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CallRequest + */ +export const CallRequest = new CallRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CallResponse$Type extends MessageType { + constructor() { + super('massa.abi.v1.CallResponse', [ + { no: 1, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): CallResponse { + const message = { data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CallResponse, + ): CallResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes data */ 1: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CallResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes data = 1; */ + if (message.data.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CallResponse + */ +export const CallResponse = new CallResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LocalExecutionRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.LocalExecutionRequest', [ + { no: 1, name: 'bytecode', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { + no: 2, + name: 'target_function_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'function_arg', + kind: 'scalar', + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): LocalExecutionRequest { + const message = { + bytecode: new Uint8Array(0), + targetFunctionName: '', + functionArg: new Uint8Array(0), + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LocalExecutionRequest, + ): LocalExecutionRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes bytecode */ 1: + message.bytecode = reader.bytes(); + break; + case /* string target_function_name */ 2: + message.targetFunctionName = reader.string(); + break; + case /* bytes function_arg */ 3: + message.functionArg = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LocalExecutionRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes bytecode = 1; */ + if (message.bytecode.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.bytecode); + /* string target_function_name = 2; */ + if (message.targetFunctionName !== '') + writer + .tag(2, WireType.LengthDelimited) + .string(message.targetFunctionName); + /* bytes function_arg = 3; */ + if (message.functionArg.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.functionArg); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.LocalExecutionRequest + */ +export const LocalExecutionRequest = new LocalExecutionRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LocalExecutionResponse$Type extends MessageType { + constructor() { + super('massa.abi.v1.LocalExecutionResponse', [ + { no: 1, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): LocalExecutionResponse { + const message = { data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LocalExecutionResponse, + ): LocalExecutionResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes data */ 1: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LocalExecutionResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes data = 1; */ + if (message.data.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.LocalExecutionResponse + */ +export const LocalExecutionResponse = new LocalExecutionResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GenerateEventRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GenerateEventRequest', [ + { no: 1, name: 'event', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): GenerateEventRequest { + const message = { event: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GenerateEventRequest, + ): GenerateEventRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes event */ 1: + message.event = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GenerateEventRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes event = 1; */ + if (message.event.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.event); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GenerateEventRequest + */ +export const GenerateEventRequest = new GenerateEventRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GenerateEventResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GenerateEventResult', []); + } + create(value?: PartialMessage): GenerateEventResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GenerateEventResult, + ): GenerateEventResult { + return target ?? this.create(); + } + internalBinaryWrite( + message: GenerateEventResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GenerateEventResult + */ +export const GenerateEventResult = new GenerateEventResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TransferCoinsRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.TransferCoinsRequest', [ + { + no: 1, + name: 'target_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'amount_to_transfer', + kind: 'message', + T: () => NativeAmount, + }, + { no: 3, name: 'sender_address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): TransferCoinsRequest { + const message = { targetAddress: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: TransferCoinsRequest, + ): TransferCoinsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string target_address */ 1: + message.targetAddress = reader.string(); + break; + case /* massa.model.v1.NativeAmount amount_to_transfer */ 2: + message.amountToTransfer = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.amountToTransfer, + ); + break; + case /* optional google.protobuf.StringValue sender_address */ 3: + message.senderAddress = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.senderAddress, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: TransferCoinsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string target_address = 1; */ + if (message.targetAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.targetAddress); + /* massa.model.v1.NativeAmount amount_to_transfer = 2; */ + if (message.amountToTransfer) + NativeAmount.internalBinaryWrite( + message.amountToTransfer, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* optional google.protobuf.StringValue sender_address = 3; */ + if (message.senderAddress) + StringValue.internalBinaryWrite( + message.senderAddress, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.TransferCoinsRequest + */ +export const TransferCoinsRequest = new TransferCoinsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TransferCoinsResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.TransferCoinsResult', []); + } + create(value?: PartialMessage): TransferCoinsResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: TransferCoinsResult, + ): TransferCoinsResult { + return target ?? this.create(); + } + internalBinaryWrite( + message: TransferCoinsResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.TransferCoinsResult + */ +export const TransferCoinsResult = new TransferCoinsResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FunctionExistsRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.FunctionExistsRequest', [ + { + no: 1, + name: 'target_sc_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'function_name', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): FunctionExistsRequest { + const message = { targetScAddress: '', functionName: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FunctionExistsRequest, + ): FunctionExistsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string target_sc_address */ 1: + message.targetScAddress = reader.string(); + break; + case /* string function_name */ 2: + message.functionName = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FunctionExistsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string target_sc_address = 1; */ + if (message.targetScAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.targetScAddress); + /* string function_name = 2; */ + if (message.functionName !== '') + writer.tag(2, WireType.LengthDelimited).string(message.functionName); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.FunctionExistsRequest + */ +export const FunctionExistsRequest = new FunctionExistsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FunctionExistsResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.FunctionExistsResult', [ + { no: 1, name: 'exists', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): FunctionExistsResult { + const message = { exists: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FunctionExistsResult, + ): FunctionExistsResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool exists */ 1: + message.exists = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FunctionExistsResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool exists = 1; */ + if (message.exists !== false) + writer.tag(1, WireType.Varint).bool(message.exists); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.FunctionExistsResult + */ +export const FunctionExistsResult = new FunctionExistsResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RespResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.RespResult', [ + { + no: 1, + name: 'add_native_amount_result', + kind: 'message', + oneof: 'res', + T: () => AddNativeAmountResult, + }, + { + no: 2, + name: 'address_from_pub_key_result', + kind: 'message', + oneof: 'res', + T: () => AddressFromPubKeyResult, + }, + { + no: 3, + name: 'append_ds_value_result', + kind: 'message', + oneof: 'res', + T: () => AppendDsValueResult, + }, + { + no: 4, + name: 'base58_check_to_bytes_result', + kind: 'message', + oneof: 'res', + T: () => Base58CheckToBytesResult, + }, + { + no: 5, + name: 'bytes_to_base58_check_result', + kind: 'message', + oneof: 'res', + T: () => BytesToBase58CheckResult, + }, + { + no: 6, + name: 'caller_has_write_access_result', + kind: 'message', + oneof: 'res', + T: () => CallerHasWriteAccessResult, + }, + { + no: 7, + name: 'check_address_result', + kind: 'message', + oneof: 'res', + T: () => CheckAddressResult, + }, + { + no: 8, + name: 'check_native_amount_result', + kind: 'message', + oneof: 'res', + T: () => CheckNativeAmountResult, + }, + { + no: 9, + name: 'check_pub_key_result', + kind: 'message', + oneof: 'res', + T: () => CheckPubKeyResult, + }, + { + no: 10, + name: 'check_sig_result', + kind: 'message', + oneof: 'res', + T: () => CheckSigResult, + }, + { + no: 11, + name: 'checked_add_native_time_result', + kind: 'message', + oneof: 'res', + T: () => CheckedAddNativeTimeResult, + }, + { + no: 12, + name: 'checked_div_rem_native_time_result', + kind: 'message', + oneof: 'res', + T: () => CheckedDivRemNativeTimeResult, + }, + { + no: 13, + name: 'checked_scalar_div_rem_native_time_result', + kind: 'message', + oneof: 'res', + T: () => CheckedScalarDivRemNativeTimeResult, + }, + { + no: 14, + name: 'checked_scalar_mul_native_time_result', + kind: 'message', + oneof: 'res', + T: () => CheckedScalarMulNativeTimeResult, + }, + { + no: 15, + name: 'checked_sub_native_time_result', + kind: 'message', + oneof: 'res', + T: () => CheckedSubNativeTimeResult, + }, + { + no: 16, + name: 'compare_address_result', + kind: 'message', + oneof: 'res', + T: () => CompareAddressResult, + }, + { + no: 17, + name: 'compare_native_amount_result', + kind: 'message', + oneof: 'res', + T: () => CompareNativeAmountResult, + }, + { + no: 18, + name: 'compare_native_time_result', + kind: 'message', + oneof: 'res', + T: () => CompareNativeTimeResult, + }, + { + no: 19, + name: 'compare_pub_key_result', + kind: 'message', + oneof: 'res', + T: () => ComparePubKeyResult, + }, + { + no: 20, + name: 'create_sc_result', + kind: 'message', + oneof: 'res', + T: () => CreateScResult, + }, + { + no: 21, + name: 'delete_ds_entry_result', + kind: 'message', + oneof: 'res', + T: () => DeleteDsEntryResult, + }, + { + no: 22, + name: 'div_rem_native_amount_result', + kind: 'message', + oneof: 'res', + T: () => DivRemNativeAmountResult, + }, + { + no: 23, + name: 'ds_entry_exists_result', + kind: 'message', + oneof: 'res', + T: () => DsEntryExistsResult, + }, + { + no: 24, + name: 'function_exists_result', + kind: 'message', + oneof: 'res', + T: () => FunctionExistsResult, + }, + { + no: 25, + name: 'generate_event_result', + kind: 'message', + oneof: 'res', + T: () => GenerateEventResult, + }, + { + no: 26, + name: 'get_address_category_result', + kind: 'message', + oneof: 'res', + T: () => GetAddressCategoryResult, + }, + { + no: 27, + name: 'get_address_version_result', + kind: 'message', + oneof: 'res', + T: () => GetAddressVersionResult, + }, + { + no: 28, + name: 'get_balance_result', + kind: 'message', + oneof: 'res', + T: () => GetBalanceResult, + }, + { + no: 29, + name: 'get_bytecode_result', + kind: 'message', + oneof: 'res', + T: () => GetBytecodeResult, + }, + { + no: 30, + name: 'get_call_coins_result', + kind: 'message', + oneof: 'res', + T: () => GetCallCoinsResult, + }, + { + no: 31, + name: 'get_call_stack_result', + kind: 'message', + oneof: 'res', + T: () => GetCallStackResult, + }, + { + no: 32, + name: 'get_current_slot_result', + kind: 'message', + oneof: 'res', + T: () => GetCurrentSlotResult, + }, + { + no: 33, + name: 'get_ds_keys_result', + kind: 'message', + oneof: 'res', + T: () => GetDsKeysResult, + }, + { + no: 34, + name: 'get_ds_value_result', + kind: 'message', + oneof: 'res', + T: () => GetDsValueResult, + }, + { + no: 35, + name: 'get_native_time_result', + kind: 'message', + oneof: 'res', + T: () => GetNativeTimeResult, + }, + { + no: 36, + name: 'get_op_data_result', + kind: 'message', + oneof: 'res', + T: () => GetOpDataResult, + }, + { + no: 37, + name: 'get_op_keys_result', + kind: 'message', + oneof: 'res', + T: () => GetOpKeysResult, + }, + { + no: 38, + name: 'get_origin_operation_id_result', + kind: 'message', + oneof: 'res', + T: () => GetOriginOperationIdResult, + }, + { + no: 39, + name: 'get_owned_addresses_result', + kind: 'message', + oneof: 'res', + T: () => GetOwnedAddressesResult, + }, + { + no: 40, + name: 'get_pub_key_version_result', + kind: 'message', + oneof: 'res', + T: () => GetPubKeyVersionResult, + }, + { + no: 41, + name: 'get_remaining_gas_result', + kind: 'message', + oneof: 'res', + T: () => GetRemainingGasResult, + }, + { + no: 42, + name: 'get_signature_version_result', + kind: 'message', + oneof: 'res', + T: () => GetSignatureVersionResult, + }, + { + no: 43, + name: 'hash_blake3_result', + kind: 'message', + oneof: 'res', + T: () => HashBlake3Result, + }, + { + no: 44, + name: 'hash_sha256_result', + kind: 'message', + oneof: 'res', + T: () => HashSha256Result, + }, + { + no: 45, + name: 'op_entry_exists_result', + kind: 'message', + oneof: 'res', + T: () => OpEntryExistsResult, + }, + { + no: 46, + name: 'keccak256_result', + kind: 'message', + oneof: 'res', + T: () => Keccak256Result, + }, + { + no: 47, + name: 'local_execution_response', + kind: 'message', + oneof: 'res', + T: () => LocalExecutionResponse, + }, + { + no: 48, + name: 'native_amount_from_string_result', + kind: 'message', + oneof: 'res', + T: () => NativeAmountFromStringResult, + }, + { + no: 49, + name: 'native_amount_to_string_result', + kind: 'message', + oneof: 'res', + T: () => NativeAmountToStringResult, + }, + { + no: 50, + name: 'scalar_div_rem_native_amount_result', + kind: 'message', + oneof: 'res', + T: () => ScalarDivRemNativeAmountResult, + }, + { + no: 51, + name: 'scalar_mul_native_amount_result', + kind: 'message', + oneof: 'res', + T: () => ScalarMulNativeAmountResult, + }, + { + no: 52, + name: 'send_async_message_result', + kind: 'message', + oneof: 'res', + T: () => SendAsyncMessageResult, + }, + { + no: 53, + name: 'set_bytecode_result', + kind: 'message', + oneof: 'res', + T: () => SetBytecodeResult, + }, + { + no: 54, + name: 'set_ds_value_result', + kind: 'message', + oneof: 'res', + T: () => SetDsValueResult, + }, + { + no: 55, + name: 'sub_native_amount_result', + kind: 'message', + oneof: 'res', + T: () => SubNativeAmountResult, + }, + { + no: 56, + name: 'transfer_coins_result', + kind: 'message', + oneof: 'res', + T: () => TransferCoinsResult, + }, + { + no: 57, + name: 'unsafe_random_result', + kind: 'message', + oneof: 'res', + T: () => UnsafeRandomResult, + }, + { + no: 58, + name: 'evm_verify_sig_result', + kind: 'message', + oneof: 'res', + T: () => EvmVerifySigResult, + }, + { + no: 59, + name: 'verify_sig_result', + kind: 'message', + oneof: 'res', + T: () => VerifySigResult, + }, + { + no: 60, + name: 'evm_get_address_from_pubkey_result', + kind: 'message', + oneof: 'res', + T: () => EvmGetAddressFromPubkeyResult, + }, + { + no: 61, + name: 'evm_get_pubkey_from_signature_result', + kind: 'message', + oneof: 'res', + T: () => EvmGetPubkeyFromSignatureResult, + }, + { + no: 62, + name: 'is_address_eoa_result', + kind: 'message', + oneof: 'res', + T: () => IsAddressEoaResult, + }, + ]); + } + create(value?: PartialMessage): RespResult { + const message = { res: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RespResult, + ): RespResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.abi.v1.AddNativeAmountResult add_native_amount_result */ 1: + message.res = { + oneofKind: 'addNativeAmountResult', + addNativeAmountResult: AddNativeAmountResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).addNativeAmountResult, + ), + }; + break; + case /* massa.abi.v1.AddressFromPubKeyResult address_from_pub_key_result */ 2: + message.res = { + oneofKind: 'addressFromPubKeyResult', + addressFromPubKeyResult: AddressFromPubKeyResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).addressFromPubKeyResult, + ), + }; + break; + case /* massa.abi.v1.AppendDsValueResult append_ds_value_result */ 3: + message.res = { + oneofKind: 'appendDsValueResult', + appendDsValueResult: AppendDsValueResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).appendDsValueResult, + ), + }; + break; + case /* massa.abi.v1.Base58CheckToBytesResult base58_check_to_bytes_result */ 4: + message.res = { + oneofKind: 'base58CheckToBytesResult', + base58CheckToBytesResult: + Base58CheckToBytesResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).base58CheckToBytesResult, + ), + }; + break; + case /* massa.abi.v1.BytesToBase58CheckResult bytes_to_base58_check_result */ 5: + message.res = { + oneofKind: 'bytesToBase58CheckResult', + bytesToBase58CheckResult: + BytesToBase58CheckResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).bytesToBase58CheckResult, + ), + }; + break; + case /* massa.abi.v1.CallerHasWriteAccessResult caller_has_write_access_result */ 6: + message.res = { + oneofKind: 'callerHasWriteAccessResult', + callerHasWriteAccessResult: + CallerHasWriteAccessResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).callerHasWriteAccessResult, + ), + }; + break; + case /* massa.abi.v1.CheckAddressResult check_address_result */ 7: + message.res = { + oneofKind: 'checkAddressResult', + checkAddressResult: CheckAddressResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkAddressResult, + ), + }; + break; + case /* massa.abi.v1.CheckNativeAmountResult check_native_amount_result */ 8: + message.res = { + oneofKind: 'checkNativeAmountResult', + checkNativeAmountResult: CheckNativeAmountResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkNativeAmountResult, + ), + }; + break; + case /* massa.abi.v1.CheckPubKeyResult check_pub_key_result */ 9: + message.res = { + oneofKind: 'checkPubKeyResult', + checkPubKeyResult: CheckPubKeyResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkPubKeyResult, + ), + }; + break; + case /* massa.abi.v1.CheckSigResult check_sig_result */ 10: + message.res = { + oneofKind: 'checkSigResult', + checkSigResult: CheckSigResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkSigResult, + ), + }; + break; + case /* massa.abi.v1.CheckedAddNativeTimeResult checked_add_native_time_result */ 11: + message.res = { + oneofKind: 'checkedAddNativeTimeResult', + checkedAddNativeTimeResult: + CheckedAddNativeTimeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkedAddNativeTimeResult, + ), + }; + break; + case /* massa.abi.v1.CheckedDivRemNativeTimeResult checked_div_rem_native_time_result */ 12: + message.res = { + oneofKind: 'checkedDivRemNativeTimeResult', + checkedDivRemNativeTimeResult: + CheckedDivRemNativeTimeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkedDivRemNativeTimeResult, + ), + }; + break; + case /* massa.abi.v1.CheckedScalarDivRemNativeTimeResult checked_scalar_div_rem_native_time_result */ 13: + message.res = { + oneofKind: 'checkedScalarDivRemNativeTimeResult', + checkedScalarDivRemNativeTimeResult: + CheckedScalarDivRemNativeTimeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkedScalarDivRemNativeTimeResult, + ), + }; + break; + case /* massa.abi.v1.CheckedScalarMulNativeTimeResult checked_scalar_mul_native_time_result */ 14: + message.res = { + oneofKind: 'checkedScalarMulNativeTimeResult', + checkedScalarMulNativeTimeResult: + CheckedScalarMulNativeTimeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkedScalarMulNativeTimeResult, + ), + }; + break; + case /* massa.abi.v1.CheckedSubNativeTimeResult checked_sub_native_time_result */ 15: + message.res = { + oneofKind: 'checkedSubNativeTimeResult', + checkedSubNativeTimeResult: + CheckedSubNativeTimeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).checkedSubNativeTimeResult, + ), + }; + break; + case /* massa.abi.v1.CompareAddressResult compare_address_result */ 16: + message.res = { + oneofKind: 'compareAddressResult', + compareAddressResult: CompareAddressResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).compareAddressResult, + ), + }; + break; + case /* massa.abi.v1.CompareNativeAmountResult compare_native_amount_result */ 17: + message.res = { + oneofKind: 'compareNativeAmountResult', + compareNativeAmountResult: + CompareNativeAmountResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).compareNativeAmountResult, + ), + }; + break; + case /* massa.abi.v1.CompareNativeTimeResult compare_native_time_result */ 18: + message.res = { + oneofKind: 'compareNativeTimeResult', + compareNativeTimeResult: CompareNativeTimeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).compareNativeTimeResult, + ), + }; + break; + case /* massa.abi.v1.ComparePubKeyResult compare_pub_key_result */ 19: + message.res = { + oneofKind: 'comparePubKeyResult', + comparePubKeyResult: ComparePubKeyResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).comparePubKeyResult, + ), + }; + break; + case /* massa.abi.v1.CreateScResult create_sc_result */ 20: + message.res = { + oneofKind: 'createScResult', + createScResult: CreateScResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).createScResult, + ), + }; + break; + case /* massa.abi.v1.DeleteDsEntryResult delete_ds_entry_result */ 21: + message.res = { + oneofKind: 'deleteDsEntryResult', + deleteDsEntryResult: DeleteDsEntryResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).deleteDsEntryResult, + ), + }; + break; + case /* massa.abi.v1.DivRemNativeAmountResult div_rem_native_amount_result */ 22: + message.res = { + oneofKind: 'divRemNativeAmountResult', + divRemNativeAmountResult: + DivRemNativeAmountResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).divRemNativeAmountResult, + ), + }; + break; + case /* massa.abi.v1.DsEntryExistsResult ds_entry_exists_result */ 23: + message.res = { + oneofKind: 'dsEntryExistsResult', + dsEntryExistsResult: DsEntryExistsResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).dsEntryExistsResult, + ), + }; + break; + case /* massa.abi.v1.FunctionExistsResult function_exists_result */ 24: + message.res = { + oneofKind: 'functionExistsResult', + functionExistsResult: FunctionExistsResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).functionExistsResult, + ), + }; + break; + case /* massa.abi.v1.GenerateEventResult generate_event_result */ 25: + message.res = { + oneofKind: 'generateEventResult', + generateEventResult: GenerateEventResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).generateEventResult, + ), + }; + break; + case /* massa.abi.v1.GetAddressCategoryResult get_address_category_result */ 26: + message.res = { + oneofKind: 'getAddressCategoryResult', + getAddressCategoryResult: + GetAddressCategoryResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getAddressCategoryResult, + ), + }; + break; + case /* massa.abi.v1.GetAddressVersionResult get_address_version_result */ 27: + message.res = { + oneofKind: 'getAddressVersionResult', + getAddressVersionResult: GetAddressVersionResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getAddressVersionResult, + ), + }; + break; + case /* massa.abi.v1.GetBalanceResult get_balance_result */ 28: + message.res = { + oneofKind: 'getBalanceResult', + getBalanceResult: GetBalanceResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getBalanceResult, + ), + }; + break; + case /* massa.abi.v1.GetBytecodeResult get_bytecode_result */ 29: + message.res = { + oneofKind: 'getBytecodeResult', + getBytecodeResult: GetBytecodeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getBytecodeResult, + ), + }; + break; + case /* massa.abi.v1.GetCallCoinsResult get_call_coins_result */ 30: + message.res = { + oneofKind: 'getCallCoinsResult', + getCallCoinsResult: GetCallCoinsResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getCallCoinsResult, + ), + }; + break; + case /* massa.abi.v1.GetCallStackResult get_call_stack_result */ 31: + message.res = { + oneofKind: 'getCallStackResult', + getCallStackResult: GetCallStackResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getCallStackResult, + ), + }; + break; + case /* massa.abi.v1.GetCurrentSlotResult get_current_slot_result */ 32: + message.res = { + oneofKind: 'getCurrentSlotResult', + getCurrentSlotResult: GetCurrentSlotResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getCurrentSlotResult, + ), + }; + break; + case /* massa.abi.v1.GetDsKeysResult get_ds_keys_result */ 33: + message.res = { + oneofKind: 'getDsKeysResult', + getDsKeysResult: GetDsKeysResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getDsKeysResult, + ), + }; + break; + case /* massa.abi.v1.GetDsValueResult get_ds_value_result */ 34: + message.res = { + oneofKind: 'getDsValueResult', + getDsValueResult: GetDsValueResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getDsValueResult, + ), + }; + break; + case /* massa.abi.v1.GetNativeTimeResult get_native_time_result */ 35: + message.res = { + oneofKind: 'getNativeTimeResult', + getNativeTimeResult: GetNativeTimeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getNativeTimeResult, + ), + }; + break; + case /* massa.abi.v1.GetOpDataResult get_op_data_result */ 36: + message.res = { + oneofKind: 'getOpDataResult', + getOpDataResult: GetOpDataResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getOpDataResult, + ), + }; + break; + case /* massa.abi.v1.GetOpKeysResult get_op_keys_result */ 37: + message.res = { + oneofKind: 'getOpKeysResult', + getOpKeysResult: GetOpKeysResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getOpKeysResult, + ), + }; + break; + case /* massa.abi.v1.GetOriginOperationIdResult get_origin_operation_id_result */ 38: + message.res = { + oneofKind: 'getOriginOperationIdResult', + getOriginOperationIdResult: + GetOriginOperationIdResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getOriginOperationIdResult, + ), + }; + break; + case /* massa.abi.v1.GetOwnedAddressesResult get_owned_addresses_result */ 39: + message.res = { + oneofKind: 'getOwnedAddressesResult', + getOwnedAddressesResult: GetOwnedAddressesResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getOwnedAddressesResult, + ), + }; + break; + case /* massa.abi.v1.GetPubKeyVersionResult get_pub_key_version_result */ 40: + message.res = { + oneofKind: 'getPubKeyVersionResult', + getPubKeyVersionResult: GetPubKeyVersionResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getPubKeyVersionResult, + ), + }; + break; + case /* massa.abi.v1.GetRemainingGasResult get_remaining_gas_result */ 41: + message.res = { + oneofKind: 'getRemainingGasResult', + getRemainingGasResult: GetRemainingGasResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getRemainingGasResult, + ), + }; + break; + case /* massa.abi.v1.GetSignatureVersionResult get_signature_version_result */ 42: + message.res = { + oneofKind: 'getSignatureVersionResult', + getSignatureVersionResult: + GetSignatureVersionResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).getSignatureVersionResult, + ), + }; + break; + case /* massa.abi.v1.HashBlake3Result hash_blake3_result */ 43: + message.res = { + oneofKind: 'hashBlake3Result', + hashBlake3Result: HashBlake3Result.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).hashBlake3Result, + ), + }; + break; + case /* massa.abi.v1.HashSha256Result hash_sha256_result */ 44: + message.res = { + oneofKind: 'hashSha256Result', + hashSha256Result: HashSha256Result.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).hashSha256Result, + ), + }; + break; + case /* massa.abi.v1.OpEntryExistsResult op_entry_exists_result */ 45: + message.res = { + oneofKind: 'opEntryExistsResult', + opEntryExistsResult: OpEntryExistsResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).opEntryExistsResult, + ), + }; + break; + case /* massa.abi.v1.Keccak256Result keccak256_result */ 46: + message.res = { + oneofKind: 'keccak256Result', + keccak256Result: Keccak256Result.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).keccak256Result, + ), + }; + break; + case /* massa.abi.v1.LocalExecutionResponse local_execution_response */ 47: + message.res = { + oneofKind: 'localExecutionResponse', + localExecutionResponse: LocalExecutionResponse.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).localExecutionResponse, + ), + }; + break; + case /* massa.abi.v1.NativeAmountFromStringResult native_amount_from_string_result */ 48: + message.res = { + oneofKind: 'nativeAmountFromStringResult', + nativeAmountFromStringResult: + NativeAmountFromStringResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).nativeAmountFromStringResult, + ), + }; + break; + case /* massa.abi.v1.NativeAmountToStringResult native_amount_to_string_result */ 49: + message.res = { + oneofKind: 'nativeAmountToStringResult', + nativeAmountToStringResult: + NativeAmountToStringResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).nativeAmountToStringResult, + ), + }; + break; + case /* massa.abi.v1.ScalarDivRemNativeAmountResult scalar_div_rem_native_amount_result */ 50: + message.res = { + oneofKind: 'scalarDivRemNativeAmountResult', + scalarDivRemNativeAmountResult: + ScalarDivRemNativeAmountResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).scalarDivRemNativeAmountResult, + ), + }; + break; + case /* massa.abi.v1.ScalarMulNativeAmountResult scalar_mul_native_amount_result */ 51: + message.res = { + oneofKind: 'scalarMulNativeAmountResult', + scalarMulNativeAmountResult: + ScalarMulNativeAmountResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).scalarMulNativeAmountResult, + ), + }; + break; + case /* massa.abi.v1.SendAsyncMessageResult send_async_message_result */ 52: + message.res = { + oneofKind: 'sendAsyncMessageResult', + sendAsyncMessageResult: SendAsyncMessageResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).sendAsyncMessageResult, + ), + }; + break; + case /* massa.abi.v1.SetBytecodeResult set_bytecode_result */ 53: + message.res = { + oneofKind: 'setBytecodeResult', + setBytecodeResult: SetBytecodeResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).setBytecodeResult, + ), + }; + break; + case /* massa.abi.v1.SetDsValueResult set_ds_value_result */ 54: + message.res = { + oneofKind: 'setDsValueResult', + setDsValueResult: SetDsValueResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).setDsValueResult, + ), + }; + break; + case /* massa.abi.v1.SubNativeAmountResult sub_native_amount_result */ 55: + message.res = { + oneofKind: 'subNativeAmountResult', + subNativeAmountResult: SubNativeAmountResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).subNativeAmountResult, + ), + }; + break; + case /* massa.abi.v1.TransferCoinsResult transfer_coins_result */ 56: + message.res = { + oneofKind: 'transferCoinsResult', + transferCoinsResult: TransferCoinsResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).transferCoinsResult, + ), + }; + break; + case /* massa.abi.v1.UnsafeRandomResult unsafe_random_result */ 57: + message.res = { + oneofKind: 'unsafeRandomResult', + unsafeRandomResult: UnsafeRandomResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).unsafeRandomResult, + ), + }; + break; + case /* massa.abi.v1.EvmVerifySigResult evm_verify_sig_result */ 58: + message.res = { + oneofKind: 'evmVerifySigResult', + evmVerifySigResult: EvmVerifySigResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).evmVerifySigResult, + ), + }; + break; + case /* massa.abi.v1.VerifySigResult verify_sig_result */ 59: + message.res = { + oneofKind: 'verifySigResult', + verifySigResult: VerifySigResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).verifySigResult, + ), + }; + break; + case /* massa.abi.v1.EvmGetAddressFromPubkeyResult evm_get_address_from_pubkey_result */ 60: + message.res = { + oneofKind: 'evmGetAddressFromPubkeyResult', + evmGetAddressFromPubkeyResult: + EvmGetAddressFromPubkeyResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).evmGetAddressFromPubkeyResult, + ), + }; + break; + case /* massa.abi.v1.EvmGetPubkeyFromSignatureResult evm_get_pubkey_from_signature_result */ 61: + message.res = { + oneofKind: 'evmGetPubkeyFromSignatureResult', + evmGetPubkeyFromSignatureResult: + EvmGetPubkeyFromSignatureResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).evmGetPubkeyFromSignatureResult, + ), + }; + break; + case /* massa.abi.v1.IsAddressEoaResult is_address_eoa_result */ 62: + message.res = { + oneofKind: 'isAddressEoaResult', + isAddressEoaResult: IsAddressEoaResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.res as any).isAddressEoaResult, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: RespResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.abi.v1.AddNativeAmountResult add_native_amount_result = 1; */ + if (message.res.oneofKind === 'addNativeAmountResult') + AddNativeAmountResult.internalBinaryWrite( + message.res.addNativeAmountResult, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.AddressFromPubKeyResult address_from_pub_key_result = 2; */ + if (message.res.oneofKind === 'addressFromPubKeyResult') + AddressFromPubKeyResult.internalBinaryWrite( + message.res.addressFromPubKeyResult, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.AppendDsValueResult append_ds_value_result = 3; */ + if (message.res.oneofKind === 'appendDsValueResult') + AppendDsValueResult.internalBinaryWrite( + message.res.appendDsValueResult, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.Base58CheckToBytesResult base58_check_to_bytes_result = 4; */ + if (message.res.oneofKind === 'base58CheckToBytesResult') + Base58CheckToBytesResult.internalBinaryWrite( + message.res.base58CheckToBytesResult, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.BytesToBase58CheckResult bytes_to_base58_check_result = 5; */ + if (message.res.oneofKind === 'bytesToBase58CheckResult') + BytesToBase58CheckResult.internalBinaryWrite( + message.res.bytesToBase58CheckResult, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CallerHasWriteAccessResult caller_has_write_access_result = 6; */ + if (message.res.oneofKind === 'callerHasWriteAccessResult') + CallerHasWriteAccessResult.internalBinaryWrite( + message.res.callerHasWriteAccessResult, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckAddressResult check_address_result = 7; */ + if (message.res.oneofKind === 'checkAddressResult') + CheckAddressResult.internalBinaryWrite( + message.res.checkAddressResult, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckNativeAmountResult check_native_amount_result = 8; */ + if (message.res.oneofKind === 'checkNativeAmountResult') + CheckNativeAmountResult.internalBinaryWrite( + message.res.checkNativeAmountResult, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckPubKeyResult check_pub_key_result = 9; */ + if (message.res.oneofKind === 'checkPubKeyResult') + CheckPubKeyResult.internalBinaryWrite( + message.res.checkPubKeyResult, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckSigResult check_sig_result = 10; */ + if (message.res.oneofKind === 'checkSigResult') + CheckSigResult.internalBinaryWrite( + message.res.checkSigResult, + writer.tag(10, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckedAddNativeTimeResult checked_add_native_time_result = 11; */ + if (message.res.oneofKind === 'checkedAddNativeTimeResult') + CheckedAddNativeTimeResult.internalBinaryWrite( + message.res.checkedAddNativeTimeResult, + writer.tag(11, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckedDivRemNativeTimeResult checked_div_rem_native_time_result = 12; */ + if (message.res.oneofKind === 'checkedDivRemNativeTimeResult') + CheckedDivRemNativeTimeResult.internalBinaryWrite( + message.res.checkedDivRemNativeTimeResult, + writer.tag(12, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckedScalarDivRemNativeTimeResult checked_scalar_div_rem_native_time_result = 13; */ + if (message.res.oneofKind === 'checkedScalarDivRemNativeTimeResult') + CheckedScalarDivRemNativeTimeResult.internalBinaryWrite( + message.res.checkedScalarDivRemNativeTimeResult, + writer.tag(13, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckedScalarMulNativeTimeResult checked_scalar_mul_native_time_result = 14; */ + if (message.res.oneofKind === 'checkedScalarMulNativeTimeResult') + CheckedScalarMulNativeTimeResult.internalBinaryWrite( + message.res.checkedScalarMulNativeTimeResult, + writer.tag(14, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CheckedSubNativeTimeResult checked_sub_native_time_result = 15; */ + if (message.res.oneofKind === 'checkedSubNativeTimeResult') + CheckedSubNativeTimeResult.internalBinaryWrite( + message.res.checkedSubNativeTimeResult, + writer.tag(15, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CompareAddressResult compare_address_result = 16; */ + if (message.res.oneofKind === 'compareAddressResult') + CompareAddressResult.internalBinaryWrite( + message.res.compareAddressResult, + writer.tag(16, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CompareNativeAmountResult compare_native_amount_result = 17; */ + if (message.res.oneofKind === 'compareNativeAmountResult') + CompareNativeAmountResult.internalBinaryWrite( + message.res.compareNativeAmountResult, + writer.tag(17, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CompareNativeTimeResult compare_native_time_result = 18; */ + if (message.res.oneofKind === 'compareNativeTimeResult') + CompareNativeTimeResult.internalBinaryWrite( + message.res.compareNativeTimeResult, + writer.tag(18, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.ComparePubKeyResult compare_pub_key_result = 19; */ + if (message.res.oneofKind === 'comparePubKeyResult') + ComparePubKeyResult.internalBinaryWrite( + message.res.comparePubKeyResult, + writer.tag(19, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.CreateScResult create_sc_result = 20; */ + if (message.res.oneofKind === 'createScResult') + CreateScResult.internalBinaryWrite( + message.res.createScResult, + writer.tag(20, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.DeleteDsEntryResult delete_ds_entry_result = 21; */ + if (message.res.oneofKind === 'deleteDsEntryResult') + DeleteDsEntryResult.internalBinaryWrite( + message.res.deleteDsEntryResult, + writer.tag(21, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.DivRemNativeAmountResult div_rem_native_amount_result = 22; */ + if (message.res.oneofKind === 'divRemNativeAmountResult') + DivRemNativeAmountResult.internalBinaryWrite( + message.res.divRemNativeAmountResult, + writer.tag(22, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.DsEntryExistsResult ds_entry_exists_result = 23; */ + if (message.res.oneofKind === 'dsEntryExistsResult') + DsEntryExistsResult.internalBinaryWrite( + message.res.dsEntryExistsResult, + writer.tag(23, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.FunctionExistsResult function_exists_result = 24; */ + if (message.res.oneofKind === 'functionExistsResult') + FunctionExistsResult.internalBinaryWrite( + message.res.functionExistsResult, + writer.tag(24, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GenerateEventResult generate_event_result = 25; */ + if (message.res.oneofKind === 'generateEventResult') + GenerateEventResult.internalBinaryWrite( + message.res.generateEventResult, + writer.tag(25, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetAddressCategoryResult get_address_category_result = 26; */ + if (message.res.oneofKind === 'getAddressCategoryResult') + GetAddressCategoryResult.internalBinaryWrite( + message.res.getAddressCategoryResult, + writer.tag(26, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetAddressVersionResult get_address_version_result = 27; */ + if (message.res.oneofKind === 'getAddressVersionResult') + GetAddressVersionResult.internalBinaryWrite( + message.res.getAddressVersionResult, + writer.tag(27, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetBalanceResult get_balance_result = 28; */ + if (message.res.oneofKind === 'getBalanceResult') + GetBalanceResult.internalBinaryWrite( + message.res.getBalanceResult, + writer.tag(28, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetBytecodeResult get_bytecode_result = 29; */ + if (message.res.oneofKind === 'getBytecodeResult') + GetBytecodeResult.internalBinaryWrite( + message.res.getBytecodeResult, + writer.tag(29, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetCallCoinsResult get_call_coins_result = 30; */ + if (message.res.oneofKind === 'getCallCoinsResult') + GetCallCoinsResult.internalBinaryWrite( + message.res.getCallCoinsResult, + writer.tag(30, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetCallStackResult get_call_stack_result = 31; */ + if (message.res.oneofKind === 'getCallStackResult') + GetCallStackResult.internalBinaryWrite( + message.res.getCallStackResult, + writer.tag(31, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetCurrentSlotResult get_current_slot_result = 32; */ + if (message.res.oneofKind === 'getCurrentSlotResult') + GetCurrentSlotResult.internalBinaryWrite( + message.res.getCurrentSlotResult, + writer.tag(32, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetDsKeysResult get_ds_keys_result = 33; */ + if (message.res.oneofKind === 'getDsKeysResult') + GetDsKeysResult.internalBinaryWrite( + message.res.getDsKeysResult, + writer.tag(33, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetDsValueResult get_ds_value_result = 34; */ + if (message.res.oneofKind === 'getDsValueResult') + GetDsValueResult.internalBinaryWrite( + message.res.getDsValueResult, + writer.tag(34, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetNativeTimeResult get_native_time_result = 35; */ + if (message.res.oneofKind === 'getNativeTimeResult') + GetNativeTimeResult.internalBinaryWrite( + message.res.getNativeTimeResult, + writer.tag(35, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetOpDataResult get_op_data_result = 36; */ + if (message.res.oneofKind === 'getOpDataResult') + GetOpDataResult.internalBinaryWrite( + message.res.getOpDataResult, + writer.tag(36, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetOpKeysResult get_op_keys_result = 37; */ + if (message.res.oneofKind === 'getOpKeysResult') + GetOpKeysResult.internalBinaryWrite( + message.res.getOpKeysResult, + writer.tag(37, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetOriginOperationIdResult get_origin_operation_id_result = 38; */ + if (message.res.oneofKind === 'getOriginOperationIdResult') + GetOriginOperationIdResult.internalBinaryWrite( + message.res.getOriginOperationIdResult, + writer.tag(38, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetOwnedAddressesResult get_owned_addresses_result = 39; */ + if (message.res.oneofKind === 'getOwnedAddressesResult') + GetOwnedAddressesResult.internalBinaryWrite( + message.res.getOwnedAddressesResult, + writer.tag(39, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetPubKeyVersionResult get_pub_key_version_result = 40; */ + if (message.res.oneofKind === 'getPubKeyVersionResult') + GetPubKeyVersionResult.internalBinaryWrite( + message.res.getPubKeyVersionResult, + writer.tag(40, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetRemainingGasResult get_remaining_gas_result = 41; */ + if (message.res.oneofKind === 'getRemainingGasResult') + GetRemainingGasResult.internalBinaryWrite( + message.res.getRemainingGasResult, + writer.tag(41, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.GetSignatureVersionResult get_signature_version_result = 42; */ + if (message.res.oneofKind === 'getSignatureVersionResult') + GetSignatureVersionResult.internalBinaryWrite( + message.res.getSignatureVersionResult, + writer.tag(42, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.HashBlake3Result hash_blake3_result = 43; */ + if (message.res.oneofKind === 'hashBlake3Result') + HashBlake3Result.internalBinaryWrite( + message.res.hashBlake3Result, + writer.tag(43, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.HashSha256Result hash_sha256_result = 44; */ + if (message.res.oneofKind === 'hashSha256Result') + HashSha256Result.internalBinaryWrite( + message.res.hashSha256Result, + writer.tag(44, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.OpEntryExistsResult op_entry_exists_result = 45; */ + if (message.res.oneofKind === 'opEntryExistsResult') + OpEntryExistsResult.internalBinaryWrite( + message.res.opEntryExistsResult, + writer.tag(45, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.Keccak256Result keccak256_result = 46; */ + if (message.res.oneofKind === 'keccak256Result') + Keccak256Result.internalBinaryWrite( + message.res.keccak256Result, + writer.tag(46, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.LocalExecutionResponse local_execution_response = 47; */ + if (message.res.oneofKind === 'localExecutionResponse') + LocalExecutionResponse.internalBinaryWrite( + message.res.localExecutionResponse, + writer.tag(47, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.NativeAmountFromStringResult native_amount_from_string_result = 48; */ + if (message.res.oneofKind === 'nativeAmountFromStringResult') + NativeAmountFromStringResult.internalBinaryWrite( + message.res.nativeAmountFromStringResult, + writer.tag(48, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.NativeAmountToStringResult native_amount_to_string_result = 49; */ + if (message.res.oneofKind === 'nativeAmountToStringResult') + NativeAmountToStringResult.internalBinaryWrite( + message.res.nativeAmountToStringResult, + writer.tag(49, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.ScalarDivRemNativeAmountResult scalar_div_rem_native_amount_result = 50; */ + if (message.res.oneofKind === 'scalarDivRemNativeAmountResult') + ScalarDivRemNativeAmountResult.internalBinaryWrite( + message.res.scalarDivRemNativeAmountResult, + writer.tag(50, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.ScalarMulNativeAmountResult scalar_mul_native_amount_result = 51; */ + if (message.res.oneofKind === 'scalarMulNativeAmountResult') + ScalarMulNativeAmountResult.internalBinaryWrite( + message.res.scalarMulNativeAmountResult, + writer.tag(51, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.SendAsyncMessageResult send_async_message_result = 52; */ + if (message.res.oneofKind === 'sendAsyncMessageResult') + SendAsyncMessageResult.internalBinaryWrite( + message.res.sendAsyncMessageResult, + writer.tag(52, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.SetBytecodeResult set_bytecode_result = 53; */ + if (message.res.oneofKind === 'setBytecodeResult') + SetBytecodeResult.internalBinaryWrite( + message.res.setBytecodeResult, + writer.tag(53, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.SetDsValueResult set_ds_value_result = 54; */ + if (message.res.oneofKind === 'setDsValueResult') + SetDsValueResult.internalBinaryWrite( + message.res.setDsValueResult, + writer.tag(54, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.SubNativeAmountResult sub_native_amount_result = 55; */ + if (message.res.oneofKind === 'subNativeAmountResult') + SubNativeAmountResult.internalBinaryWrite( + message.res.subNativeAmountResult, + writer.tag(55, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.TransferCoinsResult transfer_coins_result = 56; */ + if (message.res.oneofKind === 'transferCoinsResult') + TransferCoinsResult.internalBinaryWrite( + message.res.transferCoinsResult, + writer.tag(56, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.UnsafeRandomResult unsafe_random_result = 57; */ + if (message.res.oneofKind === 'unsafeRandomResult') + UnsafeRandomResult.internalBinaryWrite( + message.res.unsafeRandomResult, + writer.tag(57, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.EvmVerifySigResult evm_verify_sig_result = 58; */ + if (message.res.oneofKind === 'evmVerifySigResult') + EvmVerifySigResult.internalBinaryWrite( + message.res.evmVerifySigResult, + writer.tag(58, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.VerifySigResult verify_sig_result = 59; */ + if (message.res.oneofKind === 'verifySigResult') + VerifySigResult.internalBinaryWrite( + message.res.verifySigResult, + writer.tag(59, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.EvmGetAddressFromPubkeyResult evm_get_address_from_pubkey_result = 60; */ + if (message.res.oneofKind === 'evmGetAddressFromPubkeyResult') + EvmGetAddressFromPubkeyResult.internalBinaryWrite( + message.res.evmGetAddressFromPubkeyResult, + writer.tag(60, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.EvmGetPubkeyFromSignatureResult evm_get_pubkey_from_signature_result = 61; */ + if (message.res.oneofKind === 'evmGetPubkeyFromSignatureResult') + EvmGetPubkeyFromSignatureResult.internalBinaryWrite( + message.res.evmGetPubkeyFromSignatureResult, + writer.tag(61, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.IsAddressEoaResult is_address_eoa_result = 62; */ + if (message.res.oneofKind === 'isAddressEoaResult') + IsAddressEoaResult.internalBinaryWrite( + message.res.isAddressEoaResult, + writer.tag(62, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.RespResult + */ +export const RespResult = new RespResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AbiResponse$Type extends MessageType { + constructor() { + super('massa.abi.v1.AbiResponse', [ + { + no: 1, + name: 'res', + kind: 'message', + oneof: 'resp', + T: () => RespResult, + }, + { no: 2, name: 'error', kind: 'message', oneof: 'resp', T: () => Error }, + ]); + } + create(value?: PartialMessage): AbiResponse { + const message = { resp: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AbiResponse, + ): AbiResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.abi.v1.RespResult res */ 1: + message.resp = { + oneofKind: 'res', + res: RespResult.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.resp as any).res, + ), + }; + break; + case /* massa.abi.v1.Error error */ 2: + message.resp = { + oneofKind: 'error', + error: Error.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.resp as any).error, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AbiResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.abi.v1.RespResult res = 1; */ + if (message.resp.oneofKind === 'res') + RespResult.internalBinaryWrite( + message.resp.res, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.abi.v1.Error error = 2; */ + if (message.resp.oneofKind === 'error') + Error.internalBinaryWrite( + message.resp.error, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.AbiResponse + */ +export const AbiResponse = new AbiResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NativeAmountToStringRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.NativeAmountToStringRequest', [ + { no: 1, name: 'to_convert', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): NativeAmountToStringRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NativeAmountToStringRequest, + ): NativeAmountToStringRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount to_convert */ 1: + message.toConvert = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.toConvert, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NativeAmountToStringRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount to_convert = 1; */ + if (message.toConvert) + NativeAmount.internalBinaryWrite( + message.toConvert, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.NativeAmountToStringRequest + */ +export const NativeAmountToStringRequest = + new NativeAmountToStringRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NativeAmountToStringResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.NativeAmountToStringResult', [ + { + no: 1, + name: 'converted_amount', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): NativeAmountToStringResult { + const message = { convertedAmount: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NativeAmountToStringResult, + ): NativeAmountToStringResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string converted_amount */ 1: + message.convertedAmount = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NativeAmountToStringResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string converted_amount = 1; */ + if (message.convertedAmount !== '') + writer.tag(1, WireType.LengthDelimited).string(message.convertedAmount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.NativeAmountToStringResult + */ +export const NativeAmountToStringResult = new NativeAmountToStringResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NativeAmountFromStringRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.NativeAmountFromStringRequest', [ + { + no: 1, + name: 'to_convert', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): NativeAmountFromStringRequest { + const message = { toConvert: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NativeAmountFromStringRequest, + ): NativeAmountFromStringRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string to_convert */ 1: + message.toConvert = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NativeAmountFromStringRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string to_convert = 1; */ + if (message.toConvert !== '') + writer.tag(1, WireType.LengthDelimited).string(message.toConvert); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.NativeAmountFromStringRequest + */ +export const NativeAmountFromStringRequest = + new NativeAmountFromStringRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NativeAmountFromStringResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.NativeAmountFromStringResult', [ + { + no: 1, + name: 'converted_amount', + kind: 'message', + T: () => NativeAmount, + }, + ]); + } + create( + value?: PartialMessage, + ): NativeAmountFromStringResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NativeAmountFromStringResult, + ): NativeAmountFromStringResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount converted_amount */ 1: + message.convertedAmount = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.convertedAmount, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NativeAmountFromStringResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount converted_amount = 1; */ + if (message.convertedAmount) + NativeAmount.internalBinaryWrite( + message.convertedAmount, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.NativeAmountFromStringResult + */ +export const NativeAmountFromStringResult = + new NativeAmountFromStringResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckAddressRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckAddressRequest', [ + { no: 1, name: 'to_check', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): CheckAddressRequest { + const message = { toCheck: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckAddressRequest, + ): CheckAddressRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string to_check */ 1: + message.toCheck = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckAddressRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string to_check = 1; */ + if (message.toCheck !== '') + writer.tag(1, WireType.LengthDelimited).string(message.toCheck); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckAddressRequest + */ +export const CheckAddressRequest = new CheckAddressRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckAddressResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckAddressResult', [ + { no: 1, name: 'is_valid', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): CheckAddressResult { + const message = { isValid: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckAddressResult, + ): CheckAddressResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool is_valid */ 1: + message.isValid = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckAddressResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool is_valid = 1; */ + if (message.isValid !== false) + writer.tag(1, WireType.Varint).bool(message.isValid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckAddressResult + */ +export const CheckAddressResult = new CheckAddressResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckPubKeyRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckPubKeyRequest', [ + { no: 1, name: 'to_check', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): CheckPubKeyRequest { + const message = { toCheck: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckPubKeyRequest, + ): CheckPubKeyRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string to_check */ 1: + message.toCheck = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckPubKeyRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string to_check = 1; */ + if (message.toCheck !== '') + writer.tag(1, WireType.LengthDelimited).string(message.toCheck); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckPubKeyRequest + */ +export const CheckPubKeyRequest = new CheckPubKeyRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckPubKeyResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckPubKeyResult', [ + { no: 1, name: 'is_valid', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): CheckPubKeyResult { + const message = { isValid: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckPubKeyResult, + ): CheckPubKeyResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool is_valid */ 1: + message.isValid = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckPubKeyResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool is_valid = 1; */ + if (message.isValid !== false) + writer.tag(1, WireType.Varint).bool(message.isValid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckPubKeyResult + */ +export const CheckPubKeyResult = new CheckPubKeyResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckSigRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckSigRequest', [ + { no: 1, name: 'to_check', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): CheckSigRequest { + const message = { toCheck: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckSigRequest, + ): CheckSigRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string to_check */ 1: + message.toCheck = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckSigRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string to_check = 1; */ + if (message.toCheck !== '') + writer.tag(1, WireType.LengthDelimited).string(message.toCheck); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckSigRequest + */ +export const CheckSigRequest = new CheckSigRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckSigResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckSigResult', [ + { no: 1, name: 'is_valid', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): CheckSigResult { + const message = { isValid: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckSigResult, + ): CheckSigResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool is_valid */ 1: + message.isValid = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckSigResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool is_valid = 1; */ + if (message.isValid !== false) + writer.tag(1, WireType.Varint).bool(message.isValid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckSigResult + */ +export const CheckSigResult = new CheckSigResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckNativeAmountRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckNativeAmountRequest', [ + { no: 1, name: 'to_check', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): CheckNativeAmountRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckNativeAmountRequest, + ): CheckNativeAmountRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount to_check */ 1: + message.toCheck = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.toCheck, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckNativeAmountRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount to_check = 1; */ + if (message.toCheck) + NativeAmount.internalBinaryWrite( + message.toCheck, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckNativeAmountRequest + */ +export const CheckNativeAmountRequest = new CheckNativeAmountRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckNativeAmountResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckNativeAmountResult', [ + { no: 1, name: 'is_valid', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create( + value?: PartialMessage, + ): CheckNativeAmountResult { + const message = { isValid: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckNativeAmountResult, + ): CheckNativeAmountResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool is_valid */ 1: + message.isValid = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckNativeAmountResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool is_valid = 1; */ + if (message.isValid !== false) + writer.tag(1, WireType.Varint).bool(message.isValid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckNativeAmountResult + */ +export const CheckNativeAmountResult = new CheckNativeAmountResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddNativeAmountRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.AddNativeAmountRequest', [ + { no: 1, name: 'amount1', kind: 'message', T: () => NativeAmount }, + { no: 2, name: 'amount2', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): AddNativeAmountRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddNativeAmountRequest, + ): AddNativeAmountRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount amount1 */ 1: + message.amount1 = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.amount1, + ); + break; + case /* massa.model.v1.NativeAmount amount2 */ 2: + message.amount2 = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.amount2, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddNativeAmountRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount amount1 = 1; */ + if (message.amount1) + NativeAmount.internalBinaryWrite( + message.amount1, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount amount2 = 2; */ + if (message.amount2) + NativeAmount.internalBinaryWrite( + message.amount2, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.AddNativeAmountRequest + */ +export const AddNativeAmountRequest = new AddNativeAmountRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddNativeAmountResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.AddNativeAmountResult', [ + { no: 1, name: 'sum', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): AddNativeAmountResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddNativeAmountResult, + ): AddNativeAmountResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount sum */ 1: + message.sum = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sum, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddNativeAmountResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount sum = 1; */ + if (message.sum) + NativeAmount.internalBinaryWrite( + message.sum, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.AddNativeAmountResult + */ +export const AddNativeAmountResult = new AddNativeAmountResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubNativeAmountRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.SubNativeAmountRequest', [ + { no: 1, name: 'left', kind: 'message', T: () => NativeAmount }, + { no: 2, name: 'right', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): SubNativeAmountRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SubNativeAmountRequest, + ): SubNativeAmountRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount left */ 1: + message.left = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.left, + ); + break; + case /* massa.model.v1.NativeAmount right */ 2: + message.right = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.right, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SubNativeAmountRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount left = 1; */ + if (message.left) + NativeAmount.internalBinaryWrite( + message.left, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount right = 2; */ + if (message.right) + NativeAmount.internalBinaryWrite( + message.right, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SubNativeAmountRequest + */ +export const SubNativeAmountRequest = new SubNativeAmountRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubNativeAmountResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.SubNativeAmountResult', [ + { no: 1, name: 'difference', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): SubNativeAmountResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SubNativeAmountResult, + ): SubNativeAmountResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount difference */ 1: + message.difference = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.difference, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SubNativeAmountResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount difference = 1; */ + if (message.difference) + NativeAmount.internalBinaryWrite( + message.difference, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SubNativeAmountResult + */ +export const SubNativeAmountResult = new SubNativeAmountResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScalarMulNativeAmountRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.ScalarMulNativeAmountRequest', [ + { no: 1, name: 'amount', kind: 'message', T: () => NativeAmount }, + { + no: 2, + name: 'coefficient', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): ScalarMulNativeAmountRequest { + const message = { coefficient: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScalarMulNativeAmountRequest, + ): ScalarMulNativeAmountRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount amount */ 1: + message.amount = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.amount, + ); + break; + case /* uint64 coefficient */ 2: + message.coefficient = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScalarMulNativeAmountRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount amount = 1; */ + if (message.amount) + NativeAmount.internalBinaryWrite( + message.amount, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 coefficient = 2; */ + if (message.coefficient !== 0n) + writer.tag(2, WireType.Varint).uint64(message.coefficient); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.ScalarMulNativeAmountRequest + */ +export const ScalarMulNativeAmountRequest = + new ScalarMulNativeAmountRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScalarMulNativeAmountResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.ScalarMulNativeAmountResult', [ + { no: 1, name: 'product', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): ScalarMulNativeAmountResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScalarMulNativeAmountResult, + ): ScalarMulNativeAmountResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount product */ 1: + message.product = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.product, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScalarMulNativeAmountResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount product = 1; */ + if (message.product) + NativeAmount.internalBinaryWrite( + message.product, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.ScalarMulNativeAmountResult + */ +export const ScalarMulNativeAmountResult = + new ScalarMulNativeAmountResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScalarDivRemNativeAmountRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.ScalarDivRemNativeAmountRequest', [ + { no: 1, name: 'dividend', kind: 'message', T: () => NativeAmount }, + { + no: 2, + name: 'divisor', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): ScalarDivRemNativeAmountRequest { + const message = { divisor: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScalarDivRemNativeAmountRequest, + ): ScalarDivRemNativeAmountRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount dividend */ 1: + message.dividend = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dividend, + ); + break; + case /* uint64 divisor */ 2: + message.divisor = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScalarDivRemNativeAmountRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount dividend = 1; */ + if (message.dividend) + NativeAmount.internalBinaryWrite( + message.dividend, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 divisor = 2; */ + if (message.divisor !== 0n) + writer.tag(2, WireType.Varint).uint64(message.divisor); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.ScalarDivRemNativeAmountRequest + */ +export const ScalarDivRemNativeAmountRequest = + new ScalarDivRemNativeAmountRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScalarDivRemNativeAmountResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.ScalarDivRemNativeAmountResult', [ + { no: 1, name: 'quotient', kind: 'message', T: () => NativeAmount }, + { no: 2, name: 'remainder', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): ScalarDivRemNativeAmountResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScalarDivRemNativeAmountResult, + ): ScalarDivRemNativeAmountResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount quotient */ 1: + message.quotient = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.quotient, + ); + break; + case /* massa.model.v1.NativeAmount remainder */ 2: + message.remainder = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.remainder, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScalarDivRemNativeAmountResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount quotient = 1; */ + if (message.quotient) + NativeAmount.internalBinaryWrite( + message.quotient, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount remainder = 2; */ + if (message.remainder) + NativeAmount.internalBinaryWrite( + message.remainder, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.ScalarDivRemNativeAmountResult + */ +export const ScalarDivRemNativeAmountResult = + new ScalarDivRemNativeAmountResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DivRemNativeAmountRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.DivRemNativeAmountRequest', [ + { no: 1, name: 'dividend', kind: 'message', T: () => NativeAmount }, + { no: 2, name: 'divisor', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): DivRemNativeAmountRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DivRemNativeAmountRequest, + ): DivRemNativeAmountRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount dividend */ 1: + message.dividend = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dividend, + ); + break; + case /* massa.model.v1.NativeAmount divisor */ 2: + message.divisor = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.divisor, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DivRemNativeAmountRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount dividend = 1; */ + if (message.dividend) + NativeAmount.internalBinaryWrite( + message.dividend, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount divisor = 2; */ + if (message.divisor) + NativeAmount.internalBinaryWrite( + message.divisor, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.DivRemNativeAmountRequest + */ +export const DivRemNativeAmountRequest = new DivRemNativeAmountRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DivRemNativeAmountResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.DivRemNativeAmountResult', [ + { + no: 1, + name: 'quotient', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 2, name: 'remainder', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): DivRemNativeAmountResult { + const message = { quotient: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DivRemNativeAmountResult, + ): DivRemNativeAmountResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 quotient */ 1: + message.quotient = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.NativeAmount remainder */ 2: + message.remainder = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.remainder, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DivRemNativeAmountResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 quotient = 1; */ + if (message.quotient !== 0n) + writer.tag(1, WireType.Varint).uint64(message.quotient); + /* massa.model.v1.NativeAmount remainder = 2; */ + if (message.remainder) + NativeAmount.internalBinaryWrite( + message.remainder, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.DivRemNativeAmountResult + */ +export const DivRemNativeAmountResult = new DivRemNativeAmountResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedAddNativeTimeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedAddNativeTimeRequest', [ + { no: 1, name: 'left', kind: 'message', T: () => NativeTime }, + { no: 2, name: 'right', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedAddNativeTimeRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedAddNativeTimeRequest, + ): CheckedAddNativeTimeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime left */ 1: + message.left = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.left, + ); + break; + case /* massa.model.v1.NativeTime right */ 2: + message.right = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.right, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedAddNativeTimeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime left = 1; */ + if (message.left) + NativeTime.internalBinaryWrite( + message.left, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime right = 2; */ + if (message.right) + NativeTime.internalBinaryWrite( + message.right, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedAddNativeTimeRequest + */ +export const CheckedAddNativeTimeRequest = + new CheckedAddNativeTimeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedAddNativeTimeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedAddNativeTimeResult', [ + { no: 1, name: 'sum', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedAddNativeTimeResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedAddNativeTimeResult, + ): CheckedAddNativeTimeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime sum */ 1: + message.sum = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sum, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedAddNativeTimeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime sum = 1; */ + if (message.sum) + NativeTime.internalBinaryWrite( + message.sum, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedAddNativeTimeResult + */ +export const CheckedAddNativeTimeResult = new CheckedAddNativeTimeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedSubNativeTimeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedSubNativeTimeRequest', [ + { no: 1, name: 'left', kind: 'message', T: () => NativeTime }, + { no: 2, name: 'right', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedSubNativeTimeRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedSubNativeTimeRequest, + ): CheckedSubNativeTimeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime left */ 1: + message.left = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.left, + ); + break; + case /* massa.model.v1.NativeTime right */ 2: + message.right = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.right, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedSubNativeTimeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime left = 1; */ + if (message.left) + NativeTime.internalBinaryWrite( + message.left, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime right = 2; */ + if (message.right) + NativeTime.internalBinaryWrite( + message.right, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedSubNativeTimeRequest + */ +export const CheckedSubNativeTimeRequest = + new CheckedSubNativeTimeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedSubNativeTimeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedSubNativeTimeResult', [ + { no: 1, name: 'difference', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedSubNativeTimeResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedSubNativeTimeResult, + ): CheckedSubNativeTimeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime difference */ 1: + message.difference = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.difference, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedSubNativeTimeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime difference = 1; */ + if (message.difference) + NativeTime.internalBinaryWrite( + message.difference, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedSubNativeTimeResult + */ +export const CheckedSubNativeTimeResult = new CheckedSubNativeTimeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedScalarMulNativeTimeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedScalarMulNativeTimeRequest', [ + { no: 1, name: 'time', kind: 'message', T: () => NativeTime }, + { + no: 2, + name: 'coefficient', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): CheckedScalarMulNativeTimeRequest { + const message = { coefficient: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedScalarMulNativeTimeRequest, + ): CheckedScalarMulNativeTimeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime time */ 1: + message.time = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.time, + ); + break; + case /* uint64 coefficient */ 2: + message.coefficient = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedScalarMulNativeTimeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime time = 1; */ + if (message.time) + NativeTime.internalBinaryWrite( + message.time, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 coefficient = 2; */ + if (message.coefficient !== 0n) + writer.tag(2, WireType.Varint).uint64(message.coefficient); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedScalarMulNativeTimeRequest + */ +export const CheckedScalarMulNativeTimeRequest = + new CheckedScalarMulNativeTimeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedScalarMulNativeTimeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedScalarMulNativeTimeResult', [ + { no: 1, name: 'product', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedScalarMulNativeTimeResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedScalarMulNativeTimeResult, + ): CheckedScalarMulNativeTimeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime product */ 1: + message.product = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.product, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedScalarMulNativeTimeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime product = 1; */ + if (message.product) + NativeTime.internalBinaryWrite( + message.product, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedScalarMulNativeTimeResult + */ +export const CheckedScalarMulNativeTimeResult = + new CheckedScalarMulNativeTimeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedScalarDivRemNativeTimeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedScalarDivRemNativeTimeRequest', [ + { no: 1, name: 'dividend', kind: 'message', T: () => NativeTime }, + { + no: 2, + name: 'divisor', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): CheckedScalarDivRemNativeTimeRequest { + const message = { divisor: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedScalarDivRemNativeTimeRequest, + ): CheckedScalarDivRemNativeTimeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime dividend */ 1: + message.dividend = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dividend, + ); + break; + case /* uint64 divisor */ 2: + message.divisor = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedScalarDivRemNativeTimeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime dividend = 1; */ + if (message.dividend) + NativeTime.internalBinaryWrite( + message.dividend, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 divisor = 2; */ + if (message.divisor !== 0n) + writer.tag(2, WireType.Varint).uint64(message.divisor); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedScalarDivRemNativeTimeRequest + */ +export const CheckedScalarDivRemNativeTimeRequest = + new CheckedScalarDivRemNativeTimeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedScalarDivRemNativeTimeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedScalarDivRemNativeTimeResult', [ + { no: 1, name: 'quotient', kind: 'message', T: () => NativeTime }, + { no: 2, name: 'remainder', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedScalarDivRemNativeTimeResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedScalarDivRemNativeTimeResult, + ): CheckedScalarDivRemNativeTimeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime quotient */ 1: + message.quotient = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.quotient, + ); + break; + case /* massa.model.v1.NativeTime remainder */ 2: + message.remainder = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.remainder, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedScalarDivRemNativeTimeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime quotient = 1; */ + if (message.quotient) + NativeTime.internalBinaryWrite( + message.quotient, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime remainder = 2; */ + if (message.remainder) + NativeTime.internalBinaryWrite( + message.remainder, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedScalarDivRemNativeTimeResult + */ +export const CheckedScalarDivRemNativeTimeResult = + new CheckedScalarDivRemNativeTimeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedDivRemNativeTimeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedDivRemNativeTimeRequest', [ + { no: 1, name: 'dividend', kind: 'message', T: () => NativeTime }, + { no: 2, name: 'divisor', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedDivRemNativeTimeRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedDivRemNativeTimeRequest, + ): CheckedDivRemNativeTimeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime dividend */ 1: + message.dividend = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dividend, + ); + break; + case /* massa.model.v1.NativeTime divisor */ 2: + message.divisor = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.divisor, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedDivRemNativeTimeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime dividend = 1; */ + if (message.dividend) + NativeTime.internalBinaryWrite( + message.dividend, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime divisor = 2; */ + if (message.divisor) + NativeTime.internalBinaryWrite( + message.divisor, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedDivRemNativeTimeRequest + */ +export const CheckedDivRemNativeTimeRequest = + new CheckedDivRemNativeTimeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckedDivRemNativeTimeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CheckedDivRemNativeTimeResult', [ + { + no: 1, + name: 'quotient', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 2, name: 'remainder', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CheckedDivRemNativeTimeResult { + const message = { quotient: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CheckedDivRemNativeTimeResult, + ): CheckedDivRemNativeTimeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 quotient */ 1: + message.quotient = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.NativeTime remainder */ 2: + message.remainder = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.remainder, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CheckedDivRemNativeTimeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 quotient = 1; */ + if (message.quotient !== 0n) + writer.tag(1, WireType.Varint).uint64(message.quotient); + /* massa.model.v1.NativeTime remainder = 2; */ + if (message.remainder) + NativeTime.internalBinaryWrite( + message.remainder, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CheckedDivRemNativeTimeResult + */ +export const CheckedDivRemNativeTimeResult = + new CheckedDivRemNativeTimeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CompareNativeTimeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CompareNativeTimeRequest', [ + { no: 1, name: 'left', kind: 'message', T: () => NativeTime }, + { no: 2, name: 'right', kind: 'message', T: () => NativeTime }, + ]); + } + create( + value?: PartialMessage, + ): CompareNativeTimeRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CompareNativeTimeRequest, + ): CompareNativeTimeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime left */ 1: + message.left = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.left, + ); + break; + case /* massa.model.v1.NativeTime right */ 2: + message.right = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.right, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CompareNativeTimeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime left = 1; */ + if (message.left) + NativeTime.internalBinaryWrite( + message.left, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime right = 2; */ + if (message.right) + NativeTime.internalBinaryWrite( + message.right, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CompareNativeTimeRequest + */ +export const CompareNativeTimeRequest = new CompareNativeTimeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CompareNativeTimeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CompareNativeTimeResult', [ + { + no: 1, + name: 'result', + kind: 'enum', + T: () => [ + 'massa.model.v1.ComparisonResult', + ComparisonResult, + 'COMPARISON_RESULT_', + ], + }, + ]); + } + create( + value?: PartialMessage, + ): CompareNativeTimeResult { + const message = { result: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CompareNativeTimeResult, + ): CompareNativeTimeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ComparisonResult result */ 1: + message.result = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CompareNativeTimeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ComparisonResult result = 1; */ + if (message.result !== 0) + writer.tag(1, WireType.Varint).int32(message.result); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CompareNativeTimeResult + */ +export const CompareNativeTimeResult = new CompareNativeTimeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CompareAddressRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CompareAddressRequest', [ + { no: 1, name: 'left', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'right', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): CompareAddressRequest { + const message = { left: '', right: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CompareAddressRequest, + ): CompareAddressRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string left */ 1: + message.left = reader.string(); + break; + case /* string right */ 2: + message.right = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CompareAddressRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string left = 1; */ + if (message.left !== '') + writer.tag(1, WireType.LengthDelimited).string(message.left); + /* string right = 2; */ + if (message.right !== '') + writer.tag(2, WireType.LengthDelimited).string(message.right); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CompareAddressRequest + */ +export const CompareAddressRequest = new CompareAddressRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CompareAddressResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CompareAddressResult', [ + { + no: 1, + name: 'result', + kind: 'enum', + T: () => [ + 'massa.model.v1.ComparisonResult', + ComparisonResult, + 'COMPARISON_RESULT_', + ], + }, + ]); + } + create(value?: PartialMessage): CompareAddressResult { + const message = { result: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CompareAddressResult, + ): CompareAddressResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ComparisonResult result */ 1: + message.result = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CompareAddressResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ComparisonResult result = 1; */ + if (message.result !== 0) + writer.tag(1, WireType.Varint).int32(message.result); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CompareAddressResult + */ +export const CompareAddressResult = new CompareAddressResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ComparePubKeyRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.ComparePubKeyRequest', [ + { no: 1, name: 'left', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'right', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): ComparePubKeyRequest { + const message = { left: '', right: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ComparePubKeyRequest, + ): ComparePubKeyRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string left */ 1: + message.left = reader.string(); + break; + case /* string right */ 2: + message.right = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ComparePubKeyRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string left = 1; */ + if (message.left !== '') + writer.tag(1, WireType.LengthDelimited).string(message.left); + /* string right = 2; */ + if (message.right !== '') + writer.tag(2, WireType.LengthDelimited).string(message.right); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.ComparePubKeyRequest + */ +export const ComparePubKeyRequest = new ComparePubKeyRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ComparePubKeyResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.ComparePubKeyResult', [ + { + no: 1, + name: 'result', + kind: 'enum', + T: () => [ + 'massa.model.v1.ComparisonResult', + ComparisonResult, + 'COMPARISON_RESULT_', + ], + }, + ]); + } + create(value?: PartialMessage): ComparePubKeyResult { + const message = { result: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ComparePubKeyResult, + ): ComparePubKeyResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ComparisonResult result */ 1: + message.result = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ComparePubKeyResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ComparisonResult result = 1; */ + if (message.result !== 0) + writer.tag(1, WireType.Varint).int32(message.result); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.ComparePubKeyResult + */ +export const ComparePubKeyResult = new ComparePubKeyResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class VerifySigRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.VerifySigRequest', [ + { no: 1, name: 'sig', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'message', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 3, name: 'pub_key', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): VerifySigRequest { + const message = { sig: '', message: new Uint8Array(0), pubKey: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: VerifySigRequest, + ): VerifySigRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string sig */ 1: + message.sig = reader.string(); + break; + case /* bytes message */ 2: + message.message = reader.bytes(); + break; + case /* string pub_key */ 3: + message.pubKey = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: VerifySigRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string sig = 1; */ + if (message.sig !== '') + writer.tag(1, WireType.LengthDelimited).string(message.sig); + /* bytes message = 2; */ + if (message.message.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.message); + /* string pub_key = 3; */ + if (message.pubKey !== '') + writer.tag(3, WireType.LengthDelimited).string(message.pubKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.VerifySigRequest + */ +export const VerifySigRequest = new VerifySigRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class VerifySigResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.VerifySigResult', [ + { no: 1, name: 'is_verified', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): VerifySigResult { + const message = { isVerified: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: VerifySigResult, + ): VerifySigResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool is_verified */ 1: + message.isVerified = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: VerifySigResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool is_verified = 1; */ + if (message.isVerified !== false) + writer.tag(1, WireType.Varint).bool(message.isVerified); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.VerifySigResult + */ +export const VerifySigResult = new VerifySigResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CompareNativeAmountRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CompareNativeAmountRequest', [ + { no: 1, name: 'left', kind: 'message', T: () => NativeAmount }, + { no: 2, name: 'right', kind: 'message', T: () => NativeAmount }, + ]); + } + create( + value?: PartialMessage, + ): CompareNativeAmountRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CompareNativeAmountRequest, + ): CompareNativeAmountRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount left */ 1: + message.left = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.left, + ); + break; + case /* massa.model.v1.NativeAmount right */ 2: + message.right = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.right, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CompareNativeAmountRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount left = 1; */ + if (message.left) + NativeAmount.internalBinaryWrite( + message.left, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount right = 2; */ + if (message.right) + NativeAmount.internalBinaryWrite( + message.right, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CompareNativeAmountRequest + */ +export const CompareNativeAmountRequest = new CompareNativeAmountRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CompareNativeAmountResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CompareNativeAmountResult', [ + { + no: 1, + name: 'result', + kind: 'enum', + T: () => [ + 'massa.model.v1.ComparisonResult', + ComparisonResult, + 'COMPARISON_RESULT_', + ], + }, + ]); + } + create( + value?: PartialMessage, + ): CompareNativeAmountResult { + const message = { result: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CompareNativeAmountResult, + ): CompareNativeAmountResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ComparisonResult result */ 1: + message.result = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CompareNativeAmountResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ComparisonResult result = 1; */ + if (message.result !== 0) + writer.tag(1, WireType.Varint).int32(message.result); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CompareNativeAmountResult + */ +export const CompareNativeAmountResult = new CompareNativeAmountResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Keccak256Request$Type extends MessageType { + constructor() { + super('massa.abi.v1.Keccak256Request', [ + { no: 1, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): Keccak256Request { + const message = { data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Keccak256Request, + ): Keccak256Request { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes data */ 1: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Keccak256Request, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes data = 1; */ + if (message.data.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.Keccak256Request + */ +export const Keccak256Request = new Keccak256Request$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Keccak256Result$Type extends MessageType { + constructor() { + super('massa.abi.v1.Keccak256Result', [ + { no: 1, name: 'hash', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): Keccak256Result { + const message = { hash: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Keccak256Result, + ): Keccak256Result { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes hash */ 1: + message.hash = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Keccak256Result, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes hash = 1; */ + if (message.hash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.hash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.Keccak256Result + */ +export const Keccak256Result = new Keccak256Result$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EvmVerifySigRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.EvmVerifySigRequest', [ + { no: 1, name: 'sig', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'message', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 3, name: 'pub_key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): EvmVerifySigRequest { + const message = { + sig: new Uint8Array(0), + message: new Uint8Array(0), + pubKey: new Uint8Array(0), + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EvmVerifySigRequest, + ): EvmVerifySigRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes sig */ 1: + message.sig = reader.bytes(); + break; + case /* bytes message */ 2: + message.message = reader.bytes(); + break; + case /* bytes pub_key */ 3: + message.pubKey = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EvmVerifySigRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes sig = 1; */ + if (message.sig.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.sig); + /* bytes message = 2; */ + if (message.message.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.message); + /* bytes pub_key = 3; */ + if (message.pubKey.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.pubKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.EvmVerifySigRequest + */ +export const EvmVerifySigRequest = new EvmVerifySigRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EvmVerifySigResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.EvmVerifySigResult', [ + { no: 1, name: 'is_verified', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): EvmVerifySigResult { + const message = { isVerified: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EvmVerifySigResult, + ): EvmVerifySigResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool is_verified */ 1: + message.isVerified = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EvmVerifySigResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool is_verified = 1; */ + if (message.isVerified !== false) + writer.tag(1, WireType.Varint).bool(message.isVerified); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.EvmVerifySigResult + */ +export const EvmVerifySigResult = new EvmVerifySigResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EvmGetAddressFromPubkeyRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.EvmGetAddressFromPubkeyRequest', [ + { no: 1, name: 'pub_key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): EvmGetAddressFromPubkeyRequest { + const message = { pubKey: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EvmGetAddressFromPubkeyRequest, + ): EvmGetAddressFromPubkeyRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes pub_key */ 1: + message.pubKey = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EvmGetAddressFromPubkeyRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes pub_key = 1; */ + if (message.pubKey.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.pubKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.EvmGetAddressFromPubkeyRequest + */ +export const EvmGetAddressFromPubkeyRequest = + new EvmGetAddressFromPubkeyRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EvmGetAddressFromPubkeyResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.EvmGetAddressFromPubkeyResult', [ + { no: 1, name: 'address', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): EvmGetAddressFromPubkeyResult { + const message = { address: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EvmGetAddressFromPubkeyResult, + ): EvmGetAddressFromPubkeyResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes address */ 1: + message.address = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EvmGetAddressFromPubkeyResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes address = 1; */ + if (message.address.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.EvmGetAddressFromPubkeyResult + */ +export const EvmGetAddressFromPubkeyResult = + new EvmGetAddressFromPubkeyResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EvmGetPubkeyFromSignatureRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.EvmGetPubkeyFromSignatureRequest', [ + { no: 1, name: 'hash', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'sig', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): EvmGetPubkeyFromSignatureRequest { + const message = { hash: new Uint8Array(0), sig: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EvmGetPubkeyFromSignatureRequest, + ): EvmGetPubkeyFromSignatureRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes hash */ 1: + message.hash = reader.bytes(); + break; + case /* bytes sig */ 2: + message.sig = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EvmGetPubkeyFromSignatureRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes hash = 1; */ + if (message.hash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.hash); + /* bytes sig = 2; */ + if (message.sig.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.sig); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.EvmGetPubkeyFromSignatureRequest + */ +export const EvmGetPubkeyFromSignatureRequest = + new EvmGetPubkeyFromSignatureRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EvmGetPubkeyFromSignatureResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.EvmGetPubkeyFromSignatureResult', [ + { no: 1, name: 'pub_key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): EvmGetPubkeyFromSignatureResult { + const message = { pubKey: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EvmGetPubkeyFromSignatureResult, + ): EvmGetPubkeyFromSignatureResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes pub_key */ 1: + message.pubKey = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EvmGetPubkeyFromSignatureResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes pub_key = 1; */ + if (message.pubKey.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.pubKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.EvmGetPubkeyFromSignatureResult + */ +export const EvmGetPubkeyFromSignatureResult = + new EvmGetPubkeyFromSignatureResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class IsAddressEoaRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.IsAddressEoaRequest', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): IsAddressEoaRequest { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: IsAddressEoaRequest, + ): IsAddressEoaRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: IsAddressEoaRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.IsAddressEoaRequest + */ +export const IsAddressEoaRequest = new IsAddressEoaRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class IsAddressEoaResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.IsAddressEoaResult', [ + { no: 1, name: 'is_eoa', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): IsAddressEoaResult { + const message = { isEoa: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: IsAddressEoaResult, + ): IsAddressEoaResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool is_eoa */ 1: + message.isEoa = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: IsAddressEoaResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool is_eoa = 1; */ + if (message.isEoa !== false) + writer.tag(1, WireType.Varint).bool(message.isEoa); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.IsAddressEoaResult + */ +export const IsAddressEoaResult = new IsAddressEoaResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HashBlake3Request$Type extends MessageType { + constructor() { + super('massa.abi.v1.HashBlake3Request', [ + { no: 1, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): HashBlake3Request { + const message = { data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: HashBlake3Request, + ): HashBlake3Request { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes data */ 1: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: HashBlake3Request, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes data = 1; */ + if (message.data.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.HashBlake3Request + */ +export const HashBlake3Request = new HashBlake3Request$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HashBlake3Result$Type extends MessageType { + constructor() { + super('massa.abi.v1.HashBlake3Result', [ + { no: 1, name: 'hash', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): HashBlake3Result { + const message = { hash: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: HashBlake3Result, + ): HashBlake3Result { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes hash */ 1: + message.hash = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: HashBlake3Result, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes hash = 1; */ + if (message.hash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.hash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.HashBlake3Result + */ +export const HashBlake3Result = new HashBlake3Result$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetDsKeysRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetDsKeysRequest', [ + { no: 1, name: 'prefix', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): GetDsKeysRequest { + const message = { prefix: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetDsKeysRequest, + ): GetDsKeysRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes prefix */ 1: + message.prefix = reader.bytes(); + break; + case /* optional google.protobuf.StringValue address */ 2: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetDsKeysRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes prefix = 1; */ + if (message.prefix.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.prefix); + /* optional google.protobuf.StringValue address = 2; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetDsKeysRequest + */ +export const GetDsKeysRequest = new GetDsKeysRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetDsKeysResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetDsKeysResult', [ + { + no: 1, + name: 'keys', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): GetDsKeysResult { + const message = { keys: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetDsKeysResult, + ): GetDsKeysResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated bytes keys */ 1: + message.keys.push(reader.bytes()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetDsKeysResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated bytes keys = 1; */ + for (let i = 0; i < message.keys.length; i++) + writer.tag(1, WireType.LengthDelimited).bytes(message.keys[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetDsKeysResult + */ +export const GetDsKeysResult = new GetDsKeysResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetDsValueRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.SetDsValueRequest', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'value', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 3, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): SetDsValueRequest { + const message = { key: new Uint8Array(0), value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetDsValueRequest, + ): SetDsValueRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + case /* bytes value */ 2: + message.value = reader.bytes(); + break; + case /* optional google.protobuf.StringValue address */ 3: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetDsValueRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + /* bytes value = 2; */ + if (message.value.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.value); + /* optional google.protobuf.StringValue address = 3; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SetDsValueRequest + */ +export const SetDsValueRequest = new SetDsValueRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetDsValueResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.SetDsValueResult', []); + } + create(value?: PartialMessage): SetDsValueResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetDsValueResult, + ): SetDsValueResult { + return target ?? this.create(); + } + internalBinaryWrite( + message: SetDsValueResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SetDsValueResult + */ +export const SetDsValueResult = new SetDsValueResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AppendDsValueRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.AppendDsValueRequest', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'value', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 3, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): AppendDsValueRequest { + const message = { key: new Uint8Array(0), value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AppendDsValueRequest, + ): AppendDsValueRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + case /* bytes value */ 2: + message.value = reader.bytes(); + break; + case /* optional google.protobuf.StringValue address */ 3: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AppendDsValueRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + /* bytes value = 2; */ + if (message.value.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.value); + /* optional google.protobuf.StringValue address = 3; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.AppendDsValueRequest + */ +export const AppendDsValueRequest = new AppendDsValueRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AppendDsValueResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.AppendDsValueResult', []); + } + create(value?: PartialMessage): AppendDsValueResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AppendDsValueResult, + ): AppendDsValueResult { + return target ?? this.create(); + } + internalBinaryWrite( + message: AppendDsValueResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.AppendDsValueResult + */ +export const AppendDsValueResult = new AppendDsValueResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetDsValueRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetDsValueRequest', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): GetDsValueRequest { + const message = { key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetDsValueRequest, + ): GetDsValueRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + case /* optional google.protobuf.StringValue address */ 2: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetDsValueRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + /* optional google.protobuf.StringValue address = 2; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetDsValueRequest + */ +export const GetDsValueRequest = new GetDsValueRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetDsValueResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetDsValueResult', [ + { no: 1, name: 'value', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): GetDsValueResult { + const message = { value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetDsValueResult, + ): GetDsValueResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes value */ 1: + message.value = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetDsValueResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes value = 1; */ + if (message.value.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetDsValueResult + */ +export const GetDsValueResult = new GetDsValueResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeleteDsEntryRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.DeleteDsEntryRequest', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): DeleteDsEntryRequest { + const message = { key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DeleteDsEntryRequest, + ): DeleteDsEntryRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + case /* optional google.protobuf.StringValue address */ 2: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DeleteDsEntryRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + /* optional google.protobuf.StringValue address = 2; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.DeleteDsEntryRequest + */ +export const DeleteDsEntryRequest = new DeleteDsEntryRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeleteDsEntryResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.DeleteDsEntryResult', []); + } + create(value?: PartialMessage): DeleteDsEntryResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DeleteDsEntryResult, + ): DeleteDsEntryResult { + return target ?? this.create(); + } + internalBinaryWrite( + message: DeleteDsEntryResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.DeleteDsEntryResult + */ +export const DeleteDsEntryResult = new DeleteDsEntryResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DsEntryExistsRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.DsEntryExistsRequest', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): DsEntryExistsRequest { + const message = { key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DsEntryExistsRequest, + ): DsEntryExistsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + case /* optional google.protobuf.StringValue address */ 2: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DsEntryExistsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + /* optional google.protobuf.StringValue address = 2; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.DsEntryExistsRequest + */ +export const DsEntryExistsRequest = new DsEntryExistsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DsEntryExistsResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.DsEntryExistsResult', [ + { no: 1, name: 'has_data', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): DsEntryExistsResult { + const message = { hasData: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DsEntryExistsResult, + ): DsEntryExistsResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool has_data */ 1: + message.hasData = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DsEntryExistsResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool has_data = 1; */ + if (message.hasData !== false) + writer.tag(1, WireType.Varint).bool(message.hasData); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.DsEntryExistsResult + */ +export const DsEntryExistsResult = new DsEntryExistsResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOwnedAddressesRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOwnedAddressesRequest', []); + } + create( + value?: PartialMessage, + ): GetOwnedAddressesRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOwnedAddressesRequest, + ): GetOwnedAddressesRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetOwnedAddressesRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOwnedAddressesRequest + */ +export const GetOwnedAddressesRequest = new GetOwnedAddressesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOwnedAddressesResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOwnedAddressesResult', [ + { + no: 1, + name: 'addresses', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetOwnedAddressesResult { + const message = { addresses: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOwnedAddressesResult, + ): GetOwnedAddressesResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string addresses */ 1: + message.addresses.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOwnedAddressesResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string addresses = 1; */ + for (let i = 0; i < message.addresses.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.addresses[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOwnedAddressesResult + */ +export const GetOwnedAddressesResult = new GetOwnedAddressesResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetCallStackRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetCallStackRequest', []); + } + create(value?: PartialMessage): GetCallStackRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetCallStackRequest, + ): GetCallStackRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetCallStackRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetCallStackRequest + */ +export const GetCallStackRequest = new GetCallStackRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetCallStackResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetCallStackResult', [ + { + no: 1, + name: 'calls', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): GetCallStackResult { + const message = { calls: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetCallStackResult, + ): GetCallStackResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string calls */ 1: + message.calls.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetCallStackResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string calls = 1; */ + for (let i = 0; i < message.calls.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.calls[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetCallStackResult + */ +export const GetCallStackResult = new GetCallStackResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressFromPubKeyRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.AddressFromPubKeyRequest', [ + { no: 1, name: 'pub_key', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressFromPubKeyRequest { + const message = { pubKey: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressFromPubKeyRequest, + ): AddressFromPubKeyRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pub_key */ 1: + message.pubKey = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressFromPubKeyRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string pub_key = 1; */ + if (message.pubKey !== '') + writer.tag(1, WireType.LengthDelimited).string(message.pubKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.AddressFromPubKeyRequest + */ +export const AddressFromPubKeyRequest = new AddressFromPubKeyRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressFromPubKeyResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.AddressFromPubKeyResult', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressFromPubKeyResult { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressFromPubKeyResult, + ): AddressFromPubKeyResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressFromPubKeyResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.AddressFromPubKeyResult + */ +export const AddressFromPubKeyResult = new AddressFromPubKeyResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UnsafeRandomRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.UnsafeRandomRequest', [ + { + no: 2, + name: 'num_bytes', + kind: 'scalar', + T: 13 /* ScalarType.UINT32*/, + }, + ]); + } + create(value?: PartialMessage): UnsafeRandomRequest { + const message = { numBytes: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UnsafeRandomRequest, + ): UnsafeRandomRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 num_bytes */ 2: + message.numBytes = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UnsafeRandomRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint32 num_bytes = 2; */ + if (message.numBytes !== 0) + writer.tag(2, WireType.Varint).uint32(message.numBytes); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.UnsafeRandomRequest + */ +export const UnsafeRandomRequest = new UnsafeRandomRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UnsafeRandomResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.UnsafeRandomResult', [ + { + no: 1, + name: 'random_bytes', + kind: 'scalar', + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): UnsafeRandomResult { + const message = { randomBytes: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UnsafeRandomResult, + ): UnsafeRandomResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes random_bytes */ 1: + message.randomBytes = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UnsafeRandomResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes random_bytes = 1; */ + if (message.randomBytes.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.randomBytes); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.UnsafeRandomResult + */ +export const UnsafeRandomResult = new UnsafeRandomResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendAsyncMessageFilter$Type extends MessageType { + constructor() { + super('massa.abi.v1.SendAsyncMessageFilter', [ + { + no: 1, + name: 'target_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 2, name: 'target_key', kind: 'message', T: () => BytesValue }, + ]); + } + create( + value?: PartialMessage, + ): SendAsyncMessageFilter { + const message = { targetAddress: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendAsyncMessageFilter, + ): SendAsyncMessageFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string target_address */ 1: + message.targetAddress = reader.string(); + break; + case /* google.protobuf.BytesValue target_key */ 2: + message.targetKey = BytesValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.targetKey, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendAsyncMessageFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string target_address = 1; */ + if (message.targetAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.targetAddress); + /* google.protobuf.BytesValue target_key = 2; */ + if (message.targetKey) + BytesValue.internalBinaryWrite( + message.targetKey, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SendAsyncMessageFilter + */ +export const SendAsyncMessageFilter = new SendAsyncMessageFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendAsyncMessageRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.SendAsyncMessageRequest', [ + { + no: 1, + name: 'target_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'target_handler', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 3, name: 'validity_start', kind: 'message', T: () => Slot }, + { no: 4, name: 'validity_end', kind: 'message', T: () => Slot }, + { + no: 5, + name: 'execution_gas', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 6, + name: 'raw_fee', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 7, + name: 'raw_coins', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 8, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { + no: 9, + name: 'filter', + kind: 'message', + T: () => SendAsyncMessageFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): SendAsyncMessageRequest { + const message = { + targetAddress: '', + targetHandler: '', + executionGas: 0n, + rawFee: 0n, + rawCoins: 0n, + data: new Uint8Array(0), + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendAsyncMessageRequest, + ): SendAsyncMessageRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string target_address */ 1: + message.targetAddress = reader.string(); + break; + case /* string target_handler */ 2: + message.targetHandler = reader.string(); + break; + case /* massa.model.v1.Slot validity_start */ 3: + message.validityStart = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.validityStart, + ); + break; + case /* massa.model.v1.Slot validity_end */ 4: + message.validityEnd = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.validityEnd, + ); + break; + case /* uint64 execution_gas */ 5: + message.executionGas = reader.uint64().toBigInt(); + break; + case /* uint64 raw_fee */ 6: + message.rawFee = reader.uint64().toBigInt(); + break; + case /* uint64 raw_coins */ 7: + message.rawCoins = reader.uint64().toBigInt(); + break; + case /* bytes data */ 8: + message.data = reader.bytes(); + break; + case /* massa.abi.v1.SendAsyncMessageFilter filter */ 9: + message.filter = SendAsyncMessageFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + message.filter, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendAsyncMessageRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string target_address = 1; */ + if (message.targetAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.targetAddress); + /* string target_handler = 2; */ + if (message.targetHandler !== '') + writer.tag(2, WireType.LengthDelimited).string(message.targetHandler); + /* massa.model.v1.Slot validity_start = 3; */ + if (message.validityStart) + Slot.internalBinaryWrite( + message.validityStart, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot validity_end = 4; */ + if (message.validityEnd) + Slot.internalBinaryWrite( + message.validityEnd, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 execution_gas = 5; */ + if (message.executionGas !== 0n) + writer.tag(5, WireType.Varint).uint64(message.executionGas); + /* uint64 raw_fee = 6; */ + if (message.rawFee !== 0n) + writer.tag(6, WireType.Varint).uint64(message.rawFee); + /* uint64 raw_coins = 7; */ + if (message.rawCoins !== 0n) + writer.tag(7, WireType.Varint).uint64(message.rawCoins); + /* bytes data = 8; */ + if (message.data.length) + writer.tag(8, WireType.LengthDelimited).bytes(message.data); + /* massa.abi.v1.SendAsyncMessageFilter filter = 9; */ + if (message.filter) + SendAsyncMessageFilter.internalBinaryWrite( + message.filter, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SendAsyncMessageRequest + */ +export const SendAsyncMessageRequest = new SendAsyncMessageRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendAsyncMessageResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.SendAsyncMessageResult', []); + } + create( + value?: PartialMessage, + ): SendAsyncMessageResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendAsyncMessageResult, + ): SendAsyncMessageResult { + return target ?? this.create(); + } + internalBinaryWrite( + message: SendAsyncMessageResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SendAsyncMessageResult + */ +export const SendAsyncMessageResult = new SendAsyncMessageResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOriginOperationIdRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOriginOperationIdRequest', []); + } + create( + value?: PartialMessage, + ): GetOriginOperationIdRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOriginOperationIdRequest, + ): GetOriginOperationIdRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetOriginOperationIdRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOriginOperationIdRequest + */ +export const GetOriginOperationIdRequest = + new GetOriginOperationIdRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOriginOperationIdResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOriginOperationIdResult', [ + { no: 1, name: 'operation_id', kind: 'message', T: () => StringValue }, + ]); + } + create( + value?: PartialMessage, + ): GetOriginOperationIdResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOriginOperationIdResult, + ): GetOriginOperationIdResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.StringValue operation_id */ 1: + message.operationId = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.operationId, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOriginOperationIdResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional google.protobuf.StringValue operation_id = 1; */ + if (message.operationId) + StringValue.internalBinaryWrite( + message.operationId, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOriginOperationIdResult + */ +export const GetOriginOperationIdResult = new GetOriginOperationIdResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetNativeTimeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetNativeTimeRequest', []); + } + create(value?: PartialMessage): GetNativeTimeRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetNativeTimeRequest, + ): GetNativeTimeRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetNativeTimeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetNativeTimeRequest + */ +export const GetNativeTimeRequest = new GetNativeTimeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetNativeTimeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetNativeTimeResult', [ + { no: 1, name: 'time', kind: 'message', T: () => NativeTime }, + ]); + } + create(value?: PartialMessage): GetNativeTimeResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetNativeTimeResult, + ): GetNativeTimeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime time */ 1: + message.time = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.time, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetNativeTimeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime time = 1; */ + if (message.time) + NativeTime.internalBinaryWrite( + message.time, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetNativeTimeResult + */ +export const GetNativeTimeResult = new GetNativeTimeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetCurrentSlotRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetCurrentSlotRequest', []); + } + create(value?: PartialMessage): GetCurrentSlotRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetCurrentSlotRequest, + ): GetCurrentSlotRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetCurrentSlotRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetCurrentSlotRequest + */ +export const GetCurrentSlotRequest = new GetCurrentSlotRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetCurrentSlotResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetCurrentSlotResult', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + ]); + } + create(value?: PartialMessage): GetCurrentSlotResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetCurrentSlotResult, + ): GetCurrentSlotResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetCurrentSlotResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetCurrentSlotResult + */ +export const GetCurrentSlotResult = new GetCurrentSlotResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetBytecodeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.SetBytecodeRequest', [ + { no: 1, name: 'bytecode', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): SetBytecodeRequest { + const message = { bytecode: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetBytecodeRequest, + ): SetBytecodeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes bytecode */ 1: + message.bytecode = reader.bytes(); + break; + case /* optional google.protobuf.StringValue address */ 2: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetBytecodeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes bytecode = 1; */ + if (message.bytecode.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.bytecode); + /* optional google.protobuf.StringValue address = 2; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SetBytecodeRequest + */ +export const SetBytecodeRequest = new SetBytecodeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetBytecodeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.SetBytecodeResult', []); + } + create(value?: PartialMessage): SetBytecodeResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetBytecodeResult, + ): SetBytecodeResult { + return target ?? this.create(); + } + internalBinaryWrite( + message: SetBytecodeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.SetBytecodeResult + */ +export const SetBytecodeResult = new SetBytecodeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBytecodeRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetBytecodeRequest', [ + { no: 1, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): GetBytecodeRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBytecodeRequest, + ): GetBytecodeRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.StringValue address */ 1: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBytecodeRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional google.protobuf.StringValue address = 1; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetBytecodeRequest + */ +export const GetBytecodeRequest = new GetBytecodeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBytecodeResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetBytecodeResult', [ + { no: 1, name: 'bytecode', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): GetBytecodeResult { + const message = { bytecode: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBytecodeResult, + ): GetBytecodeResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes bytecode */ 1: + message.bytecode = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBytecodeResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes bytecode = 1; */ + if (message.bytecode.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.bytecode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetBytecodeResult + */ +export const GetBytecodeResult = new GetBytecodeResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CallerHasWriteAccessRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.CallerHasWriteAccessRequest', []); + } + create( + value?: PartialMessage, + ): CallerHasWriteAccessRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CallerHasWriteAccessRequest, + ): CallerHasWriteAccessRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: CallerHasWriteAccessRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CallerHasWriteAccessRequest + */ +export const CallerHasWriteAccessRequest = + new CallerHasWriteAccessRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CallerHasWriteAccessResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.CallerHasWriteAccessResult', [ + { + no: 1, + name: 'has_write_access', + kind: 'scalar', + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create( + value?: PartialMessage, + ): CallerHasWriteAccessResult { + const message = { hasWriteAccess: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CallerHasWriteAccessResult, + ): CallerHasWriteAccessResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool has_write_access */ 1: + message.hasWriteAccess = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CallerHasWriteAccessResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool has_write_access = 1; */ + if (message.hasWriteAccess !== false) + writer.tag(1, WireType.Varint).bool(message.hasWriteAccess); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.CallerHasWriteAccessResult + */ +export const CallerHasWriteAccessResult = new CallerHasWriteAccessResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HashSha256Request$Type extends MessageType { + constructor() { + super('massa.abi.v1.HashSha256Request', [ + { no: 1, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): HashSha256Request { + const message = { data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: HashSha256Request, + ): HashSha256Request { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes data */ 1: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: HashSha256Request, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes data = 1; */ + if (message.data.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.HashSha256Request + */ +export const HashSha256Request = new HashSha256Request$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HashSha256Result$Type extends MessageType { + constructor() { + super('massa.abi.v1.HashSha256Result', [ + { no: 1, name: 'hash', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): HashSha256Result { + const message = { hash: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: HashSha256Result, + ): HashSha256Result { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes hash */ 1: + message.hash = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: HashSha256Result, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes hash = 1; */ + if (message.hash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.hash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.HashSha256Result + */ +export const HashSha256Result = new HashSha256Result$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOpDataRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOpDataRequest', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): GetOpDataRequest { + const message = { key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOpDataRequest, + ): GetOpDataRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOpDataRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOpDataRequest + */ +export const GetOpDataRequest = new GetOpDataRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOpDataResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOpDataResult', [ + { no: 1, name: 'value', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): GetOpDataResult { + const message = { value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOpDataResult, + ): GetOpDataResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes value */ 1: + message.value = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOpDataResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes value = 1; */ + if (message.value.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOpDataResult + */ +export const GetOpDataResult = new GetOpDataResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OpEntryExistsRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.OpEntryExistsRequest', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): OpEntryExistsRequest { + const message = { key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OpEntryExistsRequest, + ): OpEntryExistsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OpEntryExistsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.OpEntryExistsRequest + */ +export const OpEntryExistsRequest = new OpEntryExistsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OpEntryExistsResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.OpEntryExistsResult', [ + { no: 1, name: 'has_key', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): OpEntryExistsResult { + const message = { hasKey: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OpEntryExistsResult, + ): OpEntryExistsResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool has_key */ 1: + message.hasKey = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OpEntryExistsResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool has_key = 1; */ + if (message.hasKey !== false) + writer.tag(1, WireType.Varint).bool(message.hasKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.OpEntryExistsResult + */ +export const OpEntryExistsResult = new OpEntryExistsResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOpKeysRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOpKeysRequest', [ + { no: 1, name: 'prefix', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): GetOpKeysRequest { + const message = { prefix: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOpKeysRequest, + ): GetOpKeysRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes prefix */ 1: + message.prefix = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOpKeysRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes prefix = 1; */ + if (message.prefix.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.prefix); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOpKeysRequest + */ +export const GetOpKeysRequest = new GetOpKeysRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOpKeysResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetOpKeysResult', [ + { + no: 1, + name: 'keys', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): GetOpKeysResult { + const message = { keys: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOpKeysResult, + ): GetOpKeysResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated bytes keys */ 1: + message.keys.push(reader.bytes()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOpKeysResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated bytes keys = 1; */ + for (let i = 0; i < message.keys.length; i++) + writer.tag(1, WireType.LengthDelimited).bytes(message.keys[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetOpKeysResult + */ +export const GetOpKeysResult = new GetOpKeysResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetRemainingGasRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetRemainingGasRequest', []); + } + create( + value?: PartialMessage, + ): GetRemainingGasRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetRemainingGasRequest, + ): GetRemainingGasRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetRemainingGasRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetRemainingGasRequest + */ +export const GetRemainingGasRequest = new GetRemainingGasRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetRemainingGasResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetRemainingGasResult', [ + { + no: 1, + name: 'remaining_gas', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): GetRemainingGasResult { + const message = { remainingGas: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetRemainingGasResult, + ): GetRemainingGasResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 remaining_gas */ 1: + message.remainingGas = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetRemainingGasResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 remaining_gas = 1; */ + if (message.remainingGas !== 0n) + writer.tag(1, WireType.Varint).uint64(message.remainingGas); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetRemainingGasResult + */ +export const GetRemainingGasResult = new GetRemainingGasResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBalanceRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetBalanceRequest', [ + { no: 1, name: 'address', kind: 'message', T: () => StringValue }, + ]); + } + create(value?: PartialMessage): GetBalanceRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBalanceRequest, + ): GetBalanceRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.StringValue address */ 1: + message.address = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.address, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBalanceRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* optional google.protobuf.StringValue address = 1; */ + if (message.address) + StringValue.internalBinaryWrite( + message.address, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetBalanceRequest + */ +export const GetBalanceRequest = new GetBalanceRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBalanceResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetBalanceResult', [ + { no: 1, name: 'balance', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): GetBalanceResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBalanceResult, + ): GetBalanceResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount balance */ 1: + message.balance = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.balance, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBalanceResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount balance = 1; */ + if (message.balance) + NativeAmount.internalBinaryWrite( + message.balance, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetBalanceResult + */ +export const GetBalanceResult = new GetBalanceResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetCallCoinsRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetCallCoinsRequest', []); + } + create(value?: PartialMessage): GetCallCoinsRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetCallCoinsRequest, + ): GetCallCoinsRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetCallCoinsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetCallCoinsRequest + */ +export const GetCallCoinsRequest = new GetCallCoinsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetCallCoinsResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetCallCoinsResult', [ + { no: 1, name: 'coins', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): GetCallCoinsResult { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetCallCoinsResult, + ): GetCallCoinsResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount coins */ 1: + message.coins = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.coins, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetCallCoinsResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount coins = 1; */ + if (message.coins) + NativeAmount.internalBinaryWrite( + message.coins, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetCallCoinsResult + */ +export const GetCallCoinsResult = new GetCallCoinsResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetAddressVersionRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetAddressVersionRequest', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): GetAddressVersionRequest { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetAddressVersionRequest, + ): GetAddressVersionRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetAddressVersionRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetAddressVersionRequest + */ +export const GetAddressVersionRequest = new GetAddressVersionRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetAddressVersionResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetAddressVersionResult', [ + { + no: 1, + name: 'version', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetAddressVersionResult { + const message = { version: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetAddressVersionResult, + ): GetAddressVersionResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 version */ 1: + message.version = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetAddressVersionResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 version = 1; */ + if (message.version !== 0n) + writer.tag(1, WireType.Varint).uint64(message.version); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetAddressVersionResult + */ +export const GetAddressVersionResult = new GetAddressVersionResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetAddressCategoryRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetAddressCategoryRequest', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): GetAddressCategoryRequest { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetAddressCategoryRequest, + ): GetAddressCategoryRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetAddressCategoryRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetAddressCategoryRequest + */ +export const GetAddressCategoryRequest = new GetAddressCategoryRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetAddressCategoryResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetAddressCategoryResult', [ + { + no: 1, + name: 'category', + kind: 'enum', + T: () => [ + 'massa.model.v1.AddressCategory', + AddressCategory, + 'ADDRESS_CATEGORY_', + ], + }, + ]); + } + create( + value?: PartialMessage, + ): GetAddressCategoryResult { + const message = { category: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetAddressCategoryResult, + ): GetAddressCategoryResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.AddressCategory category */ 1: + message.category = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetAddressCategoryResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.AddressCategory category = 1; */ + if (message.category !== 0) + writer.tag(1, WireType.Varint).int32(message.category); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetAddressCategoryResult + */ +export const GetAddressCategoryResult = new GetAddressCategoryResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetPubKeyVersionRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetPubKeyVersionRequest', [ + { no: 1, name: 'pub_key', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): GetPubKeyVersionRequest { + const message = { pubKey: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetPubKeyVersionRequest, + ): GetPubKeyVersionRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pub_key */ 1: + message.pubKey = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetPubKeyVersionRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string pub_key = 1; */ + if (message.pubKey !== '') + writer.tag(1, WireType.LengthDelimited).string(message.pubKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetPubKeyVersionRequest + */ +export const GetPubKeyVersionRequest = new GetPubKeyVersionRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetPubKeyVersionResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetPubKeyVersionResult', [ + { + no: 1, + name: 'version', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetPubKeyVersionResult { + const message = { version: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetPubKeyVersionResult, + ): GetPubKeyVersionResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 version */ 1: + message.version = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetPubKeyVersionResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 version = 1; */ + if (message.version !== 0n) + writer.tag(1, WireType.Varint).uint64(message.version); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetPubKeyVersionResult + */ +export const GetPubKeyVersionResult = new GetPubKeyVersionResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetSignatureVersionRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetSignatureVersionRequest', [ + { no: 1, name: 'signature', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): GetSignatureVersionRequest { + const message = { signature: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetSignatureVersionRequest, + ): GetSignatureVersionRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string signature */ 1: + message.signature = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetSignatureVersionRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string signature = 1; */ + if (message.signature !== '') + writer.tag(1, WireType.LengthDelimited).string(message.signature); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetSignatureVersionRequest + */ +export const GetSignatureVersionRequest = new GetSignatureVersionRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetSignatureVersionResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.GetSignatureVersionResult', [ + { + no: 1, + name: 'version', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetSignatureVersionResult { + const message = { version: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetSignatureVersionResult, + ): GetSignatureVersionResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 version */ 1: + message.version = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetSignatureVersionResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 version = 1; */ + if (message.version !== 0n) + writer.tag(1, WireType.Varint).uint64(message.version); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.GetSignatureVersionResult + */ +export const GetSignatureVersionResult = new GetSignatureVersionResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BytesToBase58CheckRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.BytesToBase58CheckRequest', [ + { no: 1, name: 'bytes', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): BytesToBase58CheckRequest { + const message = { bytes: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BytesToBase58CheckRequest, + ): BytesToBase58CheckRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes bytes */ 1: + message.bytes = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BytesToBase58CheckRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes bytes = 1; */ + if (message.bytes.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.bytes); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.BytesToBase58CheckRequest + */ +export const BytesToBase58CheckRequest = new BytesToBase58CheckRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BytesToBase58CheckResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.BytesToBase58CheckResult', [ + { + no: 1, + name: 'base58_check', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): BytesToBase58CheckResult { + const message = { base58Check: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BytesToBase58CheckResult, + ): BytesToBase58CheckResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string base58_check */ 1: + message.base58Check = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BytesToBase58CheckResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string base58_check = 1; */ + if (message.base58Check !== '') + writer.tag(1, WireType.LengthDelimited).string(message.base58Check); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.BytesToBase58CheckResult + */ +export const BytesToBase58CheckResult = new BytesToBase58CheckResult$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Base58CheckToBytesRequest$Type extends MessageType { + constructor() { + super('massa.abi.v1.Base58CheckToBytesRequest', [ + { + no: 1, + name: 'base58_check', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): Base58CheckToBytesRequest { + const message = { base58Check: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Base58CheckToBytesRequest, + ): Base58CheckToBytesRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string base58_check */ 1: + message.base58Check = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Base58CheckToBytesRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string base58_check = 1; */ + if (message.base58Check !== '') + writer.tag(1, WireType.LengthDelimited).string(message.base58Check); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.Base58CheckToBytesRequest + */ +export const Base58CheckToBytesRequest = new Base58CheckToBytesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Base58CheckToBytesResult$Type extends MessageType { + constructor() { + super('massa.abi.v1.Base58CheckToBytesResult', [ + { no: 1, name: 'bytes', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): Base58CheckToBytesResult { + const message = { bytes: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Base58CheckToBytesResult, + ): Base58CheckToBytesResult { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes bytes */ 1: + message.bytes = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Base58CheckToBytesResult, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes bytes = 1; */ + if (message.bytes.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.bytes); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.abi.v1.Base58CheckToBytesResult + */ +export const Base58CheckToBytesResult = new Base58CheckToBytesResult$Type(); diff --git a/frontend/src/proto-gen/massa/api/v1/private.client.ts b/frontend/src/proto-gen/massa/api/v1/private.client.ts new file mode 100644 index 0000000..fd1cf75 --- /dev/null +++ b/frontend/src/proto-gen/massa/api/v1/private.client.ts @@ -0,0 +1,628 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/api/v1/private.proto" (package "massa.api.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { RpcTransport } from '@protobuf-ts/runtime-rpc'; +import type { ServiceInfo } from '@protobuf-ts/runtime-rpc'; +import { PrivateService } from './private'; +import type { UnbanNodesByIpsResponse } from './private'; +import type { UnbanNodesByIpsRequest } from './private'; +import type { UnbanNodesByIdsResponse } from './private'; +import type { UnbanNodesByIdsRequest } from './private'; +import type { ShutdownGracefullyResponse } from './private'; +import type { ShutdownGracefullyRequest } from './private'; +import type { SignMessagesResponse } from './private'; +import type { SignMessagesRequest } from './private'; +import type { RemoveStakingAddressesResponse } from './private'; +import type { RemoveStakingAddressesRequest } from './private'; +import type { RemoveFromPeersWhitelistResponse } from './private'; +import type { RemoveFromPeersWhitelistRequest } from './private'; +import type { RemoveFromBootstrapWhitelistResponse } from './private'; +import type { RemoveFromBootstrapWhitelistRequest } from './private'; +import type { RemoveFromBootstrapBlacklistResponse } from './private'; +import type { RemoveFromBootstrapBlacklistRequest } from './private'; +import type { BanNodesByIpsResponse } from './private'; +import type { BanNodesByIpsRequest } from './private'; +import type { BanNodesByIdsResponse } from './private'; +import type { BanNodesByIdsRequest } from './private'; +import type { GetPeersWhitelistResponse } from './private'; +import type { GetPeersWhitelistRequest } from './private'; +import type { GetNodeStatusResponse } from './private'; +import type { GetNodeStatusRequest } from './private'; +import type { GetMipStatusResponse } from './private'; +import type { GetMipStatusRequest } from './private'; +import type { GetBootstrapWhitelistResponse } from './private'; +import type { GetBootstrapWhitelistRequest } from './private'; +import type { GetBootstrapBlacklistResponse } from './private'; +import type { GetBootstrapBlacklistRequest } from './private'; +import type { AllowEveryoneToBootstrapResponse } from './private'; +import type { AllowEveryoneToBootstrapRequest } from './private'; +import type { AddStakingSecretKeysResponse } from './private'; +import type { AddStakingSecretKeysRequest } from './private'; +import type { AddToPeersWhitelistResponse } from './private'; +import type { AddToPeersWhitelistRequest } from './private'; +import type { AddToBootstrapWhitelistResponse } from './private'; +import type { AddToBootstrapWhitelistRequest } from './private'; +import { stackIntercept } from '@protobuf-ts/runtime-rpc'; +import type { AddToBootstrapBlacklistResponse } from './private'; +import type { AddToBootstrapBlacklistRequest } from './private'; +import type { UnaryCall } from '@protobuf-ts/runtime-rpc'; +import type { RpcOptions } from '@protobuf-ts/runtime-rpc'; +/** + * Massa private gRPC service + * + * @generated from protobuf service massa.api.v1.PrivateService + */ +export interface IPrivateServiceClient { + /** + * Add IP addresses to node bootstrap blacklist + * + * @generated from protobuf rpc: AddToBootstrapBlacklist(massa.api.v1.AddToBootstrapBlacklistRequest) returns (massa.api.v1.AddToBootstrapBlacklistResponse); + */ + addToBootstrapBlacklist( + input: AddToBootstrapBlacklistRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Add IP addresses to node bootstrap whitelist + * + * @generated from protobuf rpc: AddToBootstrapWhitelist(massa.api.v1.AddToBootstrapWhitelistRequest) returns (massa.api.v1.AddToBootstrapWhitelistResponse); + */ + addToBootstrapWhitelist( + input: AddToBootstrapWhitelistRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Add IP addresses to node peers whitelist. No confirmation to expect. + * Note: If the ip was unknown it adds it to the known peers, otherwise it updates the peer type + * + * @generated from protobuf rpc: AddToPeersWhitelist(massa.api.v1.AddToPeersWhitelistRequest) returns (massa.api.v1.AddToPeersWhitelistResponse); + */ + addToPeersWhitelist( + input: AddToPeersWhitelistRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Add staking secret keys to wallet + * + * @generated from protobuf rpc: AddStakingSecretKeys(massa.api.v1.AddStakingSecretKeysRequest) returns (massa.api.v1.AddStakingSecretKeysResponse); + */ + addStakingSecretKeys( + input: AddStakingSecretKeysRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file + * + * @generated from protobuf rpc: AllowEveryoneToBootstrap(massa.api.v1.AllowEveryoneToBootstrapRequest) returns (massa.api.v1.AllowEveryoneToBootstrapResponse); + */ + allowEveryoneToBootstrap( + input: AllowEveryoneToBootstrapRequest, + options?: RpcOptions, + ): UnaryCall< + AllowEveryoneToBootstrapRequest, + AllowEveryoneToBootstrapResponse + >; + /** + * Get node bootstrap blacklist IP addresses + * + * @generated from protobuf rpc: GetBootstrapBlacklist(massa.api.v1.GetBootstrapBlacklistRequest) returns (massa.api.v1.GetBootstrapBlacklistResponse); + */ + getBootstrapBlacklist( + input: GetBootstrapBlacklistRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get node bootstrap whitelist IP addresses + * + * @generated from protobuf rpc: GetBootstrapWhitelist(massa.api.v1.GetBootstrapWhitelistRequest) returns (massa.api.v1.GetBootstrapWhitelistResponse); + */ + getBootstrapWhitelist( + input: GetBootstrapWhitelistRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get Mip status + * + * @generated from protobuf rpc: GetMipStatus(massa.api.v1.GetMipStatusRequest) returns (massa.api.v1.GetMipStatusResponse); + */ + getMipStatus( + input: GetMipStatusRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get node status + * + * @generated from protobuf rpc: GetNodeStatus(massa.api.v1.GetNodeStatusRequest) returns (massa.api.v1.GetNodeStatusResponse); + */ + getNodeStatus( + input: GetNodeStatusRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get node peers whitelist IP addresses + * + * @generated from protobuf rpc: GetPeersWhitelist(massa.api.v1.GetPeersWhitelistRequest) returns (massa.api.v1.GetPeersWhitelistResponse); + */ + getPeersWhitelist( + input: GetPeersWhitelistRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Ban multiple nodes by their individual ids + * + * @generated from protobuf rpc: BanNodesByIds(massa.api.v1.BanNodesByIdsRequest) returns (massa.api.v1.BanNodesByIdsResponse); + */ + banNodesByIds( + input: BanNodesByIdsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Ban multiple nodes by their individual IP addresses + * + * @generated from protobuf rpc: BanNodesByIps(massa.api.v1.BanNodesByIpsRequest) returns (massa.api.v1.BanNodesByIpsResponse); + */ + banNodesByIps( + input: BanNodesByIpsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Remove from bootstrap blacklist given IP addresses + * + * @generated from protobuf rpc: RemoveFromBootstrapBlacklist(massa.api.v1.RemoveFromBootstrapBlacklistRequest) returns (massa.api.v1.RemoveFromBootstrapBlacklistResponse); + */ + removeFromBootstrapBlacklist( + input: RemoveFromBootstrapBlacklistRequest, + options?: RpcOptions, + ): UnaryCall< + RemoveFromBootstrapBlacklistRequest, + RemoveFromBootstrapBlacklistResponse + >; + /** + * Remove from bootstrap whitelist given IP addresses + * + * @generated from protobuf rpc: RemoveFromBootstrapWhitelist(massa.api.v1.RemoveFromBootstrapWhitelistRequest) returns (massa.api.v1.RemoveFromBootstrapWhitelistResponse); + */ + removeFromBootstrapWhitelist( + input: RemoveFromBootstrapWhitelistRequest, + options?: RpcOptions, + ): UnaryCall< + RemoveFromBootstrapWhitelistRequest, + RemoveFromBootstrapWhitelistResponse + >; + /** + * Remove from peers whitelist given IP addresses + * + * @generated from protobuf rpc: RemoveFromPeersWhitelist(massa.api.v1.RemoveFromPeersWhitelistRequest) returns (massa.api.v1.RemoveFromPeersWhitelistResponse); + */ + removeFromPeersWhitelist( + input: RemoveFromPeersWhitelistRequest, + options?: RpcOptions, + ): UnaryCall< + RemoveFromPeersWhitelistRequest, + RemoveFromPeersWhitelistResponse + >; + /** + * Remove addresses from staking + * + * @generated from protobuf rpc: RemoveStakingAddresses(massa.api.v1.RemoveStakingAddressesRequest) returns (massa.api.v1.RemoveStakingAddressesResponse); + */ + removeStakingAddresses( + input: RemoveStakingAddressesRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Sign messages with node's key + * + * @generated from protobuf rpc: SignMessages(massa.api.v1.SignMessagesRequest) returns (massa.api.v1.SignMessagesResponse); + */ + signMessages( + input: SignMessagesRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Shutdown the node gracefully + * + * @generated from protobuf rpc: ShutdownGracefully(massa.api.v1.ShutdownGracefullyRequest) returns (massa.api.v1.ShutdownGracefullyResponse); + */ + shutdownGracefully( + input: ShutdownGracefullyRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Unban multiple nodes by their individual ids + * + * @generated from protobuf rpc: UnbanNodesByIds(massa.api.v1.UnbanNodesByIdsRequest) returns (massa.api.v1.UnbanNodesByIdsResponse); + */ + unbanNodesByIds( + input: UnbanNodesByIdsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Unban multiple nodes by their individual IP addresses + * + * @generated from protobuf rpc: UnbanNodesByIps(massa.api.v1.UnbanNodesByIpsRequest) returns (massa.api.v1.UnbanNodesByIpsResponse); + */ + unbanNodesByIps( + input: UnbanNodesByIpsRequest, + options?: RpcOptions, + ): UnaryCall; +} +/** + * Massa private gRPC service + * + * @generated from protobuf service massa.api.v1.PrivateService + */ +export class PrivateServiceClient + implements IPrivateServiceClient, ServiceInfo +{ + typeName = PrivateService.typeName; + methods = PrivateService.methods; + options = PrivateService.options; + constructor(private readonly _transport: RpcTransport) {} + /** + * Add IP addresses to node bootstrap blacklist + * + * @generated from protobuf rpc: AddToBootstrapBlacklist(massa.api.v1.AddToBootstrapBlacklistRequest) returns (massa.api.v1.AddToBootstrapBlacklistResponse); + */ + addToBootstrapBlacklist( + input: AddToBootstrapBlacklistRequest, + options?: RpcOptions, + ): UnaryCall< + AddToBootstrapBlacklistRequest, + AddToBootstrapBlacklistResponse + > { + const method = this.methods[0]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + AddToBootstrapBlacklistRequest, + AddToBootstrapBlacklistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Add IP addresses to node bootstrap whitelist + * + * @generated from protobuf rpc: AddToBootstrapWhitelist(massa.api.v1.AddToBootstrapWhitelistRequest) returns (massa.api.v1.AddToBootstrapWhitelistResponse); + */ + addToBootstrapWhitelist( + input: AddToBootstrapWhitelistRequest, + options?: RpcOptions, + ): UnaryCall< + AddToBootstrapWhitelistRequest, + AddToBootstrapWhitelistResponse + > { + const method = this.methods[1]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + AddToBootstrapWhitelistRequest, + AddToBootstrapWhitelistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Add IP addresses to node peers whitelist. No confirmation to expect. + * Note: If the ip was unknown it adds it to the known peers, otherwise it updates the peer type + * + * @generated from protobuf rpc: AddToPeersWhitelist(massa.api.v1.AddToPeersWhitelistRequest) returns (massa.api.v1.AddToPeersWhitelistResponse); + */ + addToPeersWhitelist( + input: AddToPeersWhitelistRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[2]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + AddToPeersWhitelistRequest, + AddToPeersWhitelistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Add staking secret keys to wallet + * + * @generated from protobuf rpc: AddStakingSecretKeys(massa.api.v1.AddStakingSecretKeysRequest) returns (massa.api.v1.AddStakingSecretKeysResponse); + */ + addStakingSecretKeys( + input: AddStakingSecretKeysRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[3]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + AddStakingSecretKeysRequest, + AddStakingSecretKeysResponse + >('unary', this._transport, method, opt, input); + } + /** + * Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file + * + * @generated from protobuf rpc: AllowEveryoneToBootstrap(massa.api.v1.AllowEveryoneToBootstrapRequest) returns (massa.api.v1.AllowEveryoneToBootstrapResponse); + */ + allowEveryoneToBootstrap( + input: AllowEveryoneToBootstrapRequest, + options?: RpcOptions, + ): UnaryCall< + AllowEveryoneToBootstrapRequest, + AllowEveryoneToBootstrapResponse + > { + const method = this.methods[4]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + AllowEveryoneToBootstrapRequest, + AllowEveryoneToBootstrapResponse + >('unary', this._transport, method, opt, input); + } + /** + * Get node bootstrap blacklist IP addresses + * + * @generated from protobuf rpc: GetBootstrapBlacklist(massa.api.v1.GetBootstrapBlacklistRequest) returns (massa.api.v1.GetBootstrapBlacklistResponse); + */ + getBootstrapBlacklist( + input: GetBootstrapBlacklistRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[5]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + GetBootstrapBlacklistRequest, + GetBootstrapBlacklistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Get node bootstrap whitelist IP addresses + * + * @generated from protobuf rpc: GetBootstrapWhitelist(massa.api.v1.GetBootstrapWhitelistRequest) returns (massa.api.v1.GetBootstrapWhitelistResponse); + */ + getBootstrapWhitelist( + input: GetBootstrapWhitelistRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[6]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + GetBootstrapWhitelistRequest, + GetBootstrapWhitelistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Get Mip status + * + * @generated from protobuf rpc: GetMipStatus(massa.api.v1.GetMipStatusRequest) returns (massa.api.v1.GetMipStatusResponse); + */ + getMipStatus( + input: GetMipStatusRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[7]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get node status + * + * @generated from protobuf rpc: GetNodeStatus(massa.api.v1.GetNodeStatusRequest) returns (massa.api.v1.GetNodeStatusResponse); + */ + getNodeStatus( + input: GetNodeStatusRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[8]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get node peers whitelist IP addresses + * + * @generated from protobuf rpc: GetPeersWhitelist(massa.api.v1.GetPeersWhitelistRequest) returns (massa.api.v1.GetPeersWhitelistResponse); + */ + getPeersWhitelist( + input: GetPeersWhitelistRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[9]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Ban multiple nodes by their individual ids + * + * @generated from protobuf rpc: BanNodesByIds(massa.api.v1.BanNodesByIdsRequest) returns (massa.api.v1.BanNodesByIdsResponse); + */ + banNodesByIds( + input: BanNodesByIdsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[10]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Ban multiple nodes by their individual IP addresses + * + * @generated from protobuf rpc: BanNodesByIps(massa.api.v1.BanNodesByIpsRequest) returns (massa.api.v1.BanNodesByIpsResponse); + */ + banNodesByIps( + input: BanNodesByIpsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[11]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Remove from bootstrap blacklist given IP addresses + * + * @generated from protobuf rpc: RemoveFromBootstrapBlacklist(massa.api.v1.RemoveFromBootstrapBlacklistRequest) returns (massa.api.v1.RemoveFromBootstrapBlacklistResponse); + */ + removeFromBootstrapBlacklist( + input: RemoveFromBootstrapBlacklistRequest, + options?: RpcOptions, + ): UnaryCall< + RemoveFromBootstrapBlacklistRequest, + RemoveFromBootstrapBlacklistResponse + > { + const method = this.methods[12]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + RemoveFromBootstrapBlacklistRequest, + RemoveFromBootstrapBlacklistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Remove from bootstrap whitelist given IP addresses + * + * @generated from protobuf rpc: RemoveFromBootstrapWhitelist(massa.api.v1.RemoveFromBootstrapWhitelistRequest) returns (massa.api.v1.RemoveFromBootstrapWhitelistResponse); + */ + removeFromBootstrapWhitelist( + input: RemoveFromBootstrapWhitelistRequest, + options?: RpcOptions, + ): UnaryCall< + RemoveFromBootstrapWhitelistRequest, + RemoveFromBootstrapWhitelistResponse + > { + const method = this.methods[13]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + RemoveFromBootstrapWhitelistRequest, + RemoveFromBootstrapWhitelistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Remove from peers whitelist given IP addresses + * + * @generated from protobuf rpc: RemoveFromPeersWhitelist(massa.api.v1.RemoveFromPeersWhitelistRequest) returns (massa.api.v1.RemoveFromPeersWhitelistResponse); + */ + removeFromPeersWhitelist( + input: RemoveFromPeersWhitelistRequest, + options?: RpcOptions, + ): UnaryCall< + RemoveFromPeersWhitelistRequest, + RemoveFromPeersWhitelistResponse + > { + const method = this.methods[14]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + RemoveFromPeersWhitelistRequest, + RemoveFromPeersWhitelistResponse + >('unary', this._transport, method, opt, input); + } + /** + * Remove addresses from staking + * + * @generated from protobuf rpc: RemoveStakingAddresses(massa.api.v1.RemoveStakingAddressesRequest) returns (massa.api.v1.RemoveStakingAddressesResponse); + */ + removeStakingAddresses( + input: RemoveStakingAddressesRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[15]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + RemoveStakingAddressesRequest, + RemoveStakingAddressesResponse + >('unary', this._transport, method, opt, input); + } + /** + * Sign messages with node's key + * + * @generated from protobuf rpc: SignMessages(massa.api.v1.SignMessagesRequest) returns (massa.api.v1.SignMessagesResponse); + */ + signMessages( + input: SignMessagesRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[16]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Shutdown the node gracefully + * + * @generated from protobuf rpc: ShutdownGracefully(massa.api.v1.ShutdownGracefullyRequest) returns (massa.api.v1.ShutdownGracefullyResponse); + */ + shutdownGracefully( + input: ShutdownGracefullyRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[17]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + ShutdownGracefullyRequest, + ShutdownGracefullyResponse + >('unary', this._transport, method, opt, input); + } + /** + * Unban multiple nodes by their individual ids + * + * @generated from protobuf rpc: UnbanNodesByIds(massa.api.v1.UnbanNodesByIdsRequest) returns (massa.api.v1.UnbanNodesByIdsResponse); + */ + unbanNodesByIds( + input: UnbanNodesByIdsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[18]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Unban multiple nodes by their individual IP addresses + * + * @generated from protobuf rpc: UnbanNodesByIps(massa.api.v1.UnbanNodesByIpsRequest) returns (massa.api.v1.UnbanNodesByIpsResponse); + */ + unbanNodesByIps( + input: UnbanNodesByIpsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[19]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } +} diff --git a/frontend/src/proto-gen/massa/api/v1/private.ts b/frontend/src/proto-gen/massa/api/v1/private.ts new file mode 100644 index 0000000..e6d2ee5 --- /dev/null +++ b/frontend/src/proto-gen/massa/api/v1/private.ts @@ -0,0 +1,3101 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/api/v1/private.proto" (package "massa.api.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import { ServiceType } from '@protobuf-ts/runtime-rpc'; +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { NodeStatus } from '../../model/v1/node'; +import { MipStatusEntry } from '../../model/v1/versioning'; +/** + * AddToBootstrapBlacklistRequest holds the request for AddToBootstrapBlacklist + * + * @generated from protobuf message massa.api.v1.AddToBootstrapBlacklistRequest + */ +export interface AddToBootstrapBlacklistRequest { + /** + * IP addresses to add to bootstrap blacklist + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * AddToBootstrapBlacklistResponse holds the response from AddToBootstrapBlacklist + * + * @generated from protobuf message massa.api.v1.AddToBootstrapBlacklistResponse + */ +export interface AddToBootstrapBlacklistResponse {} +/** + * AddToBootstrapWhitelistRequest holds the request for AddToBootstrapWhitelist + * + * @generated from protobuf message massa.api.v1.AddToBootstrapWhitelistRequest + */ +export interface AddToBootstrapWhitelistRequest { + /** + * IP addresses to add to bootstrap whitelist + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * AddToBootstrapWhitelistResponse holds the response from AddToBootstrapWhitelist + * + * @generated from protobuf message massa.api.v1.AddToBootstrapWhitelistResponse + */ +export interface AddToBootstrapWhitelistResponse {} +/** + * AddToPeersWhitelistRequest holds the request for AddToPeersWhitelist + * + * @generated from protobuf message massa.api.v1.AddToPeersWhitelistRequest + */ +export interface AddToPeersWhitelistRequest { + /** + * IP addresses to add to peers whitelist + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * AddToPeersWhitelistResponse holds the response from AddToPeersWhitelist + * + * @generated from protobuf message massa.api.v1.AddToPeersWhitelistResponse + */ +export interface AddToPeersWhitelistResponse {} +/** + * AddStakingSecretKeysRequest holds the request for AddStakingSecretKeys + * + * @generated from protobuf message massa.api.v1.AddStakingSecretKeysRequest + */ +export interface AddStakingSecretKeysRequest { + /** + * Secret keys to add to wallet + * + * @generated from protobuf field: repeated string secret_keys = 1; + */ + secretKeys: string[]; +} +/** + * AddStakingSecretKeysResponse holds the response from AddStakingSecretKeys + * + * @generated from protobuf message massa.api.v1.AddStakingSecretKeysResponse + */ +export interface AddStakingSecretKeysResponse {} +/** + * AllowEveryoneToBootstrapRequest holds the request for AllowEveryoneToBootstrap + * + * @generated from protobuf message massa.api.v1.AllowEveryoneToBootstrapRequest + */ +export interface AllowEveryoneToBootstrapRequest {} +/** + * AllowEveryoneToBootstrapResponse holds the response from AllowEveryoneToBootstrap + * + * @generated from protobuf message massa.api.v1.AllowEveryoneToBootstrapResponse + */ +export interface AllowEveryoneToBootstrapResponse {} +/** + * GetBootstrapBlacklistRequest holds the request for GetBootstrapBlacklist + * + * @generated from protobuf message massa.api.v1.GetBootstrapBlacklistRequest + */ +export interface GetBootstrapBlacklistRequest {} +/** + * GetBootstrapBlacklistResponse holds the response from GetBootstrapBlacklist + * + * @generated from protobuf message massa.api.v1.GetBootstrapBlacklistResponse + */ +export interface GetBootstrapBlacklistResponse { + /** + * Bootstrap blacklisted IP addresses + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * GetBootstrapWhitelistRequest holds the request for GetBootstrapWhitelist + * + * @generated from protobuf message massa.api.v1.GetBootstrapWhitelistRequest + */ +export interface GetBootstrapWhitelistRequest {} +/** + * GetBootstrapWhitelistResponse holds the response from GetBootstrapWhitelist + * + * @generated from protobuf message massa.api.v1.GetBootstrapWhitelistResponse + */ +export interface GetBootstrapWhitelistResponse { + /** + * Bootstrap whitelisted IP addresses + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * GetMipStatusRequest holds request for GetMipStatus + * + * @generated from protobuf message massa.api.v1.GetMipStatusRequest + */ +export interface GetMipStatusRequest {} +/** + * GetMipStatusResponse holds response from GetMipStatus + * + * @generated from protobuf message massa.api.v1.GetMipStatusResponse + */ +export interface GetMipStatusResponse { + /** + * (MipInfo - status id) entries + * + * @generated from protobuf field: repeated massa.model.v1.MipStatusEntry mipstatus_entries = 1; + */ + mipstatusEntries: MipStatusEntry[]; +} +/** + * GetNodeStatusRequest holds the request for GetNodeStatus + * + * @generated from protobuf message massa.api.v1.GetNodeStatusRequest + */ +export interface GetNodeStatusRequest {} +/** + * GetNodeStatusResponse holds the response from GetNodeStatus + * + * @generated from protobuf message massa.api.v1.GetNodeStatusResponse + */ +export interface GetNodeStatusResponse { + /** + * Node status + * + * @generated from protobuf field: massa.model.v1.NodeStatus status = 1; + */ + status?: NodeStatus; +} +/** + * GetPeersWhitelistRequest holds the request for GetPeersWhitelist + * + * @generated from protobuf message massa.api.v1.GetPeersWhitelistRequest + */ +export interface GetPeersWhitelistRequest {} +/** + * GetPeersWhitelistResponse holds the response from GetPeersWhitelist + * + * @generated from protobuf message massa.api.v1.GetPeersWhitelistResponse + */ +export interface GetPeersWhitelistResponse { + /** + * Whitelisted IP addresses + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * BanNodesByIdsRequest holds the request for BanNodesByIds + * + * @generated from protobuf message massa.api.v1.BanNodesByIdsRequest + */ +export interface BanNodesByIdsRequest { + /** + * Node ids to ban + * + * @generated from protobuf field: repeated string node_ids = 1; + */ + nodeIds: string[]; +} +/** + * BanNodesByIdsResponse holds the response from BanNodesByIds + * + * @generated from protobuf message massa.api.v1.BanNodesByIdsResponse + */ +export interface BanNodesByIdsResponse {} +/** + * BanNodesByIpsRequest holds the request for BanNodesByIps + * + * @generated from protobuf message massa.api.v1.BanNodesByIpsRequest + */ +export interface BanNodesByIpsRequest { + /** + * Node IP addresses to ban + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * BanNodesByIpsResponse holds the response from BanNodesByIps + * + * @generated from protobuf message massa.api.v1.BanNodesByIpsResponse + */ +export interface BanNodesByIpsResponse {} +/** + * RemoveFromBootstrapBlacklistRequest holds the request for RemoveFromBootstrapBlacklist + * + * @generated from protobuf message massa.api.v1.RemoveFromBootstrapBlacklistRequest + */ +export interface RemoveFromBootstrapBlacklistRequest { + /** + * IP addresses to remove from bootstrap blacklist + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * RemoveFromBootstrapBlacklistResponse holds the response from RemoveFromBootstrapBlacklist + * + * @generated from protobuf message massa.api.v1.RemoveFromBootstrapBlacklistResponse + */ +export interface RemoveFromBootstrapBlacklistResponse {} +/** + * RemoveFromBootstrapWhitelistRequest holds the request for RemoveFromBootstrapWhitelist + * + * @generated from protobuf message massa.api.v1.RemoveFromBootstrapWhitelistRequest + */ +export interface RemoveFromBootstrapWhitelistRequest { + /** + * IP addresses to remove from bootstrap whitelist + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * RemoveFromBootstrapWhitelistResponse holds the response from RemoveFromBootstrapWhitelist + * + * @generated from protobuf message massa.api.v1.RemoveFromBootstrapWhitelistResponse + */ +export interface RemoveFromBootstrapWhitelistResponse {} +/** + * RemoveFromPeersWhitelistRequest holds the request for RemoveFromPeersWhitelist + * + * @generated from protobuf message massa.api.v1.RemoveFromPeersWhitelistRequest + */ +export interface RemoveFromPeersWhitelistRequest { + /** + * IP addresses to remove from peers whitelist + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * RemoveFromPeersWhitelistResponse holds the response from RemoveFromPeersWhitelist + * + * @generated from protobuf message massa.api.v1.RemoveFromPeersWhitelistResponse + */ +export interface RemoveFromPeersWhitelistResponse {} +/** + * RemoveStakingAddressesRequest holds the request for RemoveStakingAddresses + * + * @generated from protobuf message massa.api.v1.RemoveStakingAddressesRequest + */ +export interface RemoveStakingAddressesRequest { + /** + * Addresses to remove from staking + * + * @generated from protobuf field: repeated string addresses = 1; + */ + addresses: string[]; +} +/** + * RemoveStakingAddressesResponse holds the response from RemoveStakingAddresses + * + * @generated from protobuf message massa.api.v1.RemoveStakingAddressesResponse + */ +export interface RemoveStakingAddressesResponse {} +/** + * SignMessagesRequest holds the request for SignMessages + * + * @generated from protobuf message massa.api.v1.SignMessagesRequest + */ +export interface SignMessagesRequest { + /** + * Messages to sign in bytes + * + * @generated from protobuf field: repeated bytes messages = 1; + */ + messages: Uint8Array[]; +} +/** + * SignMessagesResponse holds the response from SignMessages + * + * @generated from protobuf message massa.api.v1.SignMessagesResponse + */ +export interface SignMessagesResponse { + /** + * Public key that signed the message + * + * @generated from protobuf field: string public_key = 1; + */ + publicKey: string; + /** + * Signatures + * + * @generated from protobuf field: repeated string signatures = 3; + */ + signatures: string[]; +} +/** + * ShutdownGracefullyRequest holds the request for ShutdownGracefully + * + * @generated from protobuf message massa.api.v1.ShutdownGracefullyRequest + */ +export interface ShutdownGracefullyRequest {} +/** + * ShutdownGracefullyResponse holds the response from ShutdownGracefully + * + * @generated from protobuf message massa.api.v1.ShutdownGracefullyResponse + */ +export interface ShutdownGracefullyResponse {} +/** + * UnbanNodesByIdsRequest holds the request for UnbanNodesByIds + * + * @generated from protobuf message massa.api.v1.UnbanNodesByIdsRequest + */ +export interface UnbanNodesByIdsRequest { + /** + * Node ids to unban + * + * @generated from protobuf field: repeated string node_ids = 1; + */ + nodeIds: string[]; +} +/** + * UnbanNodesByIdsResponse holds the response from UnbanNodesByIds + * + * @generated from protobuf message massa.api.v1.UnbanNodesByIdsResponse + */ +export interface UnbanNodesByIdsResponse {} +/** + * UnbanNodesByIpsRequest holds the request for UnbanNodesByIps + * + * @generated from protobuf message massa.api.v1.UnbanNodesByIpsRequest + */ +export interface UnbanNodesByIpsRequest { + /** + * Nodes IP addresses to unban + * + * @generated from protobuf field: repeated string ips = 1; + */ + ips: string[]; +} +/** + * UnbanNodesByIpsResponse holds the response from UnbanNodesByIps + * + * @generated from protobuf message massa.api.v1.UnbanNodesByIpsResponse + */ +export interface UnbanNodesByIpsResponse {} +// @generated message type with reflection information, may provide speed optimized methods +class AddToBootstrapBlacklistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.AddToBootstrapBlacklistRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): AddToBootstrapBlacklistRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddToBootstrapBlacklistRequest, + ): AddToBootstrapBlacklistRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddToBootstrapBlacklistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddToBootstrapBlacklistRequest + */ +export const AddToBootstrapBlacklistRequest = + new AddToBootstrapBlacklistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddToBootstrapBlacklistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.AddToBootstrapBlacklistResponse', []); + } + create( + value?: PartialMessage, + ): AddToBootstrapBlacklistResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddToBootstrapBlacklistResponse, + ): AddToBootstrapBlacklistResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: AddToBootstrapBlacklistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddToBootstrapBlacklistResponse + */ +export const AddToBootstrapBlacklistResponse = + new AddToBootstrapBlacklistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddToBootstrapWhitelistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.AddToBootstrapWhitelistRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): AddToBootstrapWhitelistRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddToBootstrapWhitelistRequest, + ): AddToBootstrapWhitelistRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddToBootstrapWhitelistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddToBootstrapWhitelistRequest + */ +export const AddToBootstrapWhitelistRequest = + new AddToBootstrapWhitelistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddToBootstrapWhitelistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.AddToBootstrapWhitelistResponse', []); + } + create( + value?: PartialMessage, + ): AddToBootstrapWhitelistResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddToBootstrapWhitelistResponse, + ): AddToBootstrapWhitelistResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: AddToBootstrapWhitelistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddToBootstrapWhitelistResponse + */ +export const AddToBootstrapWhitelistResponse = + new AddToBootstrapWhitelistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddToPeersWhitelistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.AddToPeersWhitelistRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): AddToPeersWhitelistRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddToPeersWhitelistRequest, + ): AddToPeersWhitelistRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddToPeersWhitelistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddToPeersWhitelistRequest + */ +export const AddToPeersWhitelistRequest = new AddToPeersWhitelistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddToPeersWhitelistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.AddToPeersWhitelistResponse', []); + } + create( + value?: PartialMessage, + ): AddToPeersWhitelistResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddToPeersWhitelistResponse, + ): AddToPeersWhitelistResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: AddToPeersWhitelistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddToPeersWhitelistResponse + */ +export const AddToPeersWhitelistResponse = + new AddToPeersWhitelistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddStakingSecretKeysRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.AddStakingSecretKeysRequest', [ + { + no: 1, + name: 'secret_keys', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): AddStakingSecretKeysRequest { + const message = { secretKeys: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddStakingSecretKeysRequest, + ): AddStakingSecretKeysRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string secret_keys */ 1: + message.secretKeys.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddStakingSecretKeysRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string secret_keys = 1; */ + for (let i = 0; i < message.secretKeys.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.secretKeys[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddStakingSecretKeysRequest + */ +export const AddStakingSecretKeysRequest = + new AddStakingSecretKeysRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddStakingSecretKeysResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.AddStakingSecretKeysResponse', []); + } + create( + value?: PartialMessage, + ): AddStakingSecretKeysResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddStakingSecretKeysResponse, + ): AddStakingSecretKeysResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: AddStakingSecretKeysResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddStakingSecretKeysResponse + */ +export const AddStakingSecretKeysResponse = + new AddStakingSecretKeysResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AllowEveryoneToBootstrapRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.AllowEveryoneToBootstrapRequest', []); + } + create( + value?: PartialMessage, + ): AllowEveryoneToBootstrapRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AllowEveryoneToBootstrapRequest, + ): AllowEveryoneToBootstrapRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: AllowEveryoneToBootstrapRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AllowEveryoneToBootstrapRequest + */ +export const AllowEveryoneToBootstrapRequest = + new AllowEveryoneToBootstrapRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AllowEveryoneToBootstrapResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.AllowEveryoneToBootstrapResponse', []); + } + create( + value?: PartialMessage, + ): AllowEveryoneToBootstrapResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AllowEveryoneToBootstrapResponse, + ): AllowEveryoneToBootstrapResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: AllowEveryoneToBootstrapResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AllowEveryoneToBootstrapResponse + */ +export const AllowEveryoneToBootstrapResponse = + new AllowEveryoneToBootstrapResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBootstrapBlacklistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetBootstrapBlacklistRequest', []); + } + create( + value?: PartialMessage, + ): GetBootstrapBlacklistRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBootstrapBlacklistRequest, + ): GetBootstrapBlacklistRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetBootstrapBlacklistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetBootstrapBlacklistRequest + */ +export const GetBootstrapBlacklistRequest = + new GetBootstrapBlacklistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBootstrapBlacklistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetBootstrapBlacklistResponse', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetBootstrapBlacklistResponse { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBootstrapBlacklistResponse, + ): GetBootstrapBlacklistResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBootstrapBlacklistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetBootstrapBlacklistResponse + */ +export const GetBootstrapBlacklistResponse = + new GetBootstrapBlacklistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBootstrapWhitelistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetBootstrapWhitelistRequest', []); + } + create( + value?: PartialMessage, + ): GetBootstrapWhitelistRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBootstrapWhitelistRequest, + ): GetBootstrapWhitelistRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetBootstrapWhitelistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetBootstrapWhitelistRequest + */ +export const GetBootstrapWhitelistRequest = + new GetBootstrapWhitelistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBootstrapWhitelistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetBootstrapWhitelistResponse', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetBootstrapWhitelistResponse { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBootstrapWhitelistResponse, + ): GetBootstrapWhitelistResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBootstrapWhitelistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetBootstrapWhitelistResponse + */ +export const GetBootstrapWhitelistResponse = + new GetBootstrapWhitelistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetMipStatusRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetMipStatusRequest', []); + } + create(value?: PartialMessage): GetMipStatusRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetMipStatusRequest, + ): GetMipStatusRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetMipStatusRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetMipStatusRequest + */ +export const GetMipStatusRequest = new GetMipStatusRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetMipStatusResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetMipStatusResponse', [ + { + no: 1, + name: 'mipstatus_entries', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => MipStatusEntry, + }, + ]); + } + create(value?: PartialMessage): GetMipStatusResponse { + const message = { mipstatusEntries: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetMipStatusResponse, + ): GetMipStatusResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.MipStatusEntry mipstatus_entries */ 1: + message.mipstatusEntries.push( + MipStatusEntry.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetMipStatusResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.MipStatusEntry mipstatus_entries = 1; */ + for (let i = 0; i < message.mipstatusEntries.length; i++) + MipStatusEntry.internalBinaryWrite( + message.mipstatusEntries[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetMipStatusResponse + */ +export const GetMipStatusResponse = new GetMipStatusResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetNodeStatusRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetNodeStatusRequest', []); + } + create(value?: PartialMessage): GetNodeStatusRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetNodeStatusRequest, + ): GetNodeStatusRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetNodeStatusRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetNodeStatusRequest + */ +export const GetNodeStatusRequest = new GetNodeStatusRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetNodeStatusResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetNodeStatusResponse', [ + { no: 1, name: 'status', kind: 'message', T: () => NodeStatus }, + ]); + } + create(value?: PartialMessage): GetNodeStatusResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetNodeStatusResponse, + ): GetNodeStatusResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NodeStatus status */ 1: + message.status = NodeStatus.internalBinaryRead( + reader, + reader.uint32(), + options, + message.status, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetNodeStatusResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NodeStatus status = 1; */ + if (message.status) + NodeStatus.internalBinaryWrite( + message.status, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetNodeStatusResponse + */ +export const GetNodeStatusResponse = new GetNodeStatusResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetPeersWhitelistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetPeersWhitelistRequest', []); + } + create( + value?: PartialMessage, + ): GetPeersWhitelistRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetPeersWhitelistRequest, + ): GetPeersWhitelistRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetPeersWhitelistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetPeersWhitelistRequest + */ +export const GetPeersWhitelistRequest = new GetPeersWhitelistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetPeersWhitelistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetPeersWhitelistResponse', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetPeersWhitelistResponse { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetPeersWhitelistResponse, + ): GetPeersWhitelistResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetPeersWhitelistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetPeersWhitelistResponse + */ +export const GetPeersWhitelistResponse = new GetPeersWhitelistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BanNodesByIdsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.BanNodesByIdsRequest', [ + { + no: 1, + name: 'node_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): BanNodesByIdsRequest { + const message = { nodeIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BanNodesByIdsRequest, + ): BanNodesByIdsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string node_ids */ 1: + message.nodeIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BanNodesByIdsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string node_ids = 1; */ + for (let i = 0; i < message.nodeIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.nodeIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.BanNodesByIdsRequest + */ +export const BanNodesByIdsRequest = new BanNodesByIdsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BanNodesByIdsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.BanNodesByIdsResponse', []); + } + create(value?: PartialMessage): BanNodesByIdsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BanNodesByIdsResponse, + ): BanNodesByIdsResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: BanNodesByIdsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.BanNodesByIdsResponse + */ +export const BanNodesByIdsResponse = new BanNodesByIdsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BanNodesByIpsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.BanNodesByIpsRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): BanNodesByIpsRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BanNodesByIpsRequest, + ): BanNodesByIpsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BanNodesByIpsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.BanNodesByIpsRequest + */ +export const BanNodesByIpsRequest = new BanNodesByIpsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BanNodesByIpsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.BanNodesByIpsResponse', []); + } + create(value?: PartialMessage): BanNodesByIpsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BanNodesByIpsResponse, + ): BanNodesByIpsResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: BanNodesByIpsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.BanNodesByIpsResponse + */ +export const BanNodesByIpsResponse = new BanNodesByIpsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveFromBootstrapBlacklistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveFromBootstrapBlacklistRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): RemoveFromBootstrapBlacklistRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveFromBootstrapBlacklistRequest, + ): RemoveFromBootstrapBlacklistRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: RemoveFromBootstrapBlacklistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveFromBootstrapBlacklistRequest + */ +export const RemoveFromBootstrapBlacklistRequest = + new RemoveFromBootstrapBlacklistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveFromBootstrapBlacklistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveFromBootstrapBlacklistResponse', []); + } + create( + value?: PartialMessage, + ): RemoveFromBootstrapBlacklistResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveFromBootstrapBlacklistResponse, + ): RemoveFromBootstrapBlacklistResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: RemoveFromBootstrapBlacklistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveFromBootstrapBlacklistResponse + */ +export const RemoveFromBootstrapBlacklistResponse = + new RemoveFromBootstrapBlacklistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveFromBootstrapWhitelistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveFromBootstrapWhitelistRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): RemoveFromBootstrapWhitelistRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveFromBootstrapWhitelistRequest, + ): RemoveFromBootstrapWhitelistRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: RemoveFromBootstrapWhitelistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveFromBootstrapWhitelistRequest + */ +export const RemoveFromBootstrapWhitelistRequest = + new RemoveFromBootstrapWhitelistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveFromBootstrapWhitelistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveFromBootstrapWhitelistResponse', []); + } + create( + value?: PartialMessage, + ): RemoveFromBootstrapWhitelistResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveFromBootstrapWhitelistResponse, + ): RemoveFromBootstrapWhitelistResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: RemoveFromBootstrapWhitelistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveFromBootstrapWhitelistResponse + */ +export const RemoveFromBootstrapWhitelistResponse = + new RemoveFromBootstrapWhitelistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveFromPeersWhitelistRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveFromPeersWhitelistRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): RemoveFromPeersWhitelistRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveFromPeersWhitelistRequest, + ): RemoveFromPeersWhitelistRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: RemoveFromPeersWhitelistRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveFromPeersWhitelistRequest + */ +export const RemoveFromPeersWhitelistRequest = + new RemoveFromPeersWhitelistRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveFromPeersWhitelistResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveFromPeersWhitelistResponse', []); + } + create( + value?: PartialMessage, + ): RemoveFromPeersWhitelistResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveFromPeersWhitelistResponse, + ): RemoveFromPeersWhitelistResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: RemoveFromPeersWhitelistResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveFromPeersWhitelistResponse + */ +export const RemoveFromPeersWhitelistResponse = + new RemoveFromPeersWhitelistResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveStakingAddressesRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveStakingAddressesRequest', [ + { + no: 1, + name: 'addresses', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): RemoveStakingAddressesRequest { + const message = { addresses: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveStakingAddressesRequest, + ): RemoveStakingAddressesRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string addresses */ 1: + message.addresses.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: RemoveStakingAddressesRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string addresses = 1; */ + for (let i = 0; i < message.addresses.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.addresses[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveStakingAddressesRequest + */ +export const RemoveStakingAddressesRequest = + new RemoveStakingAddressesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RemoveStakingAddressesResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.RemoveStakingAddressesResponse', []); + } + create( + value?: PartialMessage, + ): RemoveStakingAddressesResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RemoveStakingAddressesResponse, + ): RemoveStakingAddressesResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: RemoveStakingAddressesResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.RemoveStakingAddressesResponse + */ +export const RemoveStakingAddressesResponse = + new RemoveStakingAddressesResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignMessagesRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.SignMessagesRequest', [ + { + no: 1, + name: 'messages', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): SignMessagesRequest { + const message = { messages: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SignMessagesRequest, + ): SignMessagesRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated bytes messages */ 1: + message.messages.push(reader.bytes()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SignMessagesRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated bytes messages = 1; */ + for (let i = 0; i < message.messages.length; i++) + writer.tag(1, WireType.LengthDelimited).bytes(message.messages[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SignMessagesRequest + */ +export const SignMessagesRequest = new SignMessagesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignMessagesResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.SignMessagesResponse', [ + { + no: 1, + name: 'public_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'signatures', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): SignMessagesResponse { + const message = { publicKey: '', signatures: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SignMessagesResponse, + ): SignMessagesResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string public_key */ 1: + message.publicKey = reader.string(); + break; + case /* repeated string signatures */ 3: + message.signatures.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SignMessagesResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string public_key = 1; */ + if (message.publicKey !== '') + writer.tag(1, WireType.LengthDelimited).string(message.publicKey); + /* repeated string signatures = 3; */ + for (let i = 0; i < message.signatures.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.signatures[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SignMessagesResponse + */ +export const SignMessagesResponse = new SignMessagesResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ShutdownGracefullyRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.ShutdownGracefullyRequest', []); + } + create( + value?: PartialMessage, + ): ShutdownGracefullyRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ShutdownGracefullyRequest, + ): ShutdownGracefullyRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: ShutdownGracefullyRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ShutdownGracefullyRequest + */ +export const ShutdownGracefullyRequest = new ShutdownGracefullyRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ShutdownGracefullyResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.ShutdownGracefullyResponse', []); + } + create( + value?: PartialMessage, + ): ShutdownGracefullyResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ShutdownGracefullyResponse, + ): ShutdownGracefullyResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: ShutdownGracefullyResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ShutdownGracefullyResponse + */ +export const ShutdownGracefullyResponse = new ShutdownGracefullyResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UnbanNodesByIdsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.UnbanNodesByIdsRequest', [ + { + no: 1, + name: 'node_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): UnbanNodesByIdsRequest { + const message = { nodeIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UnbanNodesByIdsRequest, + ): UnbanNodesByIdsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string node_ids */ 1: + message.nodeIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UnbanNodesByIdsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string node_ids = 1; */ + for (let i = 0; i < message.nodeIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.nodeIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.UnbanNodesByIdsRequest + */ +export const UnbanNodesByIdsRequest = new UnbanNodesByIdsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UnbanNodesByIdsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.UnbanNodesByIdsResponse', []); + } + create( + value?: PartialMessage, + ): UnbanNodesByIdsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UnbanNodesByIdsResponse, + ): UnbanNodesByIdsResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: UnbanNodesByIdsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.UnbanNodesByIdsResponse + */ +export const UnbanNodesByIdsResponse = new UnbanNodesByIdsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UnbanNodesByIpsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.UnbanNodesByIpsRequest', [ + { + no: 1, + name: 'ips', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): UnbanNodesByIpsRequest { + const message = { ips: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UnbanNodesByIpsRequest, + ): UnbanNodesByIpsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string ips */ 1: + message.ips.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: UnbanNodesByIpsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string ips = 1; */ + for (let i = 0; i < message.ips.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.ips[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.UnbanNodesByIpsRequest + */ +export const UnbanNodesByIpsRequest = new UnbanNodesByIpsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UnbanNodesByIpsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.UnbanNodesByIpsResponse', []); + } + create( + value?: PartialMessage, + ): UnbanNodesByIpsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: UnbanNodesByIpsResponse, + ): UnbanNodesByIpsResponse { + return target ?? this.create(); + } + internalBinaryWrite( + message: UnbanNodesByIpsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.UnbanNodesByIpsResponse + */ +export const UnbanNodesByIpsResponse = new UnbanNodesByIpsResponse$Type(); +/** + * @generated ServiceType for protobuf service massa.api.v1.PrivateService + */ +export const PrivateService = new ServiceType('massa.api.v1.PrivateService', [ + { + name: 'AddToBootstrapBlacklist', + options: { + 'google.api.http': { post: '/v1/add_to_boostrap_blacklist', body: '*' }, + }, + I: AddToBootstrapBlacklistRequest, + O: AddToBootstrapBlacklistResponse, + }, + { + name: 'AddToBootstrapWhitelist', + options: { + 'google.api.http': { post: '/v1/add_to_boostrap_whitelist', body: '*' }, + }, + I: AddToBootstrapWhitelistRequest, + O: AddToBootstrapWhitelistResponse, + }, + { + name: 'AddToPeersWhitelist', + options: { + 'google.api.http': { post: '/v1/add_to_peers_whitelist', body: '*' }, + }, + I: AddToPeersWhitelistRequest, + O: AddToPeersWhitelistResponse, + }, + { + name: 'AddStakingSecretKeys', + options: { + 'google.api.http': { post: '/v1/add_staking_secret_keys', body: '*' }, + }, + I: AddStakingSecretKeysRequest, + O: AddStakingSecretKeysResponse, + }, + { + name: 'AllowEveryoneToBootstrap', + options: { + 'google.api.http': { post: '/v1/allow_everyone_to_bootstrap', body: '*' }, + }, + I: AllowEveryoneToBootstrapRequest, + O: AllowEveryoneToBootstrapResponse, + }, + { + name: 'GetBootstrapBlacklist', + options: { + 'google.api.http': { post: '/v1/get_bootstrap_blacklist', body: '*' }, + }, + I: GetBootstrapBlacklistRequest, + O: GetBootstrapBlacklistResponse, + }, + { + name: 'GetBootstrapWhitelist', + options: { + 'google.api.http': { post: '/v1/get_bootstrap_whitelist', body: '*' }, + }, + I: GetBootstrapWhitelistRequest, + O: GetBootstrapWhitelistResponse, + }, + { + name: 'GetMipStatus', + options: { 'google.api.http': { post: '/v1/get_mip_status', body: '*' } }, + I: GetMipStatusRequest, + O: GetMipStatusResponse, + }, + { + name: 'GetNodeStatus', + options: { 'google.api.http': { post: '/v1/get_node_status', body: '*' } }, + I: GetNodeStatusRequest, + O: GetNodeStatusResponse, + }, + { + name: 'GetPeersWhitelist', + options: { + 'google.api.http': { post: '/v1/get_peers_whitelist', body: '*' }, + }, + I: GetPeersWhitelistRequest, + O: GetPeersWhitelistResponse, + }, + { + name: 'BanNodesByIds', + options: { 'google.api.http': { post: '/v1/ban_nodes_by_ids', body: '*' } }, + I: BanNodesByIdsRequest, + O: BanNodesByIdsResponse, + }, + { + name: 'BanNodesByIps', + options: { 'google.api.http': { post: '/v1/ban_nodes_by_ips', body: '*' } }, + I: BanNodesByIpsRequest, + O: BanNodesByIpsResponse, + }, + { + name: 'RemoveFromBootstrapBlacklist', + options: { + 'google.api.http': { + post: '/v1/remove_from_bootstrap_blacklist', + body: '*', + }, + }, + I: RemoveFromBootstrapBlacklistRequest, + O: RemoveFromBootstrapBlacklistResponse, + }, + { + name: 'RemoveFromBootstrapWhitelist', + options: { + 'google.api.http': { + post: '/v1/remove_from_bootstrap_whitelist', + body: '*', + }, + }, + I: RemoveFromBootstrapWhitelistRequest, + O: RemoveFromBootstrapWhitelistResponse, + }, + { + name: 'RemoveFromPeersWhitelist', + options: { + 'google.api.http': { post: '/v1/remove_from_peers_whitelist', body: '*' }, + }, + I: RemoveFromPeersWhitelistRequest, + O: RemoveFromPeersWhitelistResponse, + }, + { + name: 'RemoveStakingAddresses', + options: { + 'google.api.http': { post: '/v1/remove_staking_addresses', body: '*' }, + }, + I: RemoveStakingAddressesRequest, + O: RemoveStakingAddressesResponse, + }, + { + name: 'SignMessages', + options: { 'google.api.http': { post: '/v1/sign_messages', body: '*' } }, + I: SignMessagesRequest, + O: SignMessagesResponse, + }, + { + name: 'ShutdownGracefully', + options: { + 'google.api.http': { post: '/v1/shutdown_gracefully', body: '*' }, + }, + I: ShutdownGracefullyRequest, + O: ShutdownGracefullyResponse, + }, + { + name: 'UnbanNodesByIds', + options: { + 'google.api.http': { post: '/v1/unban_nodes_by_ids', body: '*' }, + }, + I: UnbanNodesByIdsRequest, + O: UnbanNodesByIdsResponse, + }, + { + name: 'UnbanNodesByIps', + options: { + 'google.api.http': { post: '/v1/unban_nodes_by_ips', body: '*' }, + }, + I: UnbanNodesByIpsRequest, + O: UnbanNodesByIpsResponse, + }, +]); diff --git a/frontend/src/proto-gen/massa/api/v1/public.client.ts b/frontend/src/proto-gen/massa/api/v1/public.client.ts new file mode 100644 index 0000000..dce9446 --- /dev/null +++ b/frontend/src/proto-gen/massa/api/v1/public.client.ts @@ -0,0 +1,767 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/api/v1/public.proto" (package "massa.api.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { RpcTransport } from '@protobuf-ts/runtime-rpc'; +import type { ServiceInfo } from '@protobuf-ts/runtime-rpc'; +import { PublicService } from './public'; +import type { TransactionsThroughputResponse } from './public'; +import type { TransactionsThroughputRequest } from './public'; +import type { SendOperationsResponse } from './public'; +import type { SendOperationsRequest } from './public'; +import type { SendEndorsementsResponse } from './public'; +import type { SendEndorsementsRequest } from './public'; +import type { SendBlocksResponse } from './public'; +import type { SendBlocksRequest } from './public'; +import type { ServerStreamingCall } from '@protobuf-ts/runtime-rpc'; +import type { NewSlotExecutionOutputsResponse } from './public'; +import type { NewSlotExecutionOutputsRequest } from './public'; +import type { NewOperationsResponse } from './public'; +import type { NewOperationsRequest } from './public'; +import type { NewFilledBlocksResponse } from './public'; +import type { NewFilledBlocksRequest } from './public'; +import type { NewEndorsementsResponse } from './public'; +import type { NewEndorsementsRequest } from './public'; +import type { NewBlocksResponse } from './public'; +import type { NewBlocksRequest } from './public'; +import type { DuplexStreamingCall } from '@protobuf-ts/runtime-rpc'; +import type { SearchOperationsResponse } from './public'; +import type { SearchOperationsRequest } from './public'; +import type { SearchEndorsementsResponse } from './public'; +import type { SearchEndorsementsRequest } from './public'; +import type { SearchBlocksResponse } from './public'; +import type { SearchBlocksRequest } from './public'; +import type { QueryStateResponse } from './public'; +import type { QueryStateRequest } from './public'; +import type { GetTransactionsThroughputResponse } from './public'; +import type { GetTransactionsThroughputRequest } from './public'; +import type { GetStatusResponse } from './public'; +import type { GetStatusRequest } from './public'; +import type { GetStakersResponse } from './public'; +import type { GetStakersRequest } from './public'; +import type { GetSelectorDrawsResponse } from './public'; +import type { GetSelectorDrawsRequest } from './public'; +import type { GetScExecutionEventsResponse } from './public'; +import type { GetScExecutionEventsRequest } from './public'; +import type { GetOperationsResponse } from './public'; +import type { GetOperationsRequest } from './public'; +import type { GetNextBlockBestParentsResponse } from './public'; +import type { GetNextBlockBestParentsRequest } from './public'; +import type { GetEndorsementsResponse } from './public'; +import type { GetEndorsementsRequest } from './public'; +import type { GetDatastoreEntriesResponse } from './public'; +import type { GetDatastoreEntriesRequest } from './public'; +import type { GetBlocksResponse } from './public'; +import type { GetBlocksRequest } from './public'; +import { stackIntercept } from '@protobuf-ts/runtime-rpc'; +import type { ExecuteReadOnlyCallResponse } from './public'; +import type { ExecuteReadOnlyCallRequest } from './public'; +import type { UnaryCall } from '@protobuf-ts/runtime-rpc'; +import type { RpcOptions } from '@protobuf-ts/runtime-rpc'; +/** + * Massa public gRPC service + * + * @generated from protobuf service massa.api.v1.PublicService + */ +export interface IPublicServiceClient { + /** + * Execute read only call + * + * @generated from protobuf rpc: ExecuteReadOnlyCall(massa.api.v1.ExecuteReadOnlyCallRequest) returns (massa.api.v1.ExecuteReadOnlyCallResponse); + */ + executeReadOnlyCall( + input: ExecuteReadOnlyCallRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get blocks by ids + * + * @generated from protobuf rpc: GetBlocks(massa.api.v1.GetBlocksRequest) returns (massa.api.v1.GetBlocksResponse); + */ + getBlocks( + input: GetBlocksRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get datastore entries + * + * @generated from protobuf rpc: GetDatastoreEntries(massa.api.v1.GetDatastoreEntriesRequest) returns (massa.api.v1.GetDatastoreEntriesResponse); + */ + getDatastoreEntries( + input: GetDatastoreEntriesRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get endorsements by ids + * + * @generated from protobuf rpc: GetEndorsements(massa.api.v1.GetEndorsementsRequest) returns (massa.api.v1.GetEndorsementsResponse); + */ + getEndorsements( + input: GetEndorsementsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get next block best parents + * + * @generated from protobuf rpc: GetNextBlockBestParents(massa.api.v1.GetNextBlockBestParentsRequest) returns (massa.api.v1.GetNextBlockBestParentsResponse); + */ + getNextBlockBestParents( + input: GetNextBlockBestParentsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get operations by ids + * + * @generated from protobuf rpc: GetOperations(massa.api.v1.GetOperationsRequest) returns (massa.api.v1.GetOperationsResponse); + */ + getOperations( + input: GetOperationsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get smart contracts execution events + * + * @generated from protobuf rpc: GetScExecutionEvents(massa.api.v1.GetScExecutionEventsRequest) returns (massa.api.v1.GetScExecutionEventsResponse); + */ + getScExecutionEvents( + input: GetScExecutionEventsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get selector draws + * + * @generated from protobuf rpc: GetSelectorDraws(massa.api.v1.GetSelectorDrawsRequest) returns (massa.api.v1.GetSelectorDrawsResponse); + */ + getSelectorDraws( + input: GetSelectorDrawsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get stakers + * + * @generated from protobuf rpc: GetStakers(massa.api.v1.GetStakersRequest) returns (massa.api.v1.GetStakersResponse); + */ + getStakers( + input: GetStakersRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get status + * + * @generated from protobuf rpc: GetStatus(massa.api.v1.GetStatusRequest) returns (massa.api.v1.GetStatusResponse); + */ + getStatus( + input: GetStatusRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Get transactions throughput + * + * @generated from protobuf rpc: GetTransactionsThroughput(massa.api.v1.GetTransactionsThroughputRequest) returns (massa.api.v1.GetTransactionsThroughputResponse); + */ + getTransactionsThroughput( + input: GetTransactionsThroughputRequest, + options?: RpcOptions, + ): UnaryCall< + GetTransactionsThroughputRequest, + GetTransactionsThroughputResponse + >; + /** + * Query state + * + * @generated from protobuf rpc: QueryState(massa.api.v1.QueryStateRequest) returns (massa.api.v1.QueryStateResponse); + */ + queryState( + input: QueryStateRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Search blocks + * + * @generated from protobuf rpc: SearchBlocks(massa.api.v1.SearchBlocksRequest) returns (massa.api.v1.SearchBlocksResponse); + */ + searchBlocks( + input: SearchBlocksRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Search endorsements + * + * @generated from protobuf rpc: SearchEndorsements(massa.api.v1.SearchEndorsementsRequest) returns (massa.api.v1.SearchEndorsementsResponse); + */ + searchEndorsements( + input: SearchEndorsementsRequest, + options?: RpcOptions, + ): UnaryCall; + /** + * Search operations + * + * @generated from protobuf rpc: SearchOperations(massa.api.v1.SearchOperationsRequest) returns (massa.api.v1.SearchOperationsResponse); + */ + searchOperations( + input: SearchOperationsRequest, + options?: RpcOptions, + ): UnaryCall; + // ███████╗████████╗██████╗ ███████╗ █████╗ ███╗ ███╗ + // ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██╔══██╗████╗ ████║ + // ███████╗ ██║ ██████╔╝█████╗ ███████║██╔████╔██║ + // ╚════██║ ██║ ██╔══██╗██╔══╝ ██╔══██║██║╚██╔╝██║ + // ███████║ ██║ ██║ ██║███████╗██║ ██║██║ ╚═╝ ██║ + + /** + * New received and produced blocks + * + * @generated from protobuf rpc: NewBlocks(stream massa.api.v1.NewBlocksRequest) returns (stream massa.api.v1.NewBlocksResponse); + */ + newBlocks( + options?: RpcOptions, + ): DuplexStreamingCall; + /** + * New received and produced endorsements + * + * @generated from protobuf rpc: NewEndorsements(stream massa.api.v1.NewEndorsementsRequest) returns (stream massa.api.v1.NewEndorsementsResponse); + */ + newEndorsements( + options?: RpcOptions, + ): DuplexStreamingCall; + /** + * New received and produced blocks with operations + * + * @generated from protobuf rpc: NewFilledBlocks(stream massa.api.v1.NewFilledBlocksRequest) returns (stream massa.api.v1.NewFilledBlocksResponse); + */ + newFilledBlocks( + options?: RpcOptions, + ): DuplexStreamingCall; + /** + * New received and produced operations + * + * @generated from protobuf rpc: NewOperations(stream massa.api.v1.NewOperationsRequest) returns (stream massa.api.v1.NewOperationsResponse); + */ + newOperations( + options?: RpcOptions, + ): DuplexStreamingCall; + /** + * New received and slot execution events + * + * @generated from protobuf rpc: NewSlotExecutionOutputs(stream massa.api.v1.NewSlotExecutionOutputsRequest) returns (stream massa.api.v1.NewSlotExecutionOutputsResponse); + */ + newSlotExecutionOutputs( + options?: RpcOptions, + ): DuplexStreamingCall< + NewSlotExecutionOutputsRequest, + NewSlotExecutionOutputsResponse + >; + /** + * unidirectional streaming + * + * @generated from protobuf rpc: NewSlotExecutionOutputsServer(massa.api.v1.NewSlotExecutionOutputsRequest) returns (stream massa.api.v1.NewSlotExecutionOutputsResponse); + */ + newSlotExecutionOutputsServer( + input: NewSlotExecutionOutputsRequest, + options?: RpcOptions, + ): ServerStreamingCall< + NewSlotExecutionOutputsRequest, + NewSlotExecutionOutputsResponse + >; + /** + * Send blocks + * + * @generated from protobuf rpc: SendBlocks(stream massa.api.v1.SendBlocksRequest) returns (stream massa.api.v1.SendBlocksResponse); + */ + sendBlocks( + options?: RpcOptions, + ): DuplexStreamingCall; + /** + * Send endorsements + * + * @generated from protobuf rpc: SendEndorsements(stream massa.api.v1.SendEndorsementsRequest) returns (stream massa.api.v1.SendEndorsementsResponse); + */ + sendEndorsements( + options?: RpcOptions, + ): DuplexStreamingCall; + /** + * Send operations + * + * @generated from protobuf rpc: SendOperations(stream massa.api.v1.SendOperationsRequest) returns (stream massa.api.v1.SendOperationsResponse); + */ + sendOperations( + options?: RpcOptions, + ): DuplexStreamingCall; + /** + * Transactions throughput + * + * @generated from protobuf rpc: TransactionsThroughput(stream massa.api.v1.TransactionsThroughputRequest) returns (stream massa.api.v1.TransactionsThroughputResponse); + */ + transactionsThroughput( + options?: RpcOptions, + ): DuplexStreamingCall< + TransactionsThroughputRequest, + TransactionsThroughputResponse + >; +} +/** + * Massa public gRPC service + * + * @generated from protobuf service massa.api.v1.PublicService + */ +export class PublicServiceClient implements IPublicServiceClient, ServiceInfo { + typeName = PublicService.typeName; + methods = PublicService.methods; + options = PublicService.options; + constructor(private readonly _transport: RpcTransport) {} + /** + * Execute read only call + * + * @generated from protobuf rpc: ExecuteReadOnlyCall(massa.api.v1.ExecuteReadOnlyCallRequest) returns (massa.api.v1.ExecuteReadOnlyCallResponse); + */ + executeReadOnlyCall( + input: ExecuteReadOnlyCallRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[0]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + ExecuteReadOnlyCallRequest, + ExecuteReadOnlyCallResponse + >('unary', this._transport, method, opt, input); + } + /** + * Get blocks by ids + * + * @generated from protobuf rpc: GetBlocks(massa.api.v1.GetBlocksRequest) returns (massa.api.v1.GetBlocksResponse); + */ + getBlocks( + input: GetBlocksRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[1]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get datastore entries + * + * @generated from protobuf rpc: GetDatastoreEntries(massa.api.v1.GetDatastoreEntriesRequest) returns (massa.api.v1.GetDatastoreEntriesResponse); + */ + getDatastoreEntries( + input: GetDatastoreEntriesRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[2]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + GetDatastoreEntriesRequest, + GetDatastoreEntriesResponse + >('unary', this._transport, method, opt, input); + } + /** + * Get endorsements by ids + * + * @generated from protobuf rpc: GetEndorsements(massa.api.v1.GetEndorsementsRequest) returns (massa.api.v1.GetEndorsementsResponse); + */ + getEndorsements( + input: GetEndorsementsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[3]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get next block best parents + * + * @generated from protobuf rpc: GetNextBlockBestParents(massa.api.v1.GetNextBlockBestParentsRequest) returns (massa.api.v1.GetNextBlockBestParentsResponse); + */ + getNextBlockBestParents( + input: GetNextBlockBestParentsRequest, + options?: RpcOptions, + ): UnaryCall< + GetNextBlockBestParentsRequest, + GetNextBlockBestParentsResponse + > { + const method = this.methods[4]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + GetNextBlockBestParentsRequest, + GetNextBlockBestParentsResponse + >('unary', this._transport, method, opt, input); + } + /** + * Get operations by ids + * + * @generated from protobuf rpc: GetOperations(massa.api.v1.GetOperationsRequest) returns (massa.api.v1.GetOperationsResponse); + */ + getOperations( + input: GetOperationsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[5]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get smart contracts execution events + * + * @generated from protobuf rpc: GetScExecutionEvents(massa.api.v1.GetScExecutionEventsRequest) returns (massa.api.v1.GetScExecutionEventsResponse); + */ + getScExecutionEvents( + input: GetScExecutionEventsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[6]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + GetScExecutionEventsRequest, + GetScExecutionEventsResponse + >('unary', this._transport, method, opt, input); + } + /** + * Get selector draws + * + * @generated from protobuf rpc: GetSelectorDraws(massa.api.v1.GetSelectorDrawsRequest) returns (massa.api.v1.GetSelectorDrawsResponse); + */ + getSelectorDraws( + input: GetSelectorDrawsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[7]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get stakers + * + * @generated from protobuf rpc: GetStakers(massa.api.v1.GetStakersRequest) returns (massa.api.v1.GetStakersResponse); + */ + getStakers( + input: GetStakersRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[8]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get status + * + * @generated from protobuf rpc: GetStatus(massa.api.v1.GetStatusRequest) returns (massa.api.v1.GetStatusResponse); + */ + getStatus( + input: GetStatusRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[9]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Get transactions throughput + * + * @generated from protobuf rpc: GetTransactionsThroughput(massa.api.v1.GetTransactionsThroughputRequest) returns (massa.api.v1.GetTransactionsThroughputResponse); + */ + getTransactionsThroughput( + input: GetTransactionsThroughputRequest, + options?: RpcOptions, + ): UnaryCall< + GetTransactionsThroughputRequest, + GetTransactionsThroughputResponse + > { + const method = this.methods[10]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + GetTransactionsThroughputRequest, + GetTransactionsThroughputResponse + >('unary', this._transport, method, opt, input); + } + /** + * Query state + * + * @generated from protobuf rpc: QueryState(massa.api.v1. ) returns (massa.api.v1.QueryStateResponse); + */ + queryState( + input: QueryStateRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[11]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Search blocks + * + * @generated from protobuf rpc: SearchBlocks(massa.api.v1.SearchBlocksRequest) returns (massa.api.v1.SearchBlocksResponse); + */ + searchBlocks( + input: SearchBlocksRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[12]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + /** + * Search endorsements + * + * @generated from protobuf rpc: SearchEndorsements(massa.api.v1.SearchEndorsementsRequest) returns (massa.api.v1.SearchEndorsementsResponse); + */ + searchEndorsements( + input: SearchEndorsementsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[13]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + SearchEndorsementsRequest, + SearchEndorsementsResponse + >('unary', this._transport, method, opt, input); + } + /** + * Search operations + * + * @generated from protobuf rpc: SearchOperations(massa.api.v1.SearchOperationsRequest) returns (massa.api.v1.SearchOperationsResponse); + */ + searchOperations( + input: SearchOperationsRequest, + options?: RpcOptions, + ): UnaryCall { + const method = this.methods[14]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'unary', + this._transport, + method, + opt, + input, + ); + } + // ███████╗████████╗██████╗ ███████╗ █████╗ ███╗ ███╗ + // ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██╔══██╗████╗ ████║ + // ███████╗ ██║ ██████╔╝█████╗ ███████║██╔████╔██║ + // ╚════██║ ██║ ██╔══██╗██╔══╝ ██╔══██║██║╚██╔╝██║ + // ███████║ ██║ ██║ ██║███████╗██║ ██║██║ ╚═╝ ██║ + + /** + * New received and produced blocks + * + * @generated from protobuf rpc: NewBlocks(stream massa.api.v1.NewBlocksRequest) returns (stream massa.api.v1.NewBlocksResponse); + */ + newBlocks( + options?: RpcOptions, + ): DuplexStreamingCall { + const method = this.methods[15]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'duplex', + this._transport, + method, + opt, + ); + } + /** + * New received and produced endorsements + * + * @generated from protobuf rpc: NewEndorsements(stream massa.api.v1.NewEndorsementsRequest) returns (stream massa.api.v1.NewEndorsementsResponse); + */ + newEndorsements( + options?: RpcOptions, + ): DuplexStreamingCall { + const method = this.methods[16]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'duplex', + this._transport, + method, + opt, + ); + } + /** + * New received and produced blocks with operations + * + * @generated from protobuf rpc: NewFilledBlocks(stream massa.api.v1.NewFilledBlocksRequest) returns (stream massa.api.v1.NewFilledBlocksResponse); + */ + newFilledBlocks( + options?: RpcOptions, + ): DuplexStreamingCall { + const method = this.methods[17]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'duplex', + this._transport, + method, + opt, + ); + } + /** + * New received and produced operations + * + * @generated from protobuf rpc: NewOperations(stream massa.api.v1.NewOperationsRequest) returns (stream massa.api.v1.NewOperationsResponse); + */ + newOperations( + options?: RpcOptions, + ): DuplexStreamingCall { + const method = this.methods[18]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'duplex', + this._transport, + method, + opt, + ); + } + /** + * New received and slot execution events + * + * @generated from protobuf rpc: NewSlotExecutionOutputs(stream massa.api.v1.NewSlotExecutionOutputsRequest) returns (stream massa.api.v1.NewSlotExecutionOutputsResponse); + */ + newSlotExecutionOutputs( + options?: RpcOptions, + ): DuplexStreamingCall< + NewSlotExecutionOutputsRequest, + NewSlotExecutionOutputsResponse + > { + const method = this.methods[19]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + NewSlotExecutionOutputsRequest, + NewSlotExecutionOutputsResponse + >('duplex', this._transport, method, opt); + } + /** + * unidirectional streaming + * + * @generated from protobuf rpc: NewSlotExecutionOutputsServer(massa.api.v1.NewSlotExecutionOutputsRequest) returns (stream massa.api.v1.NewSlotExecutionOutputsResponse); + */ + newSlotExecutionOutputsServer( + input: NewSlotExecutionOutputsRequest, + options?: RpcOptions, + ): ServerStreamingCall< + NewSlotExecutionOutputsRequest, + NewSlotExecutionOutputsResponse + > { + const method = this.methods[20]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + NewSlotExecutionOutputsRequest, + NewSlotExecutionOutputsResponse + >('serverStreaming', this._transport, method, opt, input); + } + /** + * Send blocks + * + * @generated from protobuf rpc: SendBlocks(stream massa.api.v1.SendBlocksRequest) returns (stream massa.api.v1.SendBlocksResponse); + */ + sendBlocks( + options?: RpcOptions, + ): DuplexStreamingCall { + const method = this.methods[21]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'duplex', + this._transport, + method, + opt, + ); + } + /** + * Send endorsements + * + * @generated from protobuf rpc: SendEndorsements(stream massa.api.v1.SendEndorsementsRequest) returns (stream massa.api.v1.SendEndorsementsResponse); + */ + sendEndorsements( + options?: RpcOptions, + ): DuplexStreamingCall { + const method = this.methods[22]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'duplex', + this._transport, + method, + opt, + ); + } + /** + * Send operations + * + * @generated from protobuf rpc: SendOperations(stream massa.api.v1.SendOperationsRequest) returns (stream massa.api.v1.SendOperationsResponse); + */ + sendOperations( + options?: RpcOptions, + ): DuplexStreamingCall { + const method = this.methods[23]; + const opt = this._transport.mergeOptions(options); + return stackIntercept( + 'duplex', + this._transport, + method, + opt, + ); + } + /** + * Transactions throughput + * + * @generated from protobuf rpc: TransactionsThroughput(stream massa.api.v1.TransactionsThroughputRequest) returns (stream massa.api.v1.TransactionsThroughputResponse); + */ + transactionsThroughput( + options?: RpcOptions, + ): DuplexStreamingCall< + TransactionsThroughputRequest, + TransactionsThroughputResponse + > { + const method = this.methods[24]; + const opt = this._transport.mergeOptions(options); + return stackIntercept< + TransactionsThroughputRequest, + TransactionsThroughputResponse + >('duplex', this._transport, method, opt); + } +} diff --git a/frontend/src/proto-gen/massa/api/v1/public.ts b/frontend/src/proto-gen/massa/api/v1/public.ts new file mode 100644 index 0000000..94a88cb --- /dev/null +++ b/frontend/src/proto-gen/massa/api/v1/public.ts @@ -0,0 +1,12387 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/api/v1/public.proto" (package "massa.api.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +// @ts-nocheck +import { ServiceType } from '@protobuf-ts/runtime-rpc'; +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { OperationInfo } from '../../model/v1/operation'; +import { EndorsementInfo } from '../../model/v1/endorsement'; +import { BlockInfo } from '../../model/v1/block'; +import { UInt64Value } from '../../../google/protobuf/wrappers'; +import { SlotExecutionOutput } from '../../model/v1/execution'; +import { AsyncPoolChangeType } from '../../model/v1/execution'; +import { Empty } from '../../model/v1/commons'; +import { ExecutionOutputStatus } from '../../model/v1/execution'; +import { SignedOperation } from '../../model/v1/operation'; +import { OpTypes } from '../../model/v1/operation'; +import { OperationIds } from '../../model/v1/operation'; +import { FilledBlock } from '../../model/v1/block'; +import { SignedEndorsement } from '../../model/v1/endorsement'; +import { EndorsementIds } from '../../model/v1/endorsement'; +import { SignedBlock } from '../../model/v1/block'; +import { BlockIds } from '../../model/v1/block'; +import { ArrayOfBytesWrapper } from '../../model/v1/commons'; +import { NativeAmount } from '../../model/v1/amount'; +import { Error } from '../../model/v1/commons'; +import { Slot } from '../../model/v1/slot'; +import { DenunciationIndex } from '../../model/v1/denunciation'; +import { StakerEntry } from '../../model/v1/staker'; +import { SlotDraw } from '../../model/v1/draw'; +import { Addresses } from '../../model/v1/address'; +import { PublicStatus } from '../../model/v1/node'; +import { ScExecutionEvent } from '../../model/v1/execution'; +import { ScExecutionEventStatus } from '../../model/v1/execution'; +import { SlotRange } from '../../model/v1/slot'; +import { OperationWrapper } from '../../model/v1/operation'; +import { BlockParent } from '../../model/v1/block'; +import { EndorsementWrapper } from '../../model/v1/endorsement'; +import { DatastoreEntry } from '../../model/v1/datastore'; +import { AddressKeyEntry } from '../../model/v1/datastore'; +import { BlockWrapper } from '../../model/v1/block'; +import { ReadOnlyExecutionOutput } from '../../model/v1/execution'; +import { ReadOnlyExecutionCall } from '../../model/v1/execution'; +/** + * ExecuteReadOnlyCallRequest holds request for ExecuteReadOnlyCall + * + * @generated from protobuf message massa.api.v1.ExecuteReadOnlyCallRequest + */ +export interface ExecuteReadOnlyCallRequest { + /** + * Execution call + * + * @generated from protobuf field: massa.model.v1.ReadOnlyExecutionCall call = 1; + */ + call?: ReadOnlyExecutionCall; +} +/** + * ExecuteReadOnlyCallResponse holds response from ExecuteReadOnlyCall + * + * @generated from protobuf message massa.api.v1.ExecuteReadOnlyCallResponse + */ +export interface ExecuteReadOnlyCallResponse { + /** + * Execution output + * + * @generated from protobuf field: massa.model.v1.ReadOnlyExecutionOutput output = 1; + */ + output?: ReadOnlyExecutionOutput; +} +/** + * GetBlocksRequest holds request for GetBlocks + * + * @generated from protobuf message massa.api.v1.GetBlocksRequest + */ +export interface GetBlocksRequest { + /** + * Block ids + * + * @generated from protobuf field: repeated string block_ids = 1; + */ + blockIds: string[]; +} +/** + * GetBlocksResponse holds response from GetBlocks + * + * @generated from protobuf message massa.api.v1.GetBlocksResponse + */ +export interface GetBlocksResponse { + /** + * Wrapped blocks + * + * @generated from protobuf field: repeated massa.model.v1.BlockWrapper wrapped_blocks = 1; + */ + wrappedBlocks: BlockWrapper[]; +} +/** + * GetDatastoreEntriesRequest holds request from GetDatastoreEntries + * + * @generated from protobuf message massa.api.v1.GetDatastoreEntriesRequest + */ +export interface GetDatastoreEntriesRequest { + /** + * Returns all the datastore entries that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.GetDatastoreEntryFilter filters = 1; + */ + filters: GetDatastoreEntryFilter[]; +} +/** + * DatastoreEntryFilter + * + * @generated from protobuf message massa.api.v1.GetDatastoreEntryFilter + */ +export interface GetDatastoreEntryFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'addressKey'; + /** + * One of these (address-key) pairs + * + * @generated from protobuf field: massa.model.v1.AddressKeyEntry address_key = 1; + */ + addressKey: AddressKeyEntry; + } + | { + oneofKind: undefined; + }; +} +/** + * GetDatastoreEntriesResponse holds response from GetDatastoreEntries + * + * @generated from protobuf message massa.api.v1.GetDatastoreEntriesResponse + */ +export interface GetDatastoreEntriesResponse { + /** + * Datastore entries + * + * @generated from protobuf field: repeated massa.model.v1.DatastoreEntry datastore_entries = 1; + */ + datastoreEntries: DatastoreEntry[]; +} +/** + * GetEndorsementsRequest holds request for GetEndorsements + * + * @generated from protobuf message massa.api.v1.GetEndorsementsRequest + */ +export interface GetEndorsementsRequest { + /** + * Endorsement ids + * + * @generated from protobuf field: repeated string endorsement_ids = 1; + */ + endorsementIds: string[]; +} +/** + * GetEndorsementsResponse holds response from GetEndorsements + * + * @generated from protobuf message massa.api.v1.GetEndorsementsResponse + */ +export interface GetEndorsementsResponse { + /** + * Wrapped operations + * + * @generated from protobuf field: repeated massa.model.v1.EndorsementWrapper wrapped_endorsements = 1; + */ + wrappedEndorsements: EndorsementWrapper[]; +} +/** + * GetNextBlockBestParentsRequest holds request for GetNextBlockBestParents + * + * @generated from protobuf message massa.api.v1.GetNextBlockBestParentsRequest + */ +export interface GetNextBlockBestParentsRequest {} +/** + * GetNextBlockBestParentsResponse holds response from GetNextBlockBestParents + * + * @generated from protobuf message massa.api.v1.GetNextBlockBestParentsResponse + */ +export interface GetNextBlockBestParentsResponse { + /** + * Next block best parents + * + * @generated from protobuf field: repeated massa.model.v1.BlockParent block_parents = 1; + */ + blockParents: BlockParent[]; +} +/** + * GetOperationsRequest holds request for GetOperations + * + * @generated from protobuf message massa.api.v1.GetOperationsRequest + */ +export interface GetOperationsRequest { + /** + * Operation ids + * + * @generated from protobuf field: repeated string operation_ids = 1; + */ + operationIds: string[]; +} +/** + * GetOperationsResponse holds response from GetOperations + * + * @generated from protobuf message massa.api.v1.GetOperationsResponse + */ +export interface GetOperationsResponse { + /** + * Wrapped operations + * + * @generated from protobuf field: repeated massa.model.v1.OperationWrapper wrapped_operations = 1; + */ + wrappedOperations: OperationWrapper[]; +} +/** + * GetScExecutionEventsRequest holds request for GetScExecutionEvents + * + * @generated from protobuf message massa.api.v1.GetScExecutionEventsRequest + */ +export interface GetScExecutionEventsRequest { + /** + * Returns all the sc execution events that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.ScExecutionEventsFilter filters = 1; + */ + filters: ScExecutionEventsFilter[]; +} +/** + * ScExecutionEvents Filter + * + * @generated from protobuf message massa.api.v1.ScExecutionEventsFilter + */ +export interface ScExecutionEventsFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'slotRange'; + /** + * Slot range + * + * @generated from protobuf field: massa.model.v1.SlotRange slot_range = 1; + */ + slotRange: SlotRange; + } + | { + oneofKind: 'callerAddress'; + /** + * Caller address + * + * @generated from protobuf field: string caller_address = 2; + */ + callerAddress: string; + } + | { + oneofKind: 'emitterAddress'; + /** + * Emitter address + * + * @generated from protobuf field: string emitter_address = 3; + */ + emitterAddress: string; + } + | { + oneofKind: 'originalOperationId'; + /** + * Original operation id + * + * @generated from protobuf field: string original_operation_id = 4; + */ + originalOperationId: string; + } + | { + oneofKind: 'isFailure'; + /** + * Whether the event is a failure + * + * @generated from protobuf field: bool is_failure = 5; + */ + isFailure: boolean; + } + | { + oneofKind: 'status'; + /** + * Status + * + * @generated from protobuf field: massa.model.v1.ScExecutionEventStatus status = 6; + */ + status: ScExecutionEventStatus; + } + | { + oneofKind: undefined; + }; +} +/** + * GetScExecutionEventsResponse holds response from GetScExecutionEvents + * + * @generated from protobuf message massa.api.v1.GetScExecutionEventsResponse + */ +export interface GetScExecutionEventsResponse { + /** + * ScExecutionEvents + * + * @generated from protobuf field: repeated massa.model.v1.ScExecutionEvent events = 1; + */ + events: ScExecutionEvent[]; +} +/** + * GetStatusRequest holds request from GetStatus + * + * @generated from protobuf message massa.api.v1.GetStatusRequest + */ +export interface GetStatusRequest {} +/** + * GetStatusResponse holds request from GetStatus + * + * @generated from protobuf message massa.api.v1.GetStatusResponse + */ +export interface GetStatusResponse { + /** + * Status + * + * @generated from protobuf field: massa.model.v1.PublicStatus status = 1; + */ + status?: PublicStatus; +} +/** + * GetSelectorDrawsRequest holds request from GetSelectorDraws + * + * @generated from protobuf message massa.api.v1.GetSelectorDrawsRequest + */ +export interface GetSelectorDrawsRequest { + /** + * Returns all the selector draws that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.SelectorDrawsFilter filters = 1; + */ + filters: SelectorDrawsFilter[]; +} +/** + * SelectorDraws Filter + * + * @generated from protobuf message massa.api.v1.SelectorDrawsFilter + */ +export interface SelectorDrawsFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'addresses'; + /** + * One of the Addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 1; + */ + addresses: Addresses; + } + | { + oneofKind: 'slotRange'; + /** + * One of the Slot range + * + * @generated from protobuf field: massa.model.v1.SlotRange slot_range = 2; + */ + slotRange: SlotRange; + } + | { + oneofKind: undefined; + }; +} +/** + * GetSelectorDrawsResponse holds response from GetSelectorDraws + * + * @generated from protobuf message massa.api.v1.GetSelectorDrawsResponse + */ +export interface GetSelectorDrawsResponse { + /** + * Selector draws + * + * @generated from protobuf field: repeated massa.model.v1.SlotDraw draws = 1; + */ + draws: SlotDraw[]; +} +/** + * GetStakersRequest holds request from GetStakers + * + * @generated from protobuf message massa.api.v1.GetStakersRequest + */ +export interface GetStakersRequest { + /** + * Returns all the stakers that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.StakersFilter filters = 1; + */ + filters: StakersFilter[]; +} +/** + * Stakers Filter + * + * @generated from protobuf message massa.api.v1.StakersFilter + */ +export interface StakersFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'minRolls'; + /** + * Minimum rolls + * + * @generated from protobuf field: uint64 min_rolls = 1; + */ + minRolls: bigint; + } + | { + oneofKind: 'maxRolls'; + /** + * Maximum rolls + * + * @generated from protobuf field: uint64 max_rolls = 2; + */ + maxRolls: bigint; + } + | { + oneofKind: 'limit'; + /** + * Limit + * + * @generated from protobuf field: uint64 limit = 3; + */ + limit: bigint; + } + | { + oneofKind: undefined; + }; +} +/** + * GetStakersResponse holds response from GetStakers + * + * @generated from protobuf message massa.api.v1.GetStakersResponse + */ +export interface GetStakersResponse { + /** + * Stakers + * + * @generated from protobuf field: repeated massa.model.v1.StakerEntry stakers = 1; + */ + stakers: StakerEntry[]; +} +/** + * GetTransactionsThroughputRequest holds request for GetTransactionsThroughput + * + * @generated from protobuf message massa.api.v1.GetTransactionsThroughputRequest + */ +export interface GetTransactionsThroughputRequest {} +/** + * GetTransactionsThroughputResponse holds response from GetTransactionsThroughput + * + * @generated from protobuf message massa.api.v1.GetTransactionsThroughputResponse + */ +export interface GetTransactionsThroughputResponse { + /** + * Transactions throughput + * + * @generated from protobuf field: uint32 throughput = 1; + */ + throughput: number; +} +/** + * Request to atomically execute a batch of execution state queries + * + * @generated from protobuf message massa.api.v1.QueryStateRequest + */ +export interface QueryStateRequest { + /** + * Execution queries + * + * @generated from protobuf field: repeated massa.api.v1.ExecutionQueryRequestItem queries = 1; + */ + queries: ExecutionQueryRequestItem[]; +} +/** + * Query state query item + * + * @generated from protobuf message massa.api.v1.ExecutionQueryRequestItem + */ +export interface ExecutionQueryRequestItem { + /** + * @generated from protobuf oneof: request_item + */ + requestItem: + | { + oneofKind: 'addressExistsCandidate'; + /** + * Checks if address exists (candidate) + * + * @generated from protobuf field: massa.api.v1.AddressExistsCandidate address_exists_candidate = 1; + */ + addressExistsCandidate: AddressExistsCandidate; + } + | { + oneofKind: 'addressExistsFinal'; + /** + * Checks if address exists (final) + * + * @generated from protobuf field: massa.api.v1.AddressExistsFinal address_exists_final = 2; + */ + addressExistsFinal: AddressExistsFinal; + } + | { + oneofKind: 'addressBalanceCandidate'; + /** + * Gets the balance (candidate) of an address + * + * @generated from protobuf field: massa.api.v1.AddressBalanceCandidate address_balance_candidate = 3; + */ + addressBalanceCandidate: AddressBalanceCandidate; + } + | { + oneofKind: 'addressBalanceFinal'; + /** + * Gets the balance (final) of an address + * + * @generated from protobuf field: massa.api.v1.AddressBalanceFinal address_balance_final = 4; + */ + addressBalanceFinal: AddressBalanceFinal; + } + | { + oneofKind: 'addressBytecodeCandidate'; + /** + * Gets the bytecode (candidate) of an address + * + * @generated from protobuf field: massa.api.v1.AddressBytecodeCandidate address_bytecode_candidate = 5; + */ + addressBytecodeCandidate: AddressBytecodeCandidate; + } + | { + oneofKind: 'addressBytecodeFinal'; + /** + * Gets the bytecode (final) of an address + * + * @generated from protobuf field: massa.api.v1.AddressBytecodeFinal address_bytecode_final = 6; + */ + addressBytecodeFinal: AddressBytecodeFinal; + } + | { + oneofKind: 'addressDatastoreKeysCandidate'; + /** + * Gets the datastore keys (candidate) of an address + * + * @generated from protobuf field: massa.api.v1.AddressDatastoreKeysCandidate address_datastore_keys_candidate = 7; + */ + addressDatastoreKeysCandidate: AddressDatastoreKeysCandidate; + } + | { + oneofKind: 'addressDatastoreKeysFinal'; + /** + * Gets the datastore keys (final) of an address + * + * @generated from protobuf field: massa.api.v1.AddressDatastoreKeysFinal address_datastore_keys_final = 8; + */ + addressDatastoreKeysFinal: AddressDatastoreKeysFinal; + } + | { + oneofKind: 'addressDatastoreValueCandidate'; + /** + * Gets a datastore value (candidate) for an address + * + * @generated from protobuf field: massa.api.v1.AddressDatastoreValueCandidate address_datastore_value_candidate = 9; + */ + addressDatastoreValueCandidate: AddressDatastoreValueCandidate; + } + | { + oneofKind: 'addressDatastoreValueFinal'; + /** + * Gets a datastore value (final) for an address + * + * @generated from protobuf field: massa.api.v1.AddressDatastoreValueFinal address_datastore_value_final = 10; + */ + addressDatastoreValueFinal: AddressDatastoreValueFinal; + } + | { + oneofKind: 'opExecutionStatusCandidate'; + /** + * Gets the execution status (candidate) for an operation + * + * @generated from protobuf field: massa.api.v1.OpExecutionStatusCandidate op_execution_status_candidate = 11; + */ + opExecutionStatusCandidate: OpExecutionStatusCandidate; + } + | { + oneofKind: 'opExecutionStatusFinal'; + /** + * Gets the execution status (final) for an operation + * + * @generated from protobuf field: massa.api.v1.OpExecutionStatusFinal op_execution_status_final = 12; + */ + opExecutionStatusFinal: OpExecutionStatusFinal; + } + | { + oneofKind: 'denunciationExecutionStatusCandidate'; + /** + * Gets the execution status (candidate) for a denunciation + * + * @generated from protobuf field: massa.api.v1.DenunciationExecutionStatusCandidate denunciation_execution_status_candidate = 13; + */ + denunciationExecutionStatusCandidate: DenunciationExecutionStatusCandidate; + } + | { + oneofKind: 'denunciationExecutionStatusFinal'; + /** + * Gets the execution status (final) for a denunciation + * + * @generated from protobuf field: massa.api.v1.DenunciationExecutionStatusFinal denunciation_execution_status_final = 14; + */ + denunciationExecutionStatusFinal: DenunciationExecutionStatusFinal; + } + | { + oneofKind: 'addressRollsCandidate'; + /** + * Gets the roll count (candidate) of an address + * + * @generated from protobuf field: massa.api.v1.AddressRollsCandidate address_rolls_candidate = 15; + */ + addressRollsCandidate: AddressRollsCandidate; + } + | { + oneofKind: 'addressRollsFinal'; + /** + * Gets the roll count (final) of an address + * + * @generated from protobuf field: massa.api.v1.AddressRollsFinal address_rolls_final = 16; + */ + addressRollsFinal: AddressRollsFinal; + } + | { + oneofKind: 'addressDeferredCreditsCandidate'; + /** + * Gets the deferred credits (candidate) of an address + * + * @generated from protobuf field: massa.api.v1.AddressDeferredCreditsCandidate address_deferred_credits_candidate = 17; + */ + addressDeferredCreditsCandidate: AddressDeferredCreditsCandidate; + } + | { + oneofKind: 'addressDeferredCreditsFinal'; + /** + * Gets the deferred credits (final) of an address + * + * @generated from protobuf field: massa.api.v1.AddressDeferredCreditsFinal address_deferred_credits_final = 18; + */ + addressDeferredCreditsFinal: AddressDeferredCreditsFinal; + } + | { + oneofKind: 'cycleInfos'; + /** + * Gets all information for a given cycle + * + * @generated from protobuf field: massa.api.v1.CycleInfos cycle_infos = 19; + */ + cycleInfos: CycleInfos; + } + | { + oneofKind: 'events'; + /** + * Gets filtered events + * + * @generated from protobuf field: massa.api.v1.Events events = 20; + */ + events: Events; + } + | { + oneofKind: undefined; + }; +} +/** + * Request to check if address exists (candidate) + * + * @generated from protobuf message massa.api.v1.AddressExistsCandidate + */ +export interface AddressExistsCandidate { + /** + * Address to check + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to check if address exists (final) + * + * @generated from protobuf message massa.api.v1.AddressExistsFinal + */ +export interface AddressExistsFinal { + /** + * Address to check + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the balance (candidate) of an address + * + * @generated from protobuf message massa.api.v1.AddressBalanceCandidate + */ +export interface AddressBalanceCandidate { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the balance (final) of an address + * + * @generated from protobuf message massa.api.v1.AddressBalanceFinal + */ +export interface AddressBalanceFinal { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the bytecode (candidate) of an address + * + * @generated from protobuf message massa.api.v1.AddressBytecodeCandidate + */ +export interface AddressBytecodeCandidate { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the bytecode (final) of an address + * + * @generated from protobuf message massa.api.v1.AddressBytecodeFinal + */ +export interface AddressBytecodeFinal { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the datastore keys (candidate) of an address + * + * @generated from protobuf message massa.api.v1.AddressDatastoreKeysCandidate + */ +export interface AddressDatastoreKeysCandidate { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Prefix for the keys + * + * @generated from protobuf field: bytes prefix = 2; + */ + prefix: Uint8Array; +} +/** + * Request to get the datastore keys (final) of an address + * + * @generated from protobuf message massa.api.v1.AddressDatastoreKeysFinal + */ +export interface AddressDatastoreKeysFinal { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Prefix for the keys + * + * @generated from protobuf field: bytes prefix = 2; + */ + prefix: Uint8Array; +} +/** + * Request to get a datastore value (candidate) for an address + * + * @generated from protobuf message massa.api.v1.AddressDatastoreValueCandidate + */ +export interface AddressDatastoreValueCandidate { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Key for the value + * + * @generated from protobuf field: bytes key = 2; + */ + key: Uint8Array; +} +/** + * Request to get a datastore value (final) for an address + * + * @generated from protobuf message massa.api.v1.AddressDatastoreValueFinal + */ +export interface AddressDatastoreValueFinal { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Key for the value + * + * @generated from protobuf field: bytes key = 2; + */ + key: Uint8Array; +} +/** + * Request to get the execution status (candidate) for an operation + * + * @generated from protobuf message massa.api.v1.OpExecutionStatusCandidate + */ +export interface OpExecutionStatusCandidate { + /** + * Operation ID to query + * + * @generated from protobuf field: string operation_id = 1; + */ + operationId: string; +} +/** + * Request to get the execution status (final) for an operation + * + * @generated from protobuf message massa.api.v1.OpExecutionStatusFinal + */ +export interface OpExecutionStatusFinal { + /** + * Operation ID to query + * + * @generated from protobuf field: string operation_id = 1; + */ + operationId: string; +} +/** + * Request to get the execution status (candidate) for a denunciation + * + * @generated from protobuf message massa.api.v1.DenunciationExecutionStatusCandidate + */ +export interface DenunciationExecutionStatusCandidate { + /** + * Denunciation index to query + * + * @generated from protobuf field: massa.model.v1.DenunciationIndex denunciation_index = 1; + */ + denunciationIndex?: DenunciationIndex; +} +/** + * Request to get the execution status (final) for a denunciation + * + * @generated from protobuf message massa.api.v1.DenunciationExecutionStatusFinal + */ +export interface DenunciationExecutionStatusFinal { + /** + * Denunciation index to query + * + * @generated from protobuf field: massa.model.v1.DenunciationIndex denunciation_index = 1; + */ + denunciationIndex?: DenunciationIndex; +} +/** + * Request to get the roll count (candidate) of an address + * + * @generated from protobuf message massa.api.v1.AddressRollsCandidate + */ +export interface AddressRollsCandidate { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the roll count (final) of an address + * + * @generated from protobuf message massa.api.v1.AddressRollsFinal + */ +export interface AddressRollsFinal { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the deferred credits (candidate) of an address + * + * @generated from protobuf message massa.api.v1.AddressDeferredCreditsCandidate + */ +export interface AddressDeferredCreditsCandidate { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get the deferred credits (final) of an address + * + * @generated from protobuf message massa.api.v1.AddressDeferredCreditsFinal + */ +export interface AddressDeferredCreditsFinal { + /** + * Address to query + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * Request to get all information for a given cycle + * + * @generated from protobuf message massa.api.v1.CycleInfos + */ +export interface CycleInfos { + /** + * Cycle to query + * + * @generated from protobuf field: uint64 cycle = 1; + */ + cycle: bigint; + /** + * Addresses to restrict the query (if None, info for all addresses will be returned) + * + * @generated from protobuf field: repeated string restrict_to_addresses = 2; + */ + restrictToAddresses: string[]; +} +/** + * Request to get filtered events + * + * @generated from protobuf message massa.api.v1.Events + */ +export interface Events { + /** + * Returns all the events that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.ScExecutionEventsFilter filters = 1; + */ + filters: ScExecutionEventsFilter[]; +} +/** + * Response to atomically execute a batch of execution state queries + * + * @generated from protobuf message massa.api.v1.QueryStateResponse + */ +export interface QueryStateResponse { + /** + * Final cursor position + * + * @generated from protobuf field: massa.model.v1.Slot final_cursor = 1; + */ + finalCursor?: Slot; + /** + * Candidate cursor position + * + * @generated from protobuf field: massa.model.v1.Slot candidate_cursor = 2; + */ + candidateCursor?: Slot; + /** + * The hash of the XOF final state hash + * + * @generated from protobuf field: string final_state_fingerprint = 3; + */ + finalStateFingerprint: string; + /** + * List of execution query response items + * + * @generated from protobuf field: repeated massa.api.v1.ExecutionQueryResponse responses = 4; + */ + responses: ExecutionQueryResponse[]; +} +/** + * Execution state query response + * + * @generated from protobuf message massa.api.v1.ExecutionQueryResponse + */ +export interface ExecutionQueryResponse { + /** + * @generated from protobuf oneof: response + */ + response: + | { + oneofKind: 'result'; + /** + * Execution query response item + * + * @generated from protobuf field: massa.api.v1.ExecutionQueryResponseItem result = 1; + */ + result: ExecutionQueryResponseItem; + } + | { + oneofKind: 'error'; + /** + * Massa error + * + * @generated from protobuf field: massa.model.v1.Error error = 2; + */ + error: Error; + } + | { + oneofKind: undefined; + }; +} +/** + * Execution state query response item + * + * @generated from protobuf message massa.api.v1.ExecutionQueryResponseItem + */ +export interface ExecutionQueryResponseItem { + /** + * @generated from protobuf oneof: response_item + */ + responseItem: + | { + oneofKind: 'boolean'; + /** + * Boolean value + * + * @generated from protobuf field: bool boolean = 1; + */ + boolean: boolean; + } + | { + oneofKind: 'rollCount'; + /** + * Roll counts value + * + * @generated from protobuf field: uint64 roll_count = 2; + */ + rollCount: bigint; + } + | { + oneofKind: 'amount'; + /** + * Amount value + * + * @generated from protobuf field: massa.model.v1.NativeAmount amount = 3; + */ + amount: NativeAmount; + } + | { + oneofKind: 'bytes'; + /** + * Bytes value + * + * @generated from protobuf field: bytes bytes = 4; + */ + bytes: Uint8Array; + } + | { + oneofKind: 'vecBytes'; + /** + * Vector of bytes value + * + * @generated from protobuf field: massa.model.v1.ArrayOfBytesWrapper vec_bytes = 5; + */ + vecBytes: ArrayOfBytesWrapper; + } + | { + oneofKind: 'deferredCredits'; + /** + * Deferred credits value + * + * @generated from protobuf field: massa.api.v1.DeferredCreditsEntryWrapper deferred_credits = 6; + */ + deferredCredits: DeferredCreditsEntryWrapper; + } + | { + oneofKind: 'executionStatus'; + /** + * Execution status value + * + * @generated from protobuf field: massa.api.v1.ExecutionQueryExecutionStatus execution_status = 7; + */ + executionStatus: ExecutionQueryExecutionStatus; + } + | { + oneofKind: 'cycleInfos'; + /** + * Cycle infos value + * + * @generated from protobuf field: massa.api.v1.ExecutionQueryCycleInfos cycle_infos = 8; + */ + cycleInfos: ExecutionQueryCycleInfos; + } + | { + oneofKind: 'events'; + /** + * Events + * + * @generated from protobuf field: massa.api.v1.ScOutputEventsWrapper events = 9; + */ + events: ScOutputEventsWrapper; + } + | { + oneofKind: undefined; + }; +} +/** + * Deferred credits entry wrapper + * + * @generated from protobuf message massa.api.v1.DeferredCreditsEntryWrapper + */ +export interface DeferredCreditsEntryWrapper { + /** + * Deferred credits entry + * + * @generated from protobuf field: repeated massa.api.v1.DeferredCreditsEntry entries = 1; + */ + entries: DeferredCreditsEntry[]; +} +/** + * Deferred credits entry + * + * @generated from protobuf message massa.api.v1.DeferredCreditsEntry + */ +export interface DeferredCreditsEntry { + /** + * Slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; + /** + * Amount + * + * @generated from protobuf field: massa.model.v1.NativeAmount amount = 2; + */ + amount?: NativeAmount; +} +/** + * Cycle information for execution query + * + * @generated from protobuf message massa.api.v1.ExecutionQueryCycleInfos + */ +export interface ExecutionQueryCycleInfos { + /** + * Cycle number + * + * @generated from protobuf field: uint64 cycle = 1; + */ + cycle: bigint; + /** + * Whether the cycle is final + * + * @generated from protobuf field: bool is_final = 2; + */ + isFinal: boolean; + /** + * Infos for each PoS-participating address among the ones that were asked + * + * @generated from protobuf field: repeated massa.api.v1.ExecutionQueryStakerInfoEntry staker_infos = 3; + */ + stakerInfos: ExecutionQueryStakerInfoEntry[]; +} +/** + * Staker information for a given cycle + * + * @generated from protobuf message massa.api.v1.ExecutionQueryStakerInfoEntry + */ +export interface ExecutionQueryStakerInfoEntry { + /** + * Address of the staker + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Staker info + * + * @generated from protobuf field: massa.api.v1.ExecutionQueryStakerInfo info = 2; + */ + info?: ExecutionQueryStakerInfo; +} +/** + * Staker information for execution query + * + * @generated from protobuf message massa.api.v1.ExecutionQueryStakerInfo + */ +export interface ExecutionQueryStakerInfo { + /** + * Active roll count + * + * @generated from protobuf field: uint64 active_rolls = 1; + */ + activeRolls: bigint; + /** + * Production stats + * + * @generated from protobuf field: massa.api.v1.ExecutionQueryStakerInfoProductionStatsEntry production_stats = 2; + */ + productionStats?: ExecutionQueryStakerInfoProductionStatsEntry; +} +/** + * ExecutionQueryStakerInfoProductionStats entry + * + * @generated from protobuf message massa.api.v1.ExecutionQueryStakerInfoProductionStatsEntry + */ +export interface ExecutionQueryStakerInfoProductionStatsEntry { + /** + * Address of the staker + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Production failure + * + * @generated from protobuf field: massa.api.v1.ExecutionQueryStakerInfoProductionStats stats = 2; + */ + stats?: ExecutionQueryStakerInfoProductionStats; +} +/** + * Production statistics for staker info in execution query + * + * @generated from protobuf message massa.api.v1.ExecutionQueryStakerInfoProductionStats + */ +export interface ExecutionQueryStakerInfoProductionStats { + /** + * Production successes + * + * @generated from protobuf field: uint64 block_success_count = 1; + */ + blockSuccessCount: bigint; + /** + * Production failures + * + * @generated from protobuf field: uint64 block_failure_count = 2; + */ + blockFailureCount: bigint; +} +/** + * ScOutputEvents wrapper + * + * @generated from protobuf message massa.api.v1.ScOutputEventsWrapper + */ +export interface ScOutputEventsWrapper { + /** + * Events + * + * @generated from protobuf field: repeated massa.model.v1.ScExecutionEvent events = 1; + */ + events: ScExecutionEvent[]; +} +/** + * NewBlocksRequest holds request for NewBlocks + * + * @generated from protobuf message massa.api.v1.NewBlocksRequest + */ +export interface NewBlocksRequest { + /** + * Returns all the blocks that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.NewBlocksFilter filters = 1; + */ + filters: NewBlocksFilter[]; +} +/** + * NewBlocks Filter + * + * @generated from protobuf message massa.api.v1.NewBlocksFilter + */ +export interface NewBlocksFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'blockIds'; + /** + * One of these block ids + * + * @generated from protobuf field: massa.model.v1.BlockIds block_ids = 1; + */ + blockIds: BlockIds; + } + | { + oneofKind: 'addresses'; + /** + * One of these creator addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 2; + */ + addresses: Addresses; + } + | { + oneofKind: 'slotRange'; + /** + * One of these slot ranges (inclusive) + * + * @generated from protobuf field: massa.model.v1.SlotRange slot_range = 3; + */ + slotRange: SlotRange; + } + | { + oneofKind: undefined; + }; +} +/** + * NewBlocksResponse holds response from NewBlocks + * + * @generated from protobuf message massa.api.v1.NewBlocksResponse + */ +export interface NewBlocksResponse { + /** + * Signed block + * + * @generated from protobuf field: massa.model.v1.SignedBlock signed_block = 1; + */ + signedBlock?: SignedBlock; +} +/** + * NewEndorsementsRequest holds request for NewEndorsements + * + * @generated from protobuf message massa.api.v1.NewEndorsementsRequest + */ +export interface NewEndorsementsRequest { + /** + * Returns all the endorsements that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.NewEndorsementsFilter filters = 1; + */ + filters: NewEndorsementsFilter[]; +} +/** + * NewEndorsements Filter + * + * @generated from protobuf message massa.api.v1.NewEndorsementsFilter + */ +export interface NewEndorsementsFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'endorsementIds'; + /** + * One of these endorsement ids + * + * @generated from protobuf field: massa.model.v1.EndorsementIds endorsement_ids = 1; + */ + endorsementIds: EndorsementIds; + } + | { + oneofKind: 'addresses'; + /** + * One of these creator addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 2; + */ + addresses: Addresses; + } + | { + oneofKind: 'blockIds'; + /** + * One of these block ids + * + * @generated from protobuf field: massa.model.v1.BlockIds block_ids = 3; + */ + blockIds: BlockIds; + } + | { + oneofKind: undefined; + }; +} +/** + * NewEndorsementsResponse holds response from NewEndorsements + * + * @generated from protobuf message massa.api.v1.NewEndorsementsResponse + */ +export interface NewEndorsementsResponse { + /** + * Signed endorsement + * + * @generated from protobuf field: massa.model.v1.SignedEndorsement signed_endorsement = 1; + */ + signedEndorsement?: SignedEndorsement; +} +/** + * NewFilledBlocksRequest holds request for NewFilledBlocks + * + * @generated from protobuf message massa.api.v1.NewFilledBlocksRequest + */ +export interface NewFilledBlocksRequest { + /** + * Returns all the blocks that verify one of the filters + * + * @generated from protobuf field: repeated massa.api.v1.NewBlocksFilter filters = 1; + */ + filters: NewBlocksFilter[]; +} +/** + * NewFilledBlocks Filter + * + * @generated from protobuf message massa.api.v1.NewFilledBlocksFilter + */ +export interface NewFilledBlocksFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'blockIds'; + /** + * One of these block ids + * + * @generated from protobuf field: massa.model.v1.BlockIds block_ids = 1; + */ + blockIds: BlockIds; + } + | { + oneofKind: 'addresses'; + /** + * One of these creator addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 2; + */ + addresses: Addresses; + } + | { + oneofKind: 'slotRange'; + /** + * One of these slot ranges (inclusive) + * + * @generated from protobuf field: massa.model.v1.SlotRange slot_range = 3; + */ + slotRange: SlotRange; + } + | { + oneofKind: undefined; + }; +} +/** + * NewFilledBlocksResponse holds response from NewFilledBlocks + * + * @generated from protobuf message massa.api.v1.NewFilledBlocksResponse + */ +export interface NewFilledBlocksResponse { + /** + * Block with operations content found in the node. + * + * @generated from protobuf field: massa.model.v1.FilledBlock filled_block = 1; + */ + filledBlock?: FilledBlock; +} +/** + * NewOperationsRequest holds request for NewOperations + * + * @generated from protobuf message massa.api.v1.NewOperationsRequest + */ +export interface NewOperationsRequest { + /** + * Returns all the operations that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.NewOperationsFilter filters = 1; + */ + filters: NewOperationsFilter[]; +} +/** + * NewOperations Filter + * + * @generated from protobuf message massa.api.v1.NewOperationsFilter + */ +export interface NewOperationsFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'operationIds'; + /** + * One of the operation ids + * + * @generated from protobuf field: massa.model.v1.OperationIds operation_ids = 1; + */ + operationIds: OperationIds; + } + | { + oneofKind: 'addresses'; + /** + * One of these creator addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 2; + */ + addresses: Addresses; + } + | { + oneofKind: 'operationTypes'; + /** + * One of the operation types + * + * @generated from protobuf field: massa.model.v1.OpTypes operation_types = 3; + */ + operationTypes: OpTypes; + } + | { + oneofKind: undefined; + }; +} +/** + * NewOperationsResponse holds response from NewOperations + * + * @generated from protobuf message massa.api.v1.NewOperationsResponse + */ +export interface NewOperationsResponse { + /** + * Signed operation + * + * @generated from protobuf field: massa.model.v1.SignedOperation signed_operation = 1; + */ + signedOperation?: SignedOperation; +} +/** + * NewSlotExecutionOutputsRequest holds request for NewSlotExecutionOutputs + * + * @generated from protobuf message massa.api.v1.NewSlotExecutionOutputsRequest + */ +export interface NewSlotExecutionOutputsRequest { + /** + * Returns all the slot execution outputs that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.NewSlotExecutionOutputsFilter filters = 1; + */ + filters: NewSlotExecutionOutputsFilter[]; +} +/** + * NewSlotExecutionOutputs Filter + * + * @generated from protobuf message massa.api.v1.NewSlotExecutionOutputsFilter + */ +export interface NewSlotExecutionOutputsFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'status'; + /** + * Execution output status + * + * @generated from protobuf field: massa.model.v1.ExecutionOutputStatus status = 1; + */ + status: ExecutionOutputStatus; + } + | { + oneofKind: 'slotRange'; + /** + * Slot range + * + * @generated from protobuf field: massa.model.v1.SlotRange slot_range = 2; + */ + slotRange: SlotRange; + } + | { + oneofKind: 'asyncPoolChangesFilter'; + /** + * AsyncPoolChangesFilter + * + * @generated from protobuf field: massa.api.v1.AsyncPoolChangesFilter async_pool_changes_filter = 3; + */ + asyncPoolChangesFilter: AsyncPoolChangesFilter; + } + | { + oneofKind: 'executedDenounciationFilter'; + /** + * ExecutedDenounciationFilter + * + * @generated from protobuf field: massa.api.v1.ExecutedDenounciationFilter executed_denounciation_filter = 4; + */ + executedDenounciationFilter: ExecutedDenounciationFilter; + } + | { + oneofKind: 'eventFilter'; + /** + * Execution event filter + * + * @generated from protobuf field: massa.api.v1.ExecutionEventFilter event_filter = 5; + */ + eventFilter: ExecutionEventFilter; + } + | { + oneofKind: 'executedOpsChangesFilter'; + /** + * ExecutedOpsChangesFilter + * + * @generated from protobuf field: massa.api.v1.ExecutedOpsChangesFilter executed_ops_changes_filter = 6; + */ + executedOpsChangesFilter: ExecutedOpsChangesFilter; + } + | { + oneofKind: 'ledgerChangesFilter'; + /** + * LedgerChangesFilter + * + * @generated from protobuf field: massa.api.v1.LedgerChangesFilter ledger_changes_filter = 7; + */ + ledgerChangesFilter: LedgerChangesFilter; + } + | { + oneofKind: undefined; + }; +} +/** + * AsyncPoolChangesFilter + * + * @generated from protobuf message massa.api.v1.AsyncPoolChangesFilter + */ +export interface AsyncPoolChangesFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'none'; + /** + * Do not return any message + * + * @generated from protobuf field: massa.model.v1.Empty none = 1; + */ + none: Empty; + } + | { + oneofKind: 'type'; + /** + * The type of the change + * + * @generated from protobuf field: massa.model.v1.AsyncPoolChangeType type = 2; + */ + type: AsyncPoolChangeType; + } + | { + oneofKind: 'handler'; + /** + * The handler function name within the destination address bytecode + * + * @generated from protobuf field: string handler = 3; + */ + handler: string; + } + | { + oneofKind: 'destinationAddress'; + /** + * The address towards which the message is being sent + * + * @generated from protobuf field: string destination_address = 4; + */ + destinationAddress: string; + } + | { + oneofKind: 'emitterAddress'; + /** + * The address that sent the message + * + * @generated from protobuf field: string emitter_address = 5; + */ + emitterAddress: string; + } + | { + oneofKind: 'canBeExecuted'; + /** + * Boolean that determine if the message can be executed. For messages without filter this boolean is always true. + * For messages with filter, this boolean is true if the filter has been matched between `validity_start` and current slot. + * + * @generated from protobuf field: bool can_be_executed = 6; + */ + canBeExecuted: boolean; + } + | { + oneofKind: undefined; + }; +} +/** + * PosChangesFilter + * + * @generated from protobuf message massa.api.v1.PosChangesFilter + */ +export interface PosChangesFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'none'; + /** + * Do not return any message + * + * @generated from protobuf field: massa.model.v1.Empty none = 1; + */ + none: Empty; + } + | { + oneofKind: 'address'; + /** + * Address for which we have roll changes + * + * @generated from protobuf field: string address = 2; + */ + address: string; + } + | { + oneofKind: undefined; + }; +} +/** + * ExecutionEventFilter + * + * @generated from protobuf message massa.api.v1.ExecutionEventFilter + */ +export interface ExecutionEventFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'none'; + /** + * Do not return any message + * + * @generated from protobuf field: massa.model.v1.Empty none = 1; + */ + none: Empty; + } + | { + oneofKind: 'callerAddress'; + /** + * Caller address + * + * @generated from protobuf field: string caller_address = 2; + */ + callerAddress: string; + } + | { + oneofKind: 'emitterAddress'; + /** + * Emitter address + * + * @generated from protobuf field: string emitter_address = 3; + */ + emitterAddress: string; + } + | { + oneofKind: 'originalOperationId'; + /** + * Original operation id + * + * @generated from protobuf field: string original_operation_id = 4; + */ + originalOperationId: string; + } + | { + oneofKind: 'isFailure'; + /** + * Whether the event is a failure + * + * @generated from protobuf field: bool is_failure = 5; + */ + isFailure: boolean; + } + | { + oneofKind: undefined; + }; +} +/** + * ExecutedOpsChangesFilter + * + * @generated from protobuf message massa.api.v1.ExecutedOpsChangesFilter + */ +export interface ExecutedOpsChangesFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'none'; + /** + * Do not return any message + * + * @generated from protobuf field: massa.model.v1.Empty none = 1; + */ + none: Empty; + } + | { + oneofKind: 'operationId'; + /** + * Operation id + * + * @generated from protobuf field: string operation_id = 2; + */ + operationId: string; + } + | { + oneofKind: undefined; + }; +} +/** + * ExecutedDenounciationFilter + * + * @generated from protobuf message massa.api.v1.ExecutedDenounciationFilter + */ +export interface ExecutedDenounciationFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'none'; + /** + * Do not return any message + * + * @generated from protobuf field: massa.model.v1.Empty none = 1; + */ + none: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * LedgerChangesFilter + * + * @generated from protobuf message massa.api.v1.LedgerChangesFilter + */ +export interface LedgerChangesFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'none'; + /** + * Do not return any message + * + * @generated from protobuf field: massa.model.v1.Empty none = 1; + */ + none: Empty; + } + | { + oneofKind: 'address'; + /** + * Address for which we have ledger changes + * + * @generated from protobuf field: string address = 2; + */ + address: string; + } + | { + oneofKind: undefined; + }; +} +/** + * NewSlotExecutionOutputsResponse holds response from NewSlotExecutionOutputs + * + * @generated from protobuf message massa.api.v1.NewSlotExecutionOutputsResponse + */ +export interface NewSlotExecutionOutputsResponse { + /** + * Slot execution output + * + * @generated from protobuf field: massa.model.v1.SlotExecutionOutput output = 1; + */ + output?: SlotExecutionOutput; +} +/** + * SendBlocksRequest holds parameters to SendBlocks + * + * @generated from protobuf message massa.api.v1.SendBlocksRequest + */ +export interface SendBlocksRequest { + /** + * Secure shared block + * + * @generated from protobuf field: bytes block = 1; + */ + block: Uint8Array; +} +/** + * SendBlocksResponse holds response from SendBlocks + * + * @generated from protobuf message massa.api.v1.SendBlocksResponse + */ +export interface SendBlocksResponse { + /** + * @generated from protobuf oneof: result + */ + result: + | { + oneofKind: 'blockId'; + /** + * Block result + * + * @generated from protobuf field: string block_id = 1; + */ + blockId: string; + } + | { + oneofKind: 'error'; + /** + * Massa error + * + * @generated from protobuf field: massa.model.v1.Error error = 2; + */ + error: Error; + } + | { + oneofKind: undefined; + }; +} +/** + * SendEndorsementsRequest holds parameters to SendEndorsements + * + * @generated from protobuf message massa.api.v1.SendEndorsementsRequest + */ +export interface SendEndorsementsRequest { + /** + * Secure shared endorsements + * + * @generated from protobuf field: repeated bytes endorsements = 1; + */ + endorsements: Uint8Array[]; +} +/** + * SendEndorsementsResponse holds response from SendEndorsements + * + * @generated from protobuf message massa.api.v1.SendEndorsementsResponse + */ +export interface SendEndorsementsResponse { + /** + * @generated from protobuf oneof: result + */ + result: + | { + oneofKind: 'endorsementIds'; + /** + * Endorsement result + * + * @generated from protobuf field: massa.model.v1.EndorsementIds endorsement_ids = 1; + */ + endorsementIds: EndorsementIds; + } + | { + oneofKind: 'error'; + /** + * Massa error + * + * @generated from protobuf field: massa.model.v1.Error error = 2; + */ + error: Error; + } + | { + oneofKind: undefined; + }; +} +/** + * SendOperationsRequest holds parameters to SendOperations + * + * @generated from protobuf message massa.api.v1.SendOperationsRequest + */ +export interface SendOperationsRequest { + /** + * Secured shared operations + * + * @generated from protobuf field: repeated bytes operations = 1; + */ + operations: Uint8Array[]; +} +/** + * SendOperationsResponse holds response from SendOperations + * + * @generated from protobuf message massa.api.v1.SendOperationsResponse + */ +export interface SendOperationsResponse { + /** + * @generated from protobuf oneof: result + */ + result: + | { + oneofKind: 'operationIds'; + /** + * Operation result + * + * @generated from protobuf field: massa.model.v1.OperationIds operation_ids = 1; + */ + operationIds: OperationIds; + } + | { + oneofKind: 'error'; + /** + * Massa error + * + * @generated from protobuf field: massa.model.v1.Error error = 2; + */ + error: Error; + } + | { + oneofKind: undefined; + }; +} +/** + * TransactionsThroughputRequest holds request for TransactionsThroughput + * + * @generated from protobuf message massa.api.v1.TransactionsThroughputRequest + */ +export interface TransactionsThroughputRequest { + /** + * Timer interval in seconds (Optional). Defaults to 10s + * + * @generated from protobuf field: google.protobuf.UInt64Value interval = 1; + */ + interval?: UInt64Value; +} +/** + * TransactionsThroughputResponse holds response from TransactionsThroughput + * + * @generated from protobuf message massa.api.v1.TransactionsThroughputResponse + */ +export interface TransactionsThroughputResponse { + /** + * Transactions throughput per second + * + * @generated from protobuf field: uint32 throughput = 1; + */ + throughput: number; +} +/** + * SearchBlocksRequest holds request for SearchBlocks + * + * @generated from protobuf message massa.api.v1.SearchBlocksRequest + */ +export interface SearchBlocksRequest { + /** + * Returns all the blocks that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.SearchBlocksFilter filters = 1; + */ + filters: SearchBlocksFilter[]; +} +/** + * SearchBlocks Filter + * + * @generated from protobuf message massa.api.v1.SearchBlocksFilter + */ +export interface SearchBlocksFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'blockIds'; + /** + * One of these block ids + * + * @generated from protobuf field: massa.model.v1.BlockIds block_ids = 1; + */ + blockIds: BlockIds; + } + | { + oneofKind: 'addresses'; + /** + * One of these creator addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 2; + */ + addresses: Addresses; + } + | { + oneofKind: 'slotRange'; + /** + * One of these slot ranges (inclusive) + * + * @generated from protobuf field: massa.model.v1.SlotRange slot_range = 3; + */ + slotRange: SlotRange; + } + | { + oneofKind: undefined; + }; +} +/** + * SearchBlocksResponse holds response from SearchBlocks + * + * @generated from protobuf message massa.api.v1.SearchBlocksResponse + */ +export interface SearchBlocksResponse { + /** + * Information about the blocks + * + * @generated from protobuf field: repeated massa.model.v1.BlockInfo block_infos = 1; + */ + blockInfos: BlockInfo[]; +} +/** + * SearchEndorsementsRequest holds request for SearchEndorsements + * + * @generated from protobuf message massa.api.v1.SearchEndorsementsRequest + */ +export interface SearchEndorsementsRequest { + /** + * Returns all the endorsements informations that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.SearchEndorsementsFilter filters = 1; + */ + filters: SearchEndorsementsFilter[]; +} +/** + * SearchEndorsements Filter + * + * @generated from protobuf message massa.api.v1.SearchEndorsementsFilter + */ +export interface SearchEndorsementsFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'endorsementIds'; + /** + * One of these endorsement ids + * + * @generated from protobuf field: massa.model.v1.EndorsementIds endorsement_ids = 1; + */ + endorsementIds: EndorsementIds; + } + | { + oneofKind: 'addresses'; + /** + * One of these creator addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 2; + */ + addresses: Addresses; + } + | { + oneofKind: 'blockIds'; + /** + * One of these block ids + * + * @generated from protobuf field: massa.model.v1.BlockIds block_ids = 3; + */ + blockIds: BlockIds; + } + | { + oneofKind: undefined; + }; +} +/** + * SearchEndorsementsResponse holds response from SearchEndorsements + * + * @generated from protobuf message massa.api.v1.SearchEndorsementsResponse + */ +export interface SearchEndorsementsResponse { + /** + * Information about the endorsements + * + * @generated from protobuf field: repeated massa.model.v1.EndorsementInfo endorsement_infos = 1; + */ + endorsementInfos: EndorsementInfo[]; +} +/** + * SearchOperationsRequest holds request for SearchOperations + * + * @generated from protobuf message massa.api.v1.SearchOperationsRequest + */ +export interface SearchOperationsRequest { + /** + * Returns all the operations that verify all the filters + * + * @generated from protobuf field: repeated massa.api.v1.SearchOperationsFilter filters = 1; + */ + filters: SearchOperationsFilter[]; +} +/** + * SearchOperations Filter + * + * @generated from protobuf message massa.api.v1.SearchOperationsFilter + */ +export interface SearchOperationsFilter { + /** + * @generated from protobuf oneof: filter + */ + filter: + | { + oneofKind: 'operationIds'; + /** + * One of the operation ids + * + * @generated from protobuf field: massa.model.v1.OperationIds operation_ids = 1; + */ + operationIds: OperationIds; + } + | { + oneofKind: 'addresses'; + /** + * One of these creator addresses + * + * @generated from protobuf field: massa.model.v1.Addresses addresses = 2; + */ + addresses: Addresses; + } + | { + oneofKind: undefined; + }; +} +/** + * SearchOperationsResponse holds response from SearchOperations + * + * @generated from protobuf message massa.api.v1.SearchOperationsResponse + */ +export interface SearchOperationsResponse { + /** + * Information about the operations + * + * @generated from protobuf field: repeated massa.model.v1.OperationInfo operation_infos = 1; + */ + operationInfos: OperationInfo[]; +} +/** + * Execution status of an operation or denunciation + * + * @generated from protobuf enum massa.api.v1.ExecutionQueryExecutionStatus + */ +export enum ExecutionQueryExecutionStatus { + /** + * Default enum value + * + * @generated from protobuf enum value: EXECUTION_QUERY_EXECUTION_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * The operation or denunciation was executed recently with success + * + * @generated from protobuf enum value: EXECUTION_QUERY_EXECUTION_STATUS_ALREADY_EXECUTED_WITH_SUCCESS = 1; + */ + ALREADY_EXECUTED_WITH_SUCCESS = 1, + /** + * The operation or denunciation was executed recently with failure + * + * @generated from protobuf enum value: EXECUTION_QUERY_EXECUTION_STATUS_ALREADY_EXECUTED_WITH_FAILURE = 2; + */ + ALREADY_EXECUTED_WITH_FAILURE = 2, + /** + * The operation or denunciation was not executed recently but can still be executed unless expired + * + * @generated from protobuf enum value: EXECUTION_QUERY_EXECUTION_STATUS_EXECUTABLE_OR_EXPIRED = 3; + */ + EXECUTABLE_OR_EXPIRED = 3, +} +// @generated message type with reflection information, may provide speed optimized methods +class ExecuteReadOnlyCallRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecuteReadOnlyCallRequest', [ + { no: 1, name: 'call', kind: 'message', T: () => ReadOnlyExecutionCall }, + ]); + } + create( + value?: PartialMessage, + ): ExecuteReadOnlyCallRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecuteReadOnlyCallRequest, + ): ExecuteReadOnlyCallRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ReadOnlyExecutionCall call */ 1: + message.call = ReadOnlyExecutionCall.internalBinaryRead( + reader, + reader.uint32(), + options, + message.call, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecuteReadOnlyCallRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ReadOnlyExecutionCall call = 1; */ + if (message.call) + ReadOnlyExecutionCall.internalBinaryWrite( + message.call, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecuteReadOnlyCallRequest + */ +export const ExecuteReadOnlyCallRequest = new ExecuteReadOnlyCallRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecuteReadOnlyCallResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecuteReadOnlyCallResponse', [ + { + no: 1, + name: 'output', + kind: 'message', + T: () => ReadOnlyExecutionOutput, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecuteReadOnlyCallResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecuteReadOnlyCallResponse, + ): ExecuteReadOnlyCallResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ReadOnlyExecutionOutput output */ 1: + message.output = ReadOnlyExecutionOutput.internalBinaryRead( + reader, + reader.uint32(), + options, + message.output, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecuteReadOnlyCallResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ReadOnlyExecutionOutput output = 1; */ + if (message.output) + ReadOnlyExecutionOutput.internalBinaryWrite( + message.output, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecuteReadOnlyCallResponse + */ +export const ExecuteReadOnlyCallResponse = + new ExecuteReadOnlyCallResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBlocksRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetBlocksRequest', [ + { + no: 1, + name: 'block_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): GetBlocksRequest { + const message = { blockIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBlocksRequest, + ): GetBlocksRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string block_ids */ 1: + message.blockIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBlocksRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string block_ids = 1; */ + for (let i = 0; i < message.blockIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.blockIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetBlocksRequest + */ +export const GetBlocksRequest = new GetBlocksRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetBlocksResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetBlocksResponse', [ + { + no: 1, + name: 'wrapped_blocks', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => BlockWrapper, + }, + ]); + } + create(value?: PartialMessage): GetBlocksResponse { + const message = { wrappedBlocks: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetBlocksResponse, + ): GetBlocksResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.BlockWrapper wrapped_blocks */ 1: + message.wrappedBlocks.push( + BlockWrapper.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetBlocksResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.BlockWrapper wrapped_blocks = 1; */ + for (let i = 0; i < message.wrappedBlocks.length; i++) + BlockWrapper.internalBinaryWrite( + message.wrappedBlocks[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetBlocksResponse + */ +export const GetBlocksResponse = new GetBlocksResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetDatastoreEntriesRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetDatastoreEntriesRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => GetDatastoreEntryFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): GetDatastoreEntriesRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetDatastoreEntriesRequest, + ): GetDatastoreEntriesRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.GetDatastoreEntryFilter filters */ 1: + message.filters.push( + GetDatastoreEntryFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetDatastoreEntriesRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.GetDatastoreEntryFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + GetDatastoreEntryFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetDatastoreEntriesRequest + */ +export const GetDatastoreEntriesRequest = new GetDatastoreEntriesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetDatastoreEntryFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.GetDatastoreEntryFilter', [ + { + no: 1, + name: 'address_key', + kind: 'message', + oneof: 'filter', + T: () => AddressKeyEntry, + }, + ]); + } + create( + value?: PartialMessage, + ): GetDatastoreEntryFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetDatastoreEntryFilter, + ): GetDatastoreEntryFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.AddressKeyEntry address_key */ 1: + message.filter = { + oneofKind: 'addressKey', + addressKey: AddressKeyEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addressKey, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetDatastoreEntryFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.AddressKeyEntry address_key = 1; */ + if (message.filter.oneofKind === 'addressKey') + AddressKeyEntry.internalBinaryWrite( + message.filter.addressKey, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetDatastoreEntryFilter + */ +export const GetDatastoreEntryFilter = new GetDatastoreEntryFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetDatastoreEntriesResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetDatastoreEntriesResponse', [ + { + no: 1, + name: 'datastore_entries', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => DatastoreEntry, + }, + ]); + } + create( + value?: PartialMessage, + ): GetDatastoreEntriesResponse { + const message = { datastoreEntries: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetDatastoreEntriesResponse, + ): GetDatastoreEntriesResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.DatastoreEntry datastore_entries */ 1: + message.datastoreEntries.push( + DatastoreEntry.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetDatastoreEntriesResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.DatastoreEntry datastore_entries = 1; */ + for (let i = 0; i < message.datastoreEntries.length; i++) + DatastoreEntry.internalBinaryWrite( + message.datastoreEntries[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetDatastoreEntriesResponse + */ +export const GetDatastoreEntriesResponse = + new GetDatastoreEntriesResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetEndorsementsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetEndorsementsRequest', [ + { + no: 1, + name: 'endorsement_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetEndorsementsRequest { + const message = { endorsementIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetEndorsementsRequest, + ): GetEndorsementsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string endorsement_ids */ 1: + message.endorsementIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetEndorsementsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string endorsement_ids = 1; */ + for (let i = 0; i < message.endorsementIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.endorsementIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetEndorsementsRequest + */ +export const GetEndorsementsRequest = new GetEndorsementsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetEndorsementsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetEndorsementsResponse', [ + { + no: 1, + name: 'wrapped_endorsements', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => EndorsementWrapper, + }, + ]); + } + create( + value?: PartialMessage, + ): GetEndorsementsResponse { + const message = { wrappedEndorsements: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetEndorsementsResponse, + ): GetEndorsementsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.EndorsementWrapper wrapped_endorsements */ 1: + message.wrappedEndorsements.push( + EndorsementWrapper.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetEndorsementsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.EndorsementWrapper wrapped_endorsements = 1; */ + for (let i = 0; i < message.wrappedEndorsements.length; i++) + EndorsementWrapper.internalBinaryWrite( + message.wrappedEndorsements[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetEndorsementsResponse + */ +export const GetEndorsementsResponse = new GetEndorsementsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetNextBlockBestParentsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetNextBlockBestParentsRequest', []); + } + create( + value?: PartialMessage, + ): GetNextBlockBestParentsRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetNextBlockBestParentsRequest, + ): GetNextBlockBestParentsRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetNextBlockBestParentsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetNextBlockBestParentsRequest + */ +export const GetNextBlockBestParentsRequest = + new GetNextBlockBestParentsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetNextBlockBestParentsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetNextBlockBestParentsResponse', [ + { + no: 1, + name: 'block_parents', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => BlockParent, + }, + ]); + } + create( + value?: PartialMessage, + ): GetNextBlockBestParentsResponse { + const message = { blockParents: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetNextBlockBestParentsResponse, + ): GetNextBlockBestParentsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.BlockParent block_parents */ 1: + message.blockParents.push( + BlockParent.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetNextBlockBestParentsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.BlockParent block_parents = 1; */ + for (let i = 0; i < message.blockParents.length; i++) + BlockParent.internalBinaryWrite( + message.blockParents[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetNextBlockBestParentsResponse + */ +export const GetNextBlockBestParentsResponse = + new GetNextBlockBestParentsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOperationsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetOperationsRequest', [ + { + no: 1, + name: 'operation_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): GetOperationsRequest { + const message = { operationIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOperationsRequest, + ): GetOperationsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string operation_ids */ 1: + message.operationIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOperationsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string operation_ids = 1; */ + for (let i = 0; i < message.operationIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.operationIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetOperationsRequest + */ +export const GetOperationsRequest = new GetOperationsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetOperationsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetOperationsResponse', [ + { + no: 1, + name: 'wrapped_operations', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => OperationWrapper, + }, + ]); + } + create(value?: PartialMessage): GetOperationsResponse { + const message = { wrappedOperations: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetOperationsResponse, + ): GetOperationsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.OperationWrapper wrapped_operations */ 1: + message.wrappedOperations.push( + OperationWrapper.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetOperationsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.OperationWrapper wrapped_operations = 1; */ + for (let i = 0; i < message.wrappedOperations.length; i++) + OperationWrapper.internalBinaryWrite( + message.wrappedOperations[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetOperationsResponse + */ +export const GetOperationsResponse = new GetOperationsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetScExecutionEventsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetScExecutionEventsRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ScExecutionEventsFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): GetScExecutionEventsRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetScExecutionEventsRequest, + ): GetScExecutionEventsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.ScExecutionEventsFilter filters */ 1: + message.filters.push( + ScExecutionEventsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetScExecutionEventsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.ScExecutionEventsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + ScExecutionEventsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetScExecutionEventsRequest + */ +export const GetScExecutionEventsRequest = + new GetScExecutionEventsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScExecutionEventsFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.ScExecutionEventsFilter', [ + { + no: 1, + name: 'slot_range', + kind: 'message', + oneof: 'filter', + T: () => SlotRange, + }, + { + no: 2, + name: 'caller_address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'emitter_address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'original_operation_id', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'is_failure', + kind: 'scalar', + oneof: 'filter', + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 6, + name: 'status', + kind: 'enum', + oneof: 'filter', + T: () => [ + 'massa.model.v1.ScExecutionEventStatus', + ScExecutionEventStatus, + 'SC_EXECUTION_EVENT_STATUS_', + ], + }, + ]); + } + create( + value?: PartialMessage, + ): ScExecutionEventsFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScExecutionEventsFilter, + ): ScExecutionEventsFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SlotRange slot_range */ 1: + message.filter = { + oneofKind: 'slotRange', + slotRange: SlotRange.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).slotRange, + ), + }; + break; + case /* string caller_address */ 2: + message.filter = { + oneofKind: 'callerAddress', + callerAddress: reader.string(), + }; + break; + case /* string emitter_address */ 3: + message.filter = { + oneofKind: 'emitterAddress', + emitterAddress: reader.string(), + }; + break; + case /* string original_operation_id */ 4: + message.filter = { + oneofKind: 'originalOperationId', + originalOperationId: reader.string(), + }; + break; + case /* bool is_failure */ 5: + message.filter = { + oneofKind: 'isFailure', + isFailure: reader.bool(), + }; + break; + case /* massa.model.v1.ScExecutionEventStatus status */ 6: + message.filter = { + oneofKind: 'status', + status: reader.int32(), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScExecutionEventsFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SlotRange slot_range = 1; */ + if (message.filter.oneofKind === 'slotRange') + SlotRange.internalBinaryWrite( + message.filter.slotRange, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string caller_address = 2; */ + if (message.filter.oneofKind === 'callerAddress') + writer + .tag(2, WireType.LengthDelimited) + .string(message.filter.callerAddress); + /* string emitter_address = 3; */ + if (message.filter.oneofKind === 'emitterAddress') + writer + .tag(3, WireType.LengthDelimited) + .string(message.filter.emitterAddress); + /* string original_operation_id = 4; */ + if (message.filter.oneofKind === 'originalOperationId') + writer + .tag(4, WireType.LengthDelimited) + .string(message.filter.originalOperationId); + /* bool is_failure = 5; */ + if (message.filter.oneofKind === 'isFailure') + writer.tag(5, WireType.Varint).bool(message.filter.isFailure); + /* massa.model.v1.ScExecutionEventStatus status = 6; */ + if (message.filter.oneofKind === 'status') + writer.tag(6, WireType.Varint).int32(message.filter.status); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ScExecutionEventsFilter + */ +export const ScExecutionEventsFilter = new ScExecutionEventsFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetScExecutionEventsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetScExecutionEventsResponse', [ + { + no: 1, + name: 'events', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ScExecutionEvent, + }, + ]); + } + create( + value?: PartialMessage, + ): GetScExecutionEventsResponse { + const message = { events: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetScExecutionEventsResponse, + ): GetScExecutionEventsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.ScExecutionEvent events */ 1: + message.events.push( + ScExecutionEvent.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetScExecutionEventsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.ScExecutionEvent events = 1; */ + for (let i = 0; i < message.events.length; i++) + ScExecutionEvent.internalBinaryWrite( + message.events[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetScExecutionEventsResponse + */ +export const GetScExecutionEventsResponse = + new GetScExecutionEventsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetStatusRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetStatusRequest', []); + } + create(value?: PartialMessage): GetStatusRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetStatusRequest, + ): GetStatusRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetStatusRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetStatusRequest + */ +export const GetStatusRequest = new GetStatusRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetStatusResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetStatusResponse', [ + { no: 1, name: 'status', kind: 'message', T: () => PublicStatus }, + ]); + } + create(value?: PartialMessage): GetStatusResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetStatusResponse, + ): GetStatusResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.PublicStatus status */ 1: + message.status = PublicStatus.internalBinaryRead( + reader, + reader.uint32(), + options, + message.status, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetStatusResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.PublicStatus status = 1; */ + if (message.status) + PublicStatus.internalBinaryWrite( + message.status, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetStatusResponse + */ +export const GetStatusResponse = new GetStatusResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetSelectorDrawsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetSelectorDrawsRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => SelectorDrawsFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): GetSelectorDrawsRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetSelectorDrawsRequest, + ): GetSelectorDrawsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.SelectorDrawsFilter filters */ 1: + message.filters.push( + SelectorDrawsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetSelectorDrawsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.SelectorDrawsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + SelectorDrawsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetSelectorDrawsRequest + */ +export const GetSelectorDrawsRequest = new GetSelectorDrawsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SelectorDrawsFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.SelectorDrawsFilter', [ + { + no: 1, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + { + no: 2, + name: 'slot_range', + kind: 'message', + oneof: 'filter', + T: () => SlotRange, + }, + ]); + } + create(value?: PartialMessage): SelectorDrawsFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SelectorDrawsFilter, + ): SelectorDrawsFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Addresses addresses */ 1: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + case /* massa.model.v1.SlotRange slot_range */ 2: + message.filter = { + oneofKind: 'slotRange', + slotRange: SlotRange.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).slotRange, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SelectorDrawsFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Addresses addresses = 1; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SlotRange slot_range = 2; */ + if (message.filter.oneofKind === 'slotRange') + SlotRange.internalBinaryWrite( + message.filter.slotRange, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SelectorDrawsFilter + */ +export const SelectorDrawsFilter = new SelectorDrawsFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetSelectorDrawsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetSelectorDrawsResponse', [ + { + no: 1, + name: 'draws', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => SlotDraw, + }, + ]); + } + create( + value?: PartialMessage, + ): GetSelectorDrawsResponse { + const message = { draws: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetSelectorDrawsResponse, + ): GetSelectorDrawsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.SlotDraw draws */ 1: + message.draws.push( + SlotDraw.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetSelectorDrawsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.SlotDraw draws = 1; */ + for (let i = 0; i < message.draws.length; i++) + SlotDraw.internalBinaryWrite( + message.draws[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetSelectorDrawsResponse + */ +export const GetSelectorDrawsResponse = new GetSelectorDrawsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetStakersRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetStakersRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => StakersFilter, + }, + ]); + } + create(value?: PartialMessage): GetStakersRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetStakersRequest, + ): GetStakersRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.StakersFilter filters */ 1: + message.filters.push( + StakersFilter.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetStakersRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.StakersFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + StakersFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetStakersRequest + */ +export const GetStakersRequest = new GetStakersRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StakersFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.StakersFilter', [ + { + no: 1, + name: 'min_rolls', + kind: 'scalar', + oneof: 'filter', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 2, + name: 'max_rolls', + kind: 'scalar', + oneof: 'filter', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 3, + name: 'limit', + kind: 'scalar', + oneof: 'filter', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): StakersFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: StakersFilter, + ): StakersFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 min_rolls */ 1: + message.filter = { + oneofKind: 'minRolls', + minRolls: reader.uint64().toBigInt(), + }; + break; + case /* uint64 max_rolls */ 2: + message.filter = { + oneofKind: 'maxRolls', + maxRolls: reader.uint64().toBigInt(), + }; + break; + case /* uint64 limit */ 3: + message.filter = { + oneofKind: 'limit', + limit: reader.uint64().toBigInt(), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: StakersFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 min_rolls = 1; */ + if (message.filter.oneofKind === 'minRolls') + writer.tag(1, WireType.Varint).uint64(message.filter.minRolls); + /* uint64 max_rolls = 2; */ + if (message.filter.oneofKind === 'maxRolls') + writer.tag(2, WireType.Varint).uint64(message.filter.maxRolls); + /* uint64 limit = 3; */ + if (message.filter.oneofKind === 'limit') + writer.tag(3, WireType.Varint).uint64(message.filter.limit); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.StakersFilter + */ +export const StakersFilter = new StakersFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetStakersResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetStakersResponse', [ + { + no: 1, + name: 'stakers', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => StakerEntry, + }, + ]); + } + create(value?: PartialMessage): GetStakersResponse { + const message = { stakers: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetStakersResponse, + ): GetStakersResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.StakerEntry stakers */ 1: + message.stakers.push( + StakerEntry.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetStakersResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.StakerEntry stakers = 1; */ + for (let i = 0; i < message.stakers.length; i++) + StakerEntry.internalBinaryWrite( + message.stakers[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetStakersResponse + */ +export const GetStakersResponse = new GetStakersResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetTransactionsThroughputRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.GetTransactionsThroughputRequest', []); + } + create( + value?: PartialMessage, + ): GetTransactionsThroughputRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetTransactionsThroughputRequest, + ): GetTransactionsThroughputRequest { + return target ?? this.create(); + } + internalBinaryWrite( + message: GetTransactionsThroughputRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetTransactionsThroughputRequest + */ +export const GetTransactionsThroughputRequest = + new GetTransactionsThroughputRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetTransactionsThroughputResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.GetTransactionsThroughputResponse', [ + { + no: 1, + name: 'throughput', + kind: 'scalar', + T: 13 /* ScalarType.UINT32*/, + }, + ]); + } + create( + value?: PartialMessage, + ): GetTransactionsThroughputResponse { + const message = { throughput: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: GetTransactionsThroughputResponse, + ): GetTransactionsThroughputResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 throughput */ 1: + message.throughput = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: GetTransactionsThroughputResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint32 throughput = 1; */ + if (message.throughput !== 0) + writer.tag(1, WireType.Varint).uint32(message.throughput); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.GetTransactionsThroughputResponse + */ +export const GetTransactionsThroughputResponse = + new GetTransactionsThroughputResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryStateRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.QueryStateRequest', [ + { + no: 1, + name: 'queries', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ExecutionQueryRequestItem, + }, + ]); + } + create(value?: PartialMessage): QueryStateRequest { + const message = { queries: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: QueryStateRequest, + ): QueryStateRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.ExecutionQueryRequestItem queries */ 1: + message.queries.push( + ExecutionQueryRequestItem.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: QueryStateRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.ExecutionQueryRequestItem queries = 1; */ + for (let i = 0; i < message.queries.length; i++) + ExecutionQueryRequestItem.internalBinaryWrite( + message.queries[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.QueryStateRequest + */ +export const QueryStateRequest = new QueryStateRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryRequestItem$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryRequestItem', [ + { + no: 1, + name: 'address_exists_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => AddressExistsCandidate, + }, + { + no: 2, + name: 'address_exists_final', + kind: 'message', + oneof: 'requestItem', + T: () => AddressExistsFinal, + }, + { + no: 3, + name: 'address_balance_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => AddressBalanceCandidate, + }, + { + no: 4, + name: 'address_balance_final', + kind: 'message', + oneof: 'requestItem', + T: () => AddressBalanceFinal, + }, + { + no: 5, + name: 'address_bytecode_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => AddressBytecodeCandidate, + }, + { + no: 6, + name: 'address_bytecode_final', + kind: 'message', + oneof: 'requestItem', + T: () => AddressBytecodeFinal, + }, + { + no: 7, + name: 'address_datastore_keys_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => AddressDatastoreKeysCandidate, + }, + { + no: 8, + name: 'address_datastore_keys_final', + kind: 'message', + oneof: 'requestItem', + T: () => AddressDatastoreKeysFinal, + }, + { + no: 9, + name: 'address_datastore_value_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => AddressDatastoreValueCandidate, + }, + { + no: 10, + name: 'address_datastore_value_final', + kind: 'message', + oneof: 'requestItem', + T: () => AddressDatastoreValueFinal, + }, + { + no: 11, + name: 'op_execution_status_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => OpExecutionStatusCandidate, + }, + { + no: 12, + name: 'op_execution_status_final', + kind: 'message', + oneof: 'requestItem', + T: () => OpExecutionStatusFinal, + }, + { + no: 13, + name: 'denunciation_execution_status_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => DenunciationExecutionStatusCandidate, + }, + { + no: 14, + name: 'denunciation_execution_status_final', + kind: 'message', + oneof: 'requestItem', + T: () => DenunciationExecutionStatusFinal, + }, + { + no: 15, + name: 'address_rolls_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => AddressRollsCandidate, + }, + { + no: 16, + name: 'address_rolls_final', + kind: 'message', + oneof: 'requestItem', + T: () => AddressRollsFinal, + }, + { + no: 17, + name: 'address_deferred_credits_candidate', + kind: 'message', + oneof: 'requestItem', + T: () => AddressDeferredCreditsCandidate, + }, + { + no: 18, + name: 'address_deferred_credits_final', + kind: 'message', + oneof: 'requestItem', + T: () => AddressDeferredCreditsFinal, + }, + { + no: 19, + name: 'cycle_infos', + kind: 'message', + oneof: 'requestItem', + T: () => CycleInfos, + }, + { + no: 20, + name: 'events', + kind: 'message', + oneof: 'requestItem', + T: () => Events, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryRequestItem { + const message = { requestItem: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryRequestItem, + ): ExecutionQueryRequestItem { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.api.v1.AddressExistsCandidate address_exists_candidate */ 1: + message.requestItem = { + oneofKind: 'addressExistsCandidate', + addressExistsCandidate: AddressExistsCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressExistsCandidate, + ), + }; + break; + case /* massa.api.v1.AddressExistsFinal address_exists_final */ 2: + message.requestItem = { + oneofKind: 'addressExistsFinal', + addressExistsFinal: AddressExistsFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressExistsFinal, + ), + }; + break; + case /* massa.api.v1.AddressBalanceCandidate address_balance_candidate */ 3: + message.requestItem = { + oneofKind: 'addressBalanceCandidate', + addressBalanceCandidate: AddressBalanceCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressBalanceCandidate, + ), + }; + break; + case /* massa.api.v1.AddressBalanceFinal address_balance_final */ 4: + message.requestItem = { + oneofKind: 'addressBalanceFinal', + addressBalanceFinal: AddressBalanceFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressBalanceFinal, + ), + }; + break; + case /* massa.api.v1.AddressBytecodeCandidate address_bytecode_candidate */ 5: + message.requestItem = { + oneofKind: 'addressBytecodeCandidate', + addressBytecodeCandidate: + AddressBytecodeCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressBytecodeCandidate, + ), + }; + break; + case /* massa.api.v1.AddressBytecodeFinal address_bytecode_final */ 6: + message.requestItem = { + oneofKind: 'addressBytecodeFinal', + addressBytecodeFinal: AddressBytecodeFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressBytecodeFinal, + ), + }; + break; + case /* massa.api.v1.AddressDatastoreKeysCandidate address_datastore_keys_candidate */ 7: + message.requestItem = { + oneofKind: 'addressDatastoreKeysCandidate', + addressDatastoreKeysCandidate: + AddressDatastoreKeysCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressDatastoreKeysCandidate, + ), + }; + break; + case /* massa.api.v1.AddressDatastoreKeysFinal address_datastore_keys_final */ 8: + message.requestItem = { + oneofKind: 'addressDatastoreKeysFinal', + addressDatastoreKeysFinal: + AddressDatastoreKeysFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressDatastoreKeysFinal, + ), + }; + break; + case /* massa.api.v1.AddressDatastoreValueCandidate address_datastore_value_candidate */ 9: + message.requestItem = { + oneofKind: 'addressDatastoreValueCandidate', + addressDatastoreValueCandidate: + AddressDatastoreValueCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressDatastoreValueCandidate, + ), + }; + break; + case /* massa.api.v1.AddressDatastoreValueFinal address_datastore_value_final */ 10: + message.requestItem = { + oneofKind: 'addressDatastoreValueFinal', + addressDatastoreValueFinal: + AddressDatastoreValueFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressDatastoreValueFinal, + ), + }; + break; + case /* massa.api.v1.OpExecutionStatusCandidate op_execution_status_candidate */ 11: + message.requestItem = { + oneofKind: 'opExecutionStatusCandidate', + opExecutionStatusCandidate: + OpExecutionStatusCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).opExecutionStatusCandidate, + ), + }; + break; + case /* massa.api.v1.OpExecutionStatusFinal op_execution_status_final */ 12: + message.requestItem = { + oneofKind: 'opExecutionStatusFinal', + opExecutionStatusFinal: OpExecutionStatusFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).opExecutionStatusFinal, + ), + }; + break; + case /* massa.api.v1.DenunciationExecutionStatusCandidate denunciation_execution_status_candidate */ 13: + message.requestItem = { + oneofKind: 'denunciationExecutionStatusCandidate', + denunciationExecutionStatusCandidate: + DenunciationExecutionStatusCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any) + .denunciationExecutionStatusCandidate, + ), + }; + break; + case /* massa.api.v1.DenunciationExecutionStatusFinal denunciation_execution_status_final */ 14: + message.requestItem = { + oneofKind: 'denunciationExecutionStatusFinal', + denunciationExecutionStatusFinal: + DenunciationExecutionStatusFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).denunciationExecutionStatusFinal, + ), + }; + break; + case /* massa.api.v1.AddressRollsCandidate address_rolls_candidate */ 15: + message.requestItem = { + oneofKind: 'addressRollsCandidate', + addressRollsCandidate: AddressRollsCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressRollsCandidate, + ), + }; + break; + case /* massa.api.v1.AddressRollsFinal address_rolls_final */ 16: + message.requestItem = { + oneofKind: 'addressRollsFinal', + addressRollsFinal: AddressRollsFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressRollsFinal, + ), + }; + break; + case /* massa.api.v1.AddressDeferredCreditsCandidate address_deferred_credits_candidate */ 17: + message.requestItem = { + oneofKind: 'addressDeferredCreditsCandidate', + addressDeferredCreditsCandidate: + AddressDeferredCreditsCandidate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressDeferredCreditsCandidate, + ), + }; + break; + case /* massa.api.v1.AddressDeferredCreditsFinal address_deferred_credits_final */ 18: + message.requestItem = { + oneofKind: 'addressDeferredCreditsFinal', + addressDeferredCreditsFinal: + AddressDeferredCreditsFinal.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).addressDeferredCreditsFinal, + ), + }; + break; + case /* massa.api.v1.CycleInfos cycle_infos */ 19: + message.requestItem = { + oneofKind: 'cycleInfos', + cycleInfos: CycleInfos.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).cycleInfos, + ), + }; + break; + case /* massa.api.v1.Events events */ 20: + message.requestItem = { + oneofKind: 'events', + events: Events.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.requestItem as any).events, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryRequestItem, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.api.v1.AddressExistsCandidate address_exists_candidate = 1; */ + if (message.requestItem.oneofKind === 'addressExistsCandidate') + AddressExistsCandidate.internalBinaryWrite( + message.requestItem.addressExistsCandidate, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressExistsFinal address_exists_final = 2; */ + if (message.requestItem.oneofKind === 'addressExistsFinal') + AddressExistsFinal.internalBinaryWrite( + message.requestItem.addressExistsFinal, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressBalanceCandidate address_balance_candidate = 3; */ + if (message.requestItem.oneofKind === 'addressBalanceCandidate') + AddressBalanceCandidate.internalBinaryWrite( + message.requestItem.addressBalanceCandidate, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressBalanceFinal address_balance_final = 4; */ + if (message.requestItem.oneofKind === 'addressBalanceFinal') + AddressBalanceFinal.internalBinaryWrite( + message.requestItem.addressBalanceFinal, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressBytecodeCandidate address_bytecode_candidate = 5; */ + if (message.requestItem.oneofKind === 'addressBytecodeCandidate') + AddressBytecodeCandidate.internalBinaryWrite( + message.requestItem.addressBytecodeCandidate, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressBytecodeFinal address_bytecode_final = 6; */ + if (message.requestItem.oneofKind === 'addressBytecodeFinal') + AddressBytecodeFinal.internalBinaryWrite( + message.requestItem.addressBytecodeFinal, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressDatastoreKeysCandidate address_datastore_keys_candidate = 7; */ + if (message.requestItem.oneofKind === 'addressDatastoreKeysCandidate') + AddressDatastoreKeysCandidate.internalBinaryWrite( + message.requestItem.addressDatastoreKeysCandidate, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressDatastoreKeysFinal address_datastore_keys_final = 8; */ + if (message.requestItem.oneofKind === 'addressDatastoreKeysFinal') + AddressDatastoreKeysFinal.internalBinaryWrite( + message.requestItem.addressDatastoreKeysFinal, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressDatastoreValueCandidate address_datastore_value_candidate = 9; */ + if (message.requestItem.oneofKind === 'addressDatastoreValueCandidate') + AddressDatastoreValueCandidate.internalBinaryWrite( + message.requestItem.addressDatastoreValueCandidate, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressDatastoreValueFinal address_datastore_value_final = 10; */ + if (message.requestItem.oneofKind === 'addressDatastoreValueFinal') + AddressDatastoreValueFinal.internalBinaryWrite( + message.requestItem.addressDatastoreValueFinal, + writer.tag(10, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.OpExecutionStatusCandidate op_execution_status_candidate = 11; */ + if (message.requestItem.oneofKind === 'opExecutionStatusCandidate') + OpExecutionStatusCandidate.internalBinaryWrite( + message.requestItem.opExecutionStatusCandidate, + writer.tag(11, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.OpExecutionStatusFinal op_execution_status_final = 12; */ + if (message.requestItem.oneofKind === 'opExecutionStatusFinal') + OpExecutionStatusFinal.internalBinaryWrite( + message.requestItem.opExecutionStatusFinal, + writer.tag(12, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.DenunciationExecutionStatusCandidate denunciation_execution_status_candidate = 13; */ + if ( + message.requestItem.oneofKind === 'denunciationExecutionStatusCandidate' + ) + DenunciationExecutionStatusCandidate.internalBinaryWrite( + message.requestItem.denunciationExecutionStatusCandidate, + writer.tag(13, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.DenunciationExecutionStatusFinal denunciation_execution_status_final = 14; */ + if (message.requestItem.oneofKind === 'denunciationExecutionStatusFinal') + DenunciationExecutionStatusFinal.internalBinaryWrite( + message.requestItem.denunciationExecutionStatusFinal, + writer.tag(14, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressRollsCandidate address_rolls_candidate = 15; */ + if (message.requestItem.oneofKind === 'addressRollsCandidate') + AddressRollsCandidate.internalBinaryWrite( + message.requestItem.addressRollsCandidate, + writer.tag(15, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressRollsFinal address_rolls_final = 16; */ + if (message.requestItem.oneofKind === 'addressRollsFinal') + AddressRollsFinal.internalBinaryWrite( + message.requestItem.addressRollsFinal, + writer.tag(16, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressDeferredCreditsCandidate address_deferred_credits_candidate = 17; */ + if (message.requestItem.oneofKind === 'addressDeferredCreditsCandidate') + AddressDeferredCreditsCandidate.internalBinaryWrite( + message.requestItem.addressDeferredCreditsCandidate, + writer.tag(17, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AddressDeferredCreditsFinal address_deferred_credits_final = 18; */ + if (message.requestItem.oneofKind === 'addressDeferredCreditsFinal') + AddressDeferredCreditsFinal.internalBinaryWrite( + message.requestItem.addressDeferredCreditsFinal, + writer.tag(18, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.CycleInfos cycle_infos = 19; */ + if (message.requestItem.oneofKind === 'cycleInfos') + CycleInfos.internalBinaryWrite( + message.requestItem.cycleInfos, + writer.tag(19, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.Events events = 20; */ + if (message.requestItem.oneofKind === 'events') + Events.internalBinaryWrite( + message.requestItem.events, + writer.tag(20, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryRequestItem + */ +export const ExecutionQueryRequestItem = new ExecutionQueryRequestItem$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressExistsCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressExistsCandidate', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressExistsCandidate { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressExistsCandidate, + ): AddressExistsCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressExistsCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressExistsCandidate + */ +export const AddressExistsCandidate = new AddressExistsCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressExistsFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressExistsFinal', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): AddressExistsFinal { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressExistsFinal, + ): AddressExistsFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressExistsFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressExistsFinal + */ +export const AddressExistsFinal = new AddressExistsFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressBalanceCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressBalanceCandidate', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressBalanceCandidate { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressBalanceCandidate, + ): AddressBalanceCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressBalanceCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressBalanceCandidate + */ +export const AddressBalanceCandidate = new AddressBalanceCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressBalanceFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressBalanceFinal', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): AddressBalanceFinal { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressBalanceFinal, + ): AddressBalanceFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressBalanceFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressBalanceFinal + */ +export const AddressBalanceFinal = new AddressBalanceFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressBytecodeCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressBytecodeCandidate', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressBytecodeCandidate { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressBytecodeCandidate, + ): AddressBytecodeCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressBytecodeCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressBytecodeCandidate + */ +export const AddressBytecodeCandidate = new AddressBytecodeCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressBytecodeFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressBytecodeFinal', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): AddressBytecodeFinal { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressBytecodeFinal, + ): AddressBytecodeFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressBytecodeFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressBytecodeFinal + */ +export const AddressBytecodeFinal = new AddressBytecodeFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressDatastoreKeysCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressDatastoreKeysCandidate', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'prefix', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressDatastoreKeysCandidate { + const message = { address: '', prefix: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressDatastoreKeysCandidate, + ): AddressDatastoreKeysCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* bytes prefix */ 2: + message.prefix = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressDatastoreKeysCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* bytes prefix = 2; */ + if (message.prefix.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.prefix); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressDatastoreKeysCandidate + */ +export const AddressDatastoreKeysCandidate = + new AddressDatastoreKeysCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressDatastoreKeysFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressDatastoreKeysFinal', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'prefix', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressDatastoreKeysFinal { + const message = { address: '', prefix: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressDatastoreKeysFinal, + ): AddressDatastoreKeysFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* bytes prefix */ 2: + message.prefix = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressDatastoreKeysFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* bytes prefix = 2; */ + if (message.prefix.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.prefix); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressDatastoreKeysFinal + */ +export const AddressDatastoreKeysFinal = new AddressDatastoreKeysFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressDatastoreValueCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressDatastoreValueCandidate', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressDatastoreValueCandidate { + const message = { address: '', key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressDatastoreValueCandidate, + ): AddressDatastoreValueCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* bytes key */ 2: + message.key = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressDatastoreValueCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* bytes key = 2; */ + if (message.key.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.key); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressDatastoreValueCandidate + */ +export const AddressDatastoreValueCandidate = + new AddressDatastoreValueCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressDatastoreValueFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressDatastoreValueFinal', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressDatastoreValueFinal { + const message = { address: '', key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressDatastoreValueFinal, + ): AddressDatastoreValueFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* bytes key */ 2: + message.key = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressDatastoreValueFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* bytes key = 2; */ + if (message.key.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.key); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressDatastoreValueFinal + */ +export const AddressDatastoreValueFinal = new AddressDatastoreValueFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OpExecutionStatusCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.OpExecutionStatusCandidate', [ + { + no: 1, + name: 'operation_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): OpExecutionStatusCandidate { + const message = { operationId: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OpExecutionStatusCandidate, + ): OpExecutionStatusCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operation_id */ 1: + message.operationId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OpExecutionStatusCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string operation_id = 1; */ + if (message.operationId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.operationId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.OpExecutionStatusCandidate + */ +export const OpExecutionStatusCandidate = new OpExecutionStatusCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OpExecutionStatusFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.OpExecutionStatusFinal', [ + { + no: 1, + name: 'operation_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): OpExecutionStatusFinal { + const message = { operationId: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OpExecutionStatusFinal, + ): OpExecutionStatusFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operation_id */ 1: + message.operationId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OpExecutionStatusFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string operation_id = 1; */ + if (message.operationId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.operationId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.OpExecutionStatusFinal + */ +export const OpExecutionStatusFinal = new OpExecutionStatusFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DenunciationExecutionStatusCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.DenunciationExecutionStatusCandidate', [ + { + no: 1, + name: 'denunciation_index', + kind: 'message', + T: () => DenunciationIndex, + }, + ]); + } + create( + value?: PartialMessage, + ): DenunciationExecutionStatusCandidate { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DenunciationExecutionStatusCandidate, + ): DenunciationExecutionStatusCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.DenunciationIndex denunciation_index */ 1: + message.denunciationIndex = DenunciationIndex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.denunciationIndex, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DenunciationExecutionStatusCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.DenunciationIndex denunciation_index = 1; */ + if (message.denunciationIndex) + DenunciationIndex.internalBinaryWrite( + message.denunciationIndex, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.DenunciationExecutionStatusCandidate + */ +export const DenunciationExecutionStatusCandidate = + new DenunciationExecutionStatusCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DenunciationExecutionStatusFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.DenunciationExecutionStatusFinal', [ + { + no: 1, + name: 'denunciation_index', + kind: 'message', + T: () => DenunciationIndex, + }, + ]); + } + create( + value?: PartialMessage, + ): DenunciationExecutionStatusFinal { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DenunciationExecutionStatusFinal, + ): DenunciationExecutionStatusFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.DenunciationIndex denunciation_index */ 1: + message.denunciationIndex = DenunciationIndex.internalBinaryRead( + reader, + reader.uint32(), + options, + message.denunciationIndex, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DenunciationExecutionStatusFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.DenunciationIndex denunciation_index = 1; */ + if (message.denunciationIndex) + DenunciationIndex.internalBinaryWrite( + message.denunciationIndex, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.DenunciationExecutionStatusFinal + */ +export const DenunciationExecutionStatusFinal = + new DenunciationExecutionStatusFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressRollsCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressRollsCandidate', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): AddressRollsCandidate { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressRollsCandidate, + ): AddressRollsCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressRollsCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressRollsCandidate + */ +export const AddressRollsCandidate = new AddressRollsCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressRollsFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressRollsFinal', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): AddressRollsFinal { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressRollsFinal, + ): AddressRollsFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressRollsFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressRollsFinal + */ +export const AddressRollsFinal = new AddressRollsFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressDeferredCreditsCandidate$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressDeferredCreditsCandidate', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressDeferredCreditsCandidate { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressDeferredCreditsCandidate, + ): AddressDeferredCreditsCandidate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressDeferredCreditsCandidate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressDeferredCreditsCandidate + */ +export const AddressDeferredCreditsCandidate = + new AddressDeferredCreditsCandidate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressDeferredCreditsFinal$Type extends MessageType { + constructor() { + super('massa.api.v1.AddressDeferredCreditsFinal', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create( + value?: PartialMessage, + ): AddressDeferredCreditsFinal { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressDeferredCreditsFinal, + ): AddressDeferredCreditsFinal { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressDeferredCreditsFinal, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AddressDeferredCreditsFinal + */ +export const AddressDeferredCreditsFinal = + new AddressDeferredCreditsFinal$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CycleInfos$Type extends MessageType { + constructor() { + super('massa.api.v1.CycleInfos', [ + { + no: 1, + name: 'cycle', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 2, + name: 'restrict_to_addresses', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): CycleInfos { + const message = { cycle: 0n, restrictToAddresses: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CycleInfos, + ): CycleInfos { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 cycle */ 1: + message.cycle = reader.uint64().toBigInt(); + break; + case /* repeated string restrict_to_addresses */ 2: + message.restrictToAddresses.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CycleInfos, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 cycle = 1; */ + if (message.cycle !== 0n) + writer.tag(1, WireType.Varint).uint64(message.cycle); + /* repeated string restrict_to_addresses = 2; */ + for (let i = 0; i < message.restrictToAddresses.length; i++) + writer + .tag(2, WireType.LengthDelimited) + .string(message.restrictToAddresses[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.CycleInfos + */ +export const CycleInfos = new CycleInfos$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Events$Type extends MessageType { + constructor() { + super('massa.api.v1.Events', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ScExecutionEventsFilter, + }, + ]); + } + create(value?: PartialMessage): Events { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Events, + ): Events { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.ScExecutionEventsFilter filters */ 1: + message.filters.push( + ScExecutionEventsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Events, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.ScExecutionEventsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + ScExecutionEventsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.Events + */ +export const Events = new Events$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryStateResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.QueryStateResponse', [ + { no: 1, name: 'final_cursor', kind: 'message', T: () => Slot }, + { no: 2, name: 'candidate_cursor', kind: 'message', T: () => Slot }, + { + no: 3, + name: 'final_state_fingerprint', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'responses', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ExecutionQueryResponse, + }, + ]); + } + create(value?: PartialMessage): QueryStateResponse { + const message = { finalStateFingerprint: '', responses: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: QueryStateResponse, + ): QueryStateResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot final_cursor */ 1: + message.finalCursor = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.finalCursor, + ); + break; + case /* massa.model.v1.Slot candidate_cursor */ 2: + message.candidateCursor = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.candidateCursor, + ); + break; + case /* string final_state_fingerprint */ 3: + message.finalStateFingerprint = reader.string(); + break; + case /* repeated massa.api.v1.ExecutionQueryResponse responses */ 4: + message.responses.push( + ExecutionQueryResponse.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: QueryStateResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot final_cursor = 1; */ + if (message.finalCursor) + Slot.internalBinaryWrite( + message.finalCursor, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot candidate_cursor = 2; */ + if (message.candidateCursor) + Slot.internalBinaryWrite( + message.candidateCursor, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string final_state_fingerprint = 3; */ + if (message.finalStateFingerprint !== '') + writer + .tag(3, WireType.LengthDelimited) + .string(message.finalStateFingerprint); + /* repeated massa.api.v1.ExecutionQueryResponse responses = 4; */ + for (let i = 0; i < message.responses.length; i++) + ExecutionQueryResponse.internalBinaryWrite( + message.responses[i], + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.QueryStateResponse + */ +export const QueryStateResponse = new QueryStateResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryResponse', [ + { + no: 1, + name: 'result', + kind: 'message', + oneof: 'response', + T: () => ExecutionQueryResponseItem, + }, + { + no: 2, + name: 'error', + kind: 'message', + oneof: 'response', + T: () => Error, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryResponse { + const message = { response: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryResponse, + ): ExecutionQueryResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.api.v1.ExecutionQueryResponseItem result */ 1: + message.response = { + oneofKind: 'result', + result: ExecutionQueryResponseItem.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.response as any).result, + ), + }; + break; + case /* massa.model.v1.Error error */ 2: + message.response = { + oneofKind: 'error', + error: Error.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.response as any).error, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.api.v1.ExecutionQueryResponseItem result = 1; */ + if (message.response.oneofKind === 'result') + ExecutionQueryResponseItem.internalBinaryWrite( + message.response.result, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Error error = 2; */ + if (message.response.oneofKind === 'error') + Error.internalBinaryWrite( + message.response.error, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryResponse + */ +export const ExecutionQueryResponse = new ExecutionQueryResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryResponseItem$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryResponseItem', [ + { + no: 1, + name: 'boolean', + kind: 'scalar', + oneof: 'responseItem', + T: 8 /* ScalarType.BOOL*/, + }, + { + no: 2, + name: 'roll_count', + kind: 'scalar', + oneof: 'responseItem', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 3, + name: 'amount', + kind: 'message', + oneof: 'responseItem', + T: () => NativeAmount, + }, + { + no: 4, + name: 'bytes', + kind: 'scalar', + oneof: 'responseItem', + T: 12 /* ScalarType.BYTES*/, + }, + { + no: 5, + name: 'vec_bytes', + kind: 'message', + oneof: 'responseItem', + T: () => ArrayOfBytesWrapper, + }, + { + no: 6, + name: 'deferred_credits', + kind: 'message', + oneof: 'responseItem', + T: () => DeferredCreditsEntryWrapper, + }, + { + no: 7, + name: 'execution_status', + kind: 'enum', + oneof: 'responseItem', + T: () => [ + 'massa.api.v1.ExecutionQueryExecutionStatus', + ExecutionQueryExecutionStatus, + 'EXECUTION_QUERY_EXECUTION_STATUS_', + ], + }, + { + no: 8, + name: 'cycle_infos', + kind: 'message', + oneof: 'responseItem', + T: () => ExecutionQueryCycleInfos, + }, + { + no: 9, + name: 'events', + kind: 'message', + oneof: 'responseItem', + T: () => ScOutputEventsWrapper, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryResponseItem { + const message = { responseItem: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryResponseItem, + ): ExecutionQueryResponseItem { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool boolean */ 1: + message.responseItem = { + oneofKind: 'boolean', + boolean: reader.bool(), + }; + break; + case /* uint64 roll_count */ 2: + message.responseItem = { + oneofKind: 'rollCount', + rollCount: reader.uint64().toBigInt(), + }; + break; + case /* massa.model.v1.NativeAmount amount */ 3: + message.responseItem = { + oneofKind: 'amount', + amount: NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.responseItem as any).amount, + ), + }; + break; + case /* bytes bytes */ 4: + message.responseItem = { + oneofKind: 'bytes', + bytes: reader.bytes(), + }; + break; + case /* massa.model.v1.ArrayOfBytesWrapper vec_bytes */ 5: + message.responseItem = { + oneofKind: 'vecBytes', + vecBytes: ArrayOfBytesWrapper.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.responseItem as any).vecBytes, + ), + }; + break; + case /* massa.api.v1.DeferredCreditsEntryWrapper deferred_credits */ 6: + message.responseItem = { + oneofKind: 'deferredCredits', + deferredCredits: DeferredCreditsEntryWrapper.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.responseItem as any).deferredCredits, + ), + }; + break; + case /* massa.api.v1.ExecutionQueryExecutionStatus execution_status */ 7: + message.responseItem = { + oneofKind: 'executionStatus', + executionStatus: reader.int32(), + }; + break; + case /* massa.api.v1.ExecutionQueryCycleInfos cycle_infos */ 8: + message.responseItem = { + oneofKind: 'cycleInfos', + cycleInfos: ExecutionQueryCycleInfos.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.responseItem as any).cycleInfos, + ), + }; + break; + case /* massa.api.v1.ScOutputEventsWrapper events */ 9: + message.responseItem = { + oneofKind: 'events', + events: ScOutputEventsWrapper.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.responseItem as any).events, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryResponseItem, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool boolean = 1; */ + if (message.responseItem.oneofKind === 'boolean') + writer.tag(1, WireType.Varint).bool(message.responseItem.boolean); + /* uint64 roll_count = 2; */ + if (message.responseItem.oneofKind === 'rollCount') + writer.tag(2, WireType.Varint).uint64(message.responseItem.rollCount); + /* massa.model.v1.NativeAmount amount = 3; */ + if (message.responseItem.oneofKind === 'amount') + NativeAmount.internalBinaryWrite( + message.responseItem.amount, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bytes bytes = 4; */ + if (message.responseItem.oneofKind === 'bytes') + writer.tag(4, WireType.LengthDelimited).bytes(message.responseItem.bytes); + /* massa.model.v1.ArrayOfBytesWrapper vec_bytes = 5; */ + if (message.responseItem.oneofKind === 'vecBytes') + ArrayOfBytesWrapper.internalBinaryWrite( + message.responseItem.vecBytes, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.DeferredCreditsEntryWrapper deferred_credits = 6; */ + if (message.responseItem.oneofKind === 'deferredCredits') + DeferredCreditsEntryWrapper.internalBinaryWrite( + message.responseItem.deferredCredits, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.ExecutionQueryExecutionStatus execution_status = 7; */ + if (message.responseItem.oneofKind === 'executionStatus') + writer + .tag(7, WireType.Varint) + .int32(message.responseItem.executionStatus); + /* massa.api.v1.ExecutionQueryCycleInfos cycle_infos = 8; */ + if (message.responseItem.oneofKind === 'cycleInfos') + ExecutionQueryCycleInfos.internalBinaryWrite( + message.responseItem.cycleInfos, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.ScOutputEventsWrapper events = 9; */ + if (message.responseItem.oneofKind === 'events') + ScOutputEventsWrapper.internalBinaryWrite( + message.responseItem.events, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryResponseItem + */ +export const ExecutionQueryResponseItem = new ExecutionQueryResponseItem$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeferredCreditsEntryWrapper$Type extends MessageType { + constructor() { + super('massa.api.v1.DeferredCreditsEntryWrapper', [ + { + no: 1, + name: 'entries', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => DeferredCreditsEntry, + }, + ]); + } + create( + value?: PartialMessage, + ): DeferredCreditsEntryWrapper { + const message = { entries: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DeferredCreditsEntryWrapper, + ): DeferredCreditsEntryWrapper { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.DeferredCreditsEntry entries */ 1: + message.entries.push( + DeferredCreditsEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DeferredCreditsEntryWrapper, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.DeferredCreditsEntry entries = 1; */ + for (let i = 0; i < message.entries.length; i++) + DeferredCreditsEntry.internalBinaryWrite( + message.entries[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.DeferredCreditsEntryWrapper + */ +export const DeferredCreditsEntryWrapper = + new DeferredCreditsEntryWrapper$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeferredCreditsEntry$Type extends MessageType { + constructor() { + super('massa.api.v1.DeferredCreditsEntry', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + { no: 2, name: 'amount', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): DeferredCreditsEntry { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DeferredCreditsEntry, + ): DeferredCreditsEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + case /* massa.model.v1.NativeAmount amount */ 2: + message.amount = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.amount, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DeferredCreditsEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount amount = 2; */ + if (message.amount) + NativeAmount.internalBinaryWrite( + message.amount, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.DeferredCreditsEntry + */ +export const DeferredCreditsEntry = new DeferredCreditsEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryCycleInfos$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryCycleInfos', [ + { + no: 1, + name: 'cycle', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 2, name: 'is_final', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + { + no: 3, + name: 'staker_infos', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ExecutionQueryStakerInfoEntry, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryCycleInfos { + const message = { cycle: 0n, isFinal: false, stakerInfos: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryCycleInfos, + ): ExecutionQueryCycleInfos { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 cycle */ 1: + message.cycle = reader.uint64().toBigInt(); + break; + case /* bool is_final */ 2: + message.isFinal = reader.bool(); + break; + case /* repeated massa.api.v1.ExecutionQueryStakerInfoEntry staker_infos */ 3: + message.stakerInfos.push( + ExecutionQueryStakerInfoEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryCycleInfos, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 cycle = 1; */ + if (message.cycle !== 0n) + writer.tag(1, WireType.Varint).uint64(message.cycle); + /* bool is_final = 2; */ + if (message.isFinal !== false) + writer.tag(2, WireType.Varint).bool(message.isFinal); + /* repeated massa.api.v1.ExecutionQueryStakerInfoEntry staker_infos = 3; */ + for (let i = 0; i < message.stakerInfos.length; i++) + ExecutionQueryStakerInfoEntry.internalBinaryWrite( + message.stakerInfos[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryCycleInfos + */ +export const ExecutionQueryCycleInfos = new ExecutionQueryCycleInfos$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryStakerInfoEntry$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryStakerInfoEntry', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'info', + kind: 'message', + T: () => ExecutionQueryStakerInfo, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryStakerInfoEntry { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryStakerInfoEntry, + ): ExecutionQueryStakerInfoEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* massa.api.v1.ExecutionQueryStakerInfo info */ 2: + message.info = ExecutionQueryStakerInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.info, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryStakerInfoEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* massa.api.v1.ExecutionQueryStakerInfo info = 2; */ + if (message.info) + ExecutionQueryStakerInfo.internalBinaryWrite( + message.info, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryStakerInfoEntry + */ +export const ExecutionQueryStakerInfoEntry = + new ExecutionQueryStakerInfoEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryStakerInfo$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryStakerInfo', [ + { + no: 1, + name: 'active_rolls', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 2, + name: 'production_stats', + kind: 'message', + T: () => ExecutionQueryStakerInfoProductionStatsEntry, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryStakerInfo { + const message = { activeRolls: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryStakerInfo, + ): ExecutionQueryStakerInfo { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 active_rolls */ 1: + message.activeRolls = reader.uint64().toBigInt(); + break; + case /* massa.api.v1.ExecutionQueryStakerInfoProductionStatsEntry production_stats */ 2: + message.productionStats = + ExecutionQueryStakerInfoProductionStatsEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + message.productionStats, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryStakerInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 active_rolls = 1; */ + if (message.activeRolls !== 0n) + writer.tag(1, WireType.Varint).uint64(message.activeRolls); + /* massa.api.v1.ExecutionQueryStakerInfoProductionStatsEntry production_stats = 2; */ + if (message.productionStats) + ExecutionQueryStakerInfoProductionStatsEntry.internalBinaryWrite( + message.productionStats, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryStakerInfo + */ +export const ExecutionQueryStakerInfo = new ExecutionQueryStakerInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryStakerInfoProductionStatsEntry$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryStakerInfoProductionStatsEntry', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'stats', + kind: 'message', + T: () => ExecutionQueryStakerInfoProductionStats, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryStakerInfoProductionStatsEntry { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryStakerInfoProductionStatsEntry, + ): ExecutionQueryStakerInfoProductionStatsEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* massa.api.v1.ExecutionQueryStakerInfoProductionStats stats */ 2: + message.stats = + ExecutionQueryStakerInfoProductionStats.internalBinaryRead( + reader, + reader.uint32(), + options, + message.stats, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryStakerInfoProductionStatsEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* massa.api.v1.ExecutionQueryStakerInfoProductionStats stats = 2; */ + if (message.stats) + ExecutionQueryStakerInfoProductionStats.internalBinaryWrite( + message.stats, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryStakerInfoProductionStatsEntry + */ +export const ExecutionQueryStakerInfoProductionStatsEntry = + new ExecutionQueryStakerInfoProductionStatsEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionQueryStakerInfoProductionStats$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionQueryStakerInfoProductionStats', [ + { + no: 1, + name: 'block_success_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 2, + name: 'block_failure_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutionQueryStakerInfoProductionStats { + const message = { blockSuccessCount: 0n, blockFailureCount: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionQueryStakerInfoProductionStats, + ): ExecutionQueryStakerInfoProductionStats { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 block_success_count */ 1: + message.blockSuccessCount = reader.uint64().toBigInt(); + break; + case /* uint64 block_failure_count */ 2: + message.blockFailureCount = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionQueryStakerInfoProductionStats, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 block_success_count = 1; */ + if (message.blockSuccessCount !== 0n) + writer.tag(1, WireType.Varint).uint64(message.blockSuccessCount); + /* uint64 block_failure_count = 2; */ + if (message.blockFailureCount !== 0n) + writer.tag(2, WireType.Varint).uint64(message.blockFailureCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionQueryStakerInfoProductionStats + */ +export const ExecutionQueryStakerInfoProductionStats = + new ExecutionQueryStakerInfoProductionStats$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScOutputEventsWrapper$Type extends MessageType { + constructor() { + super('massa.api.v1.ScOutputEventsWrapper', [ + { + no: 1, + name: 'events', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ScExecutionEvent, + }, + ]); + } + create(value?: PartialMessage): ScOutputEventsWrapper { + const message = { events: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScOutputEventsWrapper, + ): ScOutputEventsWrapper { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.ScExecutionEvent events */ 1: + message.events.push( + ScExecutionEvent.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScOutputEventsWrapper, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.ScExecutionEvent events = 1; */ + for (let i = 0; i < message.events.length; i++) + ScExecutionEvent.internalBinaryWrite( + message.events[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ScOutputEventsWrapper + */ +export const ScOutputEventsWrapper = new ScOutputEventsWrapper$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewBlocksRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.NewBlocksRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => NewBlocksFilter, + }, + ]); + } + create(value?: PartialMessage): NewBlocksRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewBlocksRequest, + ): NewBlocksRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.NewBlocksFilter filters */ 1: + message.filters.push( + NewBlocksFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewBlocksRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.NewBlocksFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + NewBlocksFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewBlocksRequest + */ +export const NewBlocksRequest = new NewBlocksRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewBlocksFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.NewBlocksFilter', [ + { + no: 1, + name: 'block_ids', + kind: 'message', + oneof: 'filter', + T: () => BlockIds, + }, + { + no: 2, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + { + no: 3, + name: 'slot_range', + kind: 'message', + oneof: 'filter', + T: () => SlotRange, + }, + ]); + } + create(value?: PartialMessage): NewBlocksFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewBlocksFilter, + ): NewBlocksFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.BlockIds block_ids */ 1: + message.filter = { + oneofKind: 'blockIds', + blockIds: BlockIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).blockIds, + ), + }; + break; + case /* massa.model.v1.Addresses addresses */ 2: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + case /* massa.model.v1.SlotRange slot_range */ 3: + message.filter = { + oneofKind: 'slotRange', + slotRange: SlotRange.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).slotRange, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewBlocksFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.BlockIds block_ids = 1; */ + if (message.filter.oneofKind === 'blockIds') + BlockIds.internalBinaryWrite( + message.filter.blockIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Addresses addresses = 2; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SlotRange slot_range = 3; */ + if (message.filter.oneofKind === 'slotRange') + SlotRange.internalBinaryWrite( + message.filter.slotRange, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewBlocksFilter + */ +export const NewBlocksFilter = new NewBlocksFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewBlocksResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.NewBlocksResponse', [ + { no: 1, name: 'signed_block', kind: 'message', T: () => SignedBlock }, + ]); + } + create(value?: PartialMessage): NewBlocksResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewBlocksResponse, + ): NewBlocksResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SignedBlock signed_block */ 1: + message.signedBlock = SignedBlock.internalBinaryRead( + reader, + reader.uint32(), + options, + message.signedBlock, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewBlocksResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SignedBlock signed_block = 1; */ + if (message.signedBlock) + SignedBlock.internalBinaryWrite( + message.signedBlock, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewBlocksResponse + */ +export const NewBlocksResponse = new NewBlocksResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewEndorsementsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.NewEndorsementsRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => NewEndorsementsFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): NewEndorsementsRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewEndorsementsRequest, + ): NewEndorsementsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.NewEndorsementsFilter filters */ 1: + message.filters.push( + NewEndorsementsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewEndorsementsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.NewEndorsementsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + NewEndorsementsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewEndorsementsRequest + */ +export const NewEndorsementsRequest = new NewEndorsementsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewEndorsementsFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.NewEndorsementsFilter', [ + { + no: 1, + name: 'endorsement_ids', + kind: 'message', + oneof: 'filter', + T: () => EndorsementIds, + }, + { + no: 2, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + { + no: 3, + name: 'block_ids', + kind: 'message', + oneof: 'filter', + T: () => BlockIds, + }, + ]); + } + create(value?: PartialMessage): NewEndorsementsFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewEndorsementsFilter, + ): NewEndorsementsFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.EndorsementIds endorsement_ids */ 1: + message.filter = { + oneofKind: 'endorsementIds', + endorsementIds: EndorsementIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).endorsementIds, + ), + }; + break; + case /* massa.model.v1.Addresses addresses */ 2: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + case /* massa.model.v1.BlockIds block_ids */ 3: + message.filter = { + oneofKind: 'blockIds', + blockIds: BlockIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).blockIds, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewEndorsementsFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.EndorsementIds endorsement_ids = 1; */ + if (message.filter.oneofKind === 'endorsementIds') + EndorsementIds.internalBinaryWrite( + message.filter.endorsementIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Addresses addresses = 2; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.BlockIds block_ids = 3; */ + if (message.filter.oneofKind === 'blockIds') + BlockIds.internalBinaryWrite( + message.filter.blockIds, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewEndorsementsFilter + */ +export const NewEndorsementsFilter = new NewEndorsementsFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewEndorsementsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.NewEndorsementsResponse', [ + { + no: 1, + name: 'signed_endorsement', + kind: 'message', + T: () => SignedEndorsement, + }, + ]); + } + create( + value?: PartialMessage, + ): NewEndorsementsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewEndorsementsResponse, + ): NewEndorsementsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SignedEndorsement signed_endorsement */ 1: + message.signedEndorsement = SignedEndorsement.internalBinaryRead( + reader, + reader.uint32(), + options, + message.signedEndorsement, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewEndorsementsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SignedEndorsement signed_endorsement = 1; */ + if (message.signedEndorsement) + SignedEndorsement.internalBinaryWrite( + message.signedEndorsement, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewEndorsementsResponse + */ +export const NewEndorsementsResponse = new NewEndorsementsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewFilledBlocksRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.NewFilledBlocksRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => NewBlocksFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): NewFilledBlocksRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewFilledBlocksRequest, + ): NewFilledBlocksRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.NewBlocksFilter filters */ 1: + message.filters.push( + NewBlocksFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewFilledBlocksRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.NewBlocksFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + NewBlocksFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewFilledBlocksRequest + */ +export const NewFilledBlocksRequest = new NewFilledBlocksRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewFilledBlocksFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.NewFilledBlocksFilter', [ + { + no: 1, + name: 'block_ids', + kind: 'message', + oneof: 'filter', + T: () => BlockIds, + }, + { + no: 2, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + { + no: 3, + name: 'slot_range', + kind: 'message', + oneof: 'filter', + T: () => SlotRange, + }, + ]); + } + create(value?: PartialMessage): NewFilledBlocksFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewFilledBlocksFilter, + ): NewFilledBlocksFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.BlockIds block_ids */ 1: + message.filter = { + oneofKind: 'blockIds', + blockIds: BlockIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).blockIds, + ), + }; + break; + case /* massa.model.v1.Addresses addresses */ 2: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + case /* massa.model.v1.SlotRange slot_range */ 3: + message.filter = { + oneofKind: 'slotRange', + slotRange: SlotRange.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).slotRange, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewFilledBlocksFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.BlockIds block_ids = 1; */ + if (message.filter.oneofKind === 'blockIds') + BlockIds.internalBinaryWrite( + message.filter.blockIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Addresses addresses = 2; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SlotRange slot_range = 3; */ + if (message.filter.oneofKind === 'slotRange') + SlotRange.internalBinaryWrite( + message.filter.slotRange, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewFilledBlocksFilter + */ +export const NewFilledBlocksFilter = new NewFilledBlocksFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewFilledBlocksResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.NewFilledBlocksResponse', [ + { no: 1, name: 'filled_block', kind: 'message', T: () => FilledBlock }, + ]); + } + create( + value?: PartialMessage, + ): NewFilledBlocksResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewFilledBlocksResponse, + ): NewFilledBlocksResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.FilledBlock filled_block */ 1: + message.filledBlock = FilledBlock.internalBinaryRead( + reader, + reader.uint32(), + options, + message.filledBlock, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewFilledBlocksResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.FilledBlock filled_block = 1; */ + if (message.filledBlock) + FilledBlock.internalBinaryWrite( + message.filledBlock, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewFilledBlocksResponse + */ +export const NewFilledBlocksResponse = new NewFilledBlocksResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewOperationsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.NewOperationsRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => NewOperationsFilter, + }, + ]); + } + create(value?: PartialMessage): NewOperationsRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewOperationsRequest, + ): NewOperationsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.NewOperationsFilter filters */ 1: + message.filters.push( + NewOperationsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewOperationsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.NewOperationsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + NewOperationsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewOperationsRequest + */ +export const NewOperationsRequest = new NewOperationsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewOperationsFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.NewOperationsFilter', [ + { + no: 1, + name: 'operation_ids', + kind: 'message', + oneof: 'filter', + T: () => OperationIds, + }, + { + no: 2, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + { + no: 3, + name: 'operation_types', + kind: 'message', + oneof: 'filter', + T: () => OpTypes, + }, + ]); + } + create(value?: PartialMessage): NewOperationsFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewOperationsFilter, + ): NewOperationsFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.OperationIds operation_ids */ 1: + message.filter = { + oneofKind: 'operationIds', + operationIds: OperationIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).operationIds, + ), + }; + break; + case /* massa.model.v1.Addresses addresses */ 2: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + case /* massa.model.v1.OpTypes operation_types */ 3: + message.filter = { + oneofKind: 'operationTypes', + operationTypes: OpTypes.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).operationTypes, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewOperationsFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.OperationIds operation_ids = 1; */ + if (message.filter.oneofKind === 'operationIds') + OperationIds.internalBinaryWrite( + message.filter.operationIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Addresses addresses = 2; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.OpTypes operation_types = 3; */ + if (message.filter.oneofKind === 'operationTypes') + OpTypes.internalBinaryWrite( + message.filter.operationTypes, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewOperationsFilter + */ +export const NewOperationsFilter = new NewOperationsFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewOperationsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.NewOperationsResponse', [ + { + no: 1, + name: 'signed_operation', + kind: 'message', + T: () => SignedOperation, + }, + ]); + } + create(value?: PartialMessage): NewOperationsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewOperationsResponse, + ): NewOperationsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SignedOperation signed_operation */ 1: + message.signedOperation = SignedOperation.internalBinaryRead( + reader, + reader.uint32(), + options, + message.signedOperation, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewOperationsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SignedOperation signed_operation = 1; */ + if (message.signedOperation) + SignedOperation.internalBinaryWrite( + message.signedOperation, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewOperationsResponse + */ +export const NewOperationsResponse = new NewOperationsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewSlotExecutionOutputsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.NewSlotExecutionOutputsRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => NewSlotExecutionOutputsFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): NewSlotExecutionOutputsRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewSlotExecutionOutputsRequest, + ): NewSlotExecutionOutputsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.NewSlotExecutionOutputsFilter filters */ 1: + message.filters.push( + NewSlotExecutionOutputsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewSlotExecutionOutputsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.NewSlotExecutionOutputsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + NewSlotExecutionOutputsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewSlotExecutionOutputsRequest + */ +export const NewSlotExecutionOutputsRequest = + new NewSlotExecutionOutputsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewSlotExecutionOutputsFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.NewSlotExecutionOutputsFilter', [ + { + no: 1, + name: 'status', + kind: 'enum', + oneof: 'filter', + T: () => [ + 'massa.model.v1.ExecutionOutputStatus', + ExecutionOutputStatus, + 'EXECUTION_OUTPUT_STATUS_', + ], + }, + { + no: 2, + name: 'slot_range', + kind: 'message', + oneof: 'filter', + T: () => SlotRange, + }, + { + no: 3, + name: 'async_pool_changes_filter', + kind: 'message', + oneof: 'filter', + T: () => AsyncPoolChangesFilter, + }, + { + no: 4, + name: 'executed_denounciation_filter', + kind: 'message', + oneof: 'filter', + T: () => ExecutedDenounciationFilter, + }, + { + no: 5, + name: 'event_filter', + kind: 'message', + oneof: 'filter', + T: () => ExecutionEventFilter, + }, + { + no: 6, + name: 'executed_ops_changes_filter', + kind: 'message', + oneof: 'filter', + T: () => ExecutedOpsChangesFilter, + }, + { + no: 7, + name: 'ledger_changes_filter', + kind: 'message', + oneof: 'filter', + T: () => LedgerChangesFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): NewSlotExecutionOutputsFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewSlotExecutionOutputsFilter, + ): NewSlotExecutionOutputsFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ExecutionOutputStatus status */ 1: + message.filter = { + oneofKind: 'status', + status: reader.int32(), + }; + break; + case /* massa.model.v1.SlotRange slot_range */ 2: + message.filter = { + oneofKind: 'slotRange', + slotRange: SlotRange.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).slotRange, + ), + }; + break; + case /* massa.api.v1.AsyncPoolChangesFilter async_pool_changes_filter */ 3: + message.filter = { + oneofKind: 'asyncPoolChangesFilter', + asyncPoolChangesFilter: AsyncPoolChangesFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).asyncPoolChangesFilter, + ), + }; + break; + case /* massa.api.v1.ExecutedDenounciationFilter executed_denounciation_filter */ 4: + message.filter = { + oneofKind: 'executedDenounciationFilter', + executedDenounciationFilter: + ExecutedDenounciationFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).executedDenounciationFilter, + ), + }; + break; + case /* massa.api.v1.ExecutionEventFilter event_filter */ 5: + message.filter = { + oneofKind: 'eventFilter', + eventFilter: ExecutionEventFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).eventFilter, + ), + }; + break; + case /* massa.api.v1.ExecutedOpsChangesFilter executed_ops_changes_filter */ 6: + message.filter = { + oneofKind: 'executedOpsChangesFilter', + executedOpsChangesFilter: + ExecutedOpsChangesFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).executedOpsChangesFilter, + ), + }; + break; + case /* massa.api.v1.LedgerChangesFilter ledger_changes_filter */ 7: + message.filter = { + oneofKind: 'ledgerChangesFilter', + ledgerChangesFilter: LedgerChangesFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).ledgerChangesFilter, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewSlotExecutionOutputsFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ExecutionOutputStatus status = 1; */ + if (message.filter.oneofKind === 'status') + writer.tag(1, WireType.Varint).int32(message.filter.status); + /* massa.model.v1.SlotRange slot_range = 2; */ + if (message.filter.oneofKind === 'slotRange') + SlotRange.internalBinaryWrite( + message.filter.slotRange, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.AsyncPoolChangesFilter async_pool_changes_filter = 3; */ + if (message.filter.oneofKind === 'asyncPoolChangesFilter') + AsyncPoolChangesFilter.internalBinaryWrite( + message.filter.asyncPoolChangesFilter, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.ExecutedDenounciationFilter executed_denounciation_filter = 4; */ + if (message.filter.oneofKind === 'executedDenounciationFilter') + ExecutedDenounciationFilter.internalBinaryWrite( + message.filter.executedDenounciationFilter, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.ExecutionEventFilter event_filter = 5; */ + if (message.filter.oneofKind === 'eventFilter') + ExecutionEventFilter.internalBinaryWrite( + message.filter.eventFilter, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.ExecutedOpsChangesFilter executed_ops_changes_filter = 6; */ + if (message.filter.oneofKind === 'executedOpsChangesFilter') + ExecutedOpsChangesFilter.internalBinaryWrite( + message.filter.executedOpsChangesFilter, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.api.v1.LedgerChangesFilter ledger_changes_filter = 7; */ + if (message.filter.oneofKind === 'ledgerChangesFilter') + LedgerChangesFilter.internalBinaryWrite( + message.filter.ledgerChangesFilter, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewSlotExecutionOutputsFilter + */ +export const NewSlotExecutionOutputsFilter = + new NewSlotExecutionOutputsFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AsyncPoolChangesFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.AsyncPoolChangesFilter', [ + { no: 1, name: 'none', kind: 'message', oneof: 'filter', T: () => Empty }, + { + no: 2, + name: 'type', + kind: 'enum', + oneof: 'filter', + T: () => [ + 'massa.model.v1.AsyncPoolChangeType', + AsyncPoolChangeType, + 'ASYNC_POOL_CHANGE_TYPE_', + ], + }, + { + no: 3, + name: 'handler', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'destination_address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'emitter_address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'can_be_executed', + kind: 'scalar', + oneof: 'filter', + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create( + value?: PartialMessage, + ): AsyncPoolChangesFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AsyncPoolChangesFilter, + ): AsyncPoolChangesFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Empty none */ 1: + message.filter = { + oneofKind: 'none', + none: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).none, + ), + }; + break; + case /* massa.model.v1.AsyncPoolChangeType type */ 2: + message.filter = { + oneofKind: 'type', + type: reader.int32(), + }; + break; + case /* string handler */ 3: + message.filter = { + oneofKind: 'handler', + handler: reader.string(), + }; + break; + case /* string destination_address */ 4: + message.filter = { + oneofKind: 'destinationAddress', + destinationAddress: reader.string(), + }; + break; + case /* string emitter_address */ 5: + message.filter = { + oneofKind: 'emitterAddress', + emitterAddress: reader.string(), + }; + break; + case /* bool can_be_executed */ 6: + message.filter = { + oneofKind: 'canBeExecuted', + canBeExecuted: reader.bool(), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AsyncPoolChangesFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Empty none = 1; */ + if (message.filter.oneofKind === 'none') + Empty.internalBinaryWrite( + message.filter.none, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.AsyncPoolChangeType type = 2; */ + if (message.filter.oneofKind === 'type') + writer.tag(2, WireType.Varint).int32(message.filter.type); + /* string handler = 3; */ + if (message.filter.oneofKind === 'handler') + writer.tag(3, WireType.LengthDelimited).string(message.filter.handler); + /* string destination_address = 4; */ + if (message.filter.oneofKind === 'destinationAddress') + writer + .tag(4, WireType.LengthDelimited) + .string(message.filter.destinationAddress); + /* string emitter_address = 5; */ + if (message.filter.oneofKind === 'emitterAddress') + writer + .tag(5, WireType.LengthDelimited) + .string(message.filter.emitterAddress); + /* bool can_be_executed = 6; */ + if (message.filter.oneofKind === 'canBeExecuted') + writer.tag(6, WireType.Varint).bool(message.filter.canBeExecuted); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.AsyncPoolChangesFilter + */ +export const AsyncPoolChangesFilter = new AsyncPoolChangesFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PosChangesFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.PosChangesFilter', [ + { no: 1, name: 'none', kind: 'message', oneof: 'filter', T: () => Empty }, + { + no: 2, + name: 'address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): PosChangesFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PosChangesFilter, + ): PosChangesFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Empty none */ 1: + message.filter = { + oneofKind: 'none', + none: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).none, + ), + }; + break; + case /* string address */ 2: + message.filter = { + oneofKind: 'address', + address: reader.string(), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: PosChangesFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Empty none = 1; */ + if (message.filter.oneofKind === 'none') + Empty.internalBinaryWrite( + message.filter.none, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string address = 2; */ + if (message.filter.oneofKind === 'address') + writer.tag(2, WireType.LengthDelimited).string(message.filter.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.PosChangesFilter + */ +export const PosChangesFilter = new PosChangesFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionEventFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutionEventFilter', [ + { no: 1, name: 'none', kind: 'message', oneof: 'filter', T: () => Empty }, + { + no: 2, + name: 'caller_address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 3, + name: 'emitter_address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'original_operation_id', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'is_failure', + kind: 'scalar', + oneof: 'filter', + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create(value?: PartialMessage): ExecutionEventFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionEventFilter, + ): ExecutionEventFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Empty none */ 1: + message.filter = { + oneofKind: 'none', + none: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).none, + ), + }; + break; + case /* string caller_address */ 2: + message.filter = { + oneofKind: 'callerAddress', + callerAddress: reader.string(), + }; + break; + case /* string emitter_address */ 3: + message.filter = { + oneofKind: 'emitterAddress', + emitterAddress: reader.string(), + }; + break; + case /* string original_operation_id */ 4: + message.filter = { + oneofKind: 'originalOperationId', + originalOperationId: reader.string(), + }; + break; + case /* bool is_failure */ 5: + message.filter = { + oneofKind: 'isFailure', + isFailure: reader.bool(), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionEventFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Empty none = 1; */ + if (message.filter.oneofKind === 'none') + Empty.internalBinaryWrite( + message.filter.none, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string caller_address = 2; */ + if (message.filter.oneofKind === 'callerAddress') + writer + .tag(2, WireType.LengthDelimited) + .string(message.filter.callerAddress); + /* string emitter_address = 3; */ + if (message.filter.oneofKind === 'emitterAddress') + writer + .tag(3, WireType.LengthDelimited) + .string(message.filter.emitterAddress); + /* string original_operation_id = 4; */ + if (message.filter.oneofKind === 'originalOperationId') + writer + .tag(4, WireType.LengthDelimited) + .string(message.filter.originalOperationId); + /* bool is_failure = 5; */ + if (message.filter.oneofKind === 'isFailure') + writer.tag(5, WireType.Varint).bool(message.filter.isFailure); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutionEventFilter + */ +export const ExecutionEventFilter = new ExecutionEventFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutedOpsChangesFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutedOpsChangesFilter', [ + { no: 1, name: 'none', kind: 'message', oneof: 'filter', T: () => Empty }, + { + no: 2, + name: 'operation_id', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutedOpsChangesFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutedOpsChangesFilter, + ): ExecutedOpsChangesFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Empty none */ 1: + message.filter = { + oneofKind: 'none', + none: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).none, + ), + }; + break; + case /* string operation_id */ 2: + message.filter = { + oneofKind: 'operationId', + operationId: reader.string(), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutedOpsChangesFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Empty none = 1; */ + if (message.filter.oneofKind === 'none') + Empty.internalBinaryWrite( + message.filter.none, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string operation_id = 2; */ + if (message.filter.oneofKind === 'operationId') + writer + .tag(2, WireType.LengthDelimited) + .string(message.filter.operationId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutedOpsChangesFilter + */ +export const ExecutedOpsChangesFilter = new ExecutedOpsChangesFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutedDenounciationFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.ExecutedDenounciationFilter', [ + { no: 1, name: 'none', kind: 'message', oneof: 'filter', T: () => Empty }, + ]); + } + create( + value?: PartialMessage, + ): ExecutedDenounciationFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutedDenounciationFilter, + ): ExecutedDenounciationFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Empty none */ 1: + message.filter = { + oneofKind: 'none', + none: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).none, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutedDenounciationFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Empty none = 1; */ + if (message.filter.oneofKind === 'none') + Empty.internalBinaryWrite( + message.filter.none, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.ExecutedDenounciationFilter + */ +export const ExecutedDenounciationFilter = + new ExecutedDenounciationFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LedgerChangesFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.LedgerChangesFilter', [ + { no: 1, name: 'none', kind: 'message', oneof: 'filter', T: () => Empty }, + { + no: 2, + name: 'address', + kind: 'scalar', + oneof: 'filter', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): LedgerChangesFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LedgerChangesFilter, + ): LedgerChangesFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Empty none */ 1: + message.filter = { + oneofKind: 'none', + none: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).none, + ), + }; + break; + case /* string address */ 2: + message.filter = { + oneofKind: 'address', + address: reader.string(), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LedgerChangesFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Empty none = 1; */ + if (message.filter.oneofKind === 'none') + Empty.internalBinaryWrite( + message.filter.none, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string address = 2; */ + if (message.filter.oneofKind === 'address') + writer.tag(2, WireType.LengthDelimited).string(message.filter.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.LedgerChangesFilter + */ +export const LedgerChangesFilter = new LedgerChangesFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewSlotExecutionOutputsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.NewSlotExecutionOutputsResponse', [ + { no: 1, name: 'output', kind: 'message', T: () => SlotExecutionOutput }, + ]); + } + create( + value?: PartialMessage, + ): NewSlotExecutionOutputsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NewSlotExecutionOutputsResponse, + ): NewSlotExecutionOutputsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SlotExecutionOutput output */ 1: + message.output = SlotExecutionOutput.internalBinaryRead( + reader, + reader.uint32(), + options, + message.output, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NewSlotExecutionOutputsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SlotExecutionOutput output = 1; */ + if (message.output) + SlotExecutionOutput.internalBinaryWrite( + message.output, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.NewSlotExecutionOutputsResponse + */ +export const NewSlotExecutionOutputsResponse = + new NewSlotExecutionOutputsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendBlocksRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.SendBlocksRequest', [ + { no: 1, name: 'block', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): SendBlocksRequest { + const message = { block: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendBlocksRequest, + ): SendBlocksRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes block */ 1: + message.block = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendBlocksRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes block = 1; */ + if (message.block.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.block); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SendBlocksRequest + */ +export const SendBlocksRequest = new SendBlocksRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendBlocksResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.SendBlocksResponse', [ + { + no: 1, + name: 'block_id', + kind: 'scalar', + oneof: 'result', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'error', + kind: 'message', + oneof: 'result', + T: () => Error, + }, + ]); + } + create(value?: PartialMessage): SendBlocksResponse { + const message = { result: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendBlocksResponse, + ): SendBlocksResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string block_id */ 1: + message.result = { + oneofKind: 'blockId', + blockId: reader.string(), + }; + break; + case /* massa.model.v1.Error error */ 2: + message.result = { + oneofKind: 'error', + error: Error.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.result as any).error, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendBlocksResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string block_id = 1; */ + if (message.result.oneofKind === 'blockId') + writer.tag(1, WireType.LengthDelimited).string(message.result.blockId); + /* massa.model.v1.Error error = 2; */ + if (message.result.oneofKind === 'error') + Error.internalBinaryWrite( + message.result.error, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SendBlocksResponse + */ +export const SendBlocksResponse = new SendBlocksResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendEndorsementsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.SendEndorsementsRequest', [ + { + no: 1, + name: 'endorsements', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create( + value?: PartialMessage, + ): SendEndorsementsRequest { + const message = { endorsements: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendEndorsementsRequest, + ): SendEndorsementsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated bytes endorsements */ 1: + message.endorsements.push(reader.bytes()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendEndorsementsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated bytes endorsements = 1; */ + for (let i = 0; i < message.endorsements.length; i++) + writer.tag(1, WireType.LengthDelimited).bytes(message.endorsements[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SendEndorsementsRequest + */ +export const SendEndorsementsRequest = new SendEndorsementsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendEndorsementsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.SendEndorsementsResponse', [ + { + no: 1, + name: 'endorsement_ids', + kind: 'message', + oneof: 'result', + T: () => EndorsementIds, + }, + { + no: 2, + name: 'error', + kind: 'message', + oneof: 'result', + T: () => Error, + }, + ]); + } + create( + value?: PartialMessage, + ): SendEndorsementsResponse { + const message = { result: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendEndorsementsResponse, + ): SendEndorsementsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.EndorsementIds endorsement_ids */ 1: + message.result = { + oneofKind: 'endorsementIds', + endorsementIds: EndorsementIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.result as any).endorsementIds, + ), + }; + break; + case /* massa.model.v1.Error error */ 2: + message.result = { + oneofKind: 'error', + error: Error.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.result as any).error, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendEndorsementsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.EndorsementIds endorsement_ids = 1; */ + if (message.result.oneofKind === 'endorsementIds') + EndorsementIds.internalBinaryWrite( + message.result.endorsementIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Error error = 2; */ + if (message.result.oneofKind === 'error') + Error.internalBinaryWrite( + message.result.error, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SendEndorsementsResponse + */ +export const SendEndorsementsResponse = new SendEndorsementsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendOperationsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.SendOperationsRequest', [ + { + no: 1, + name: 'operations', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): SendOperationsRequest { + const message = { operations: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendOperationsRequest, + ): SendOperationsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated bytes operations */ 1: + message.operations.push(reader.bytes()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendOperationsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated bytes operations = 1; */ + for (let i = 0; i < message.operations.length; i++) + writer.tag(1, WireType.LengthDelimited).bytes(message.operations[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SendOperationsRequest + */ +export const SendOperationsRequest = new SendOperationsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendOperationsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.SendOperationsResponse', [ + { + no: 1, + name: 'operation_ids', + kind: 'message', + oneof: 'result', + T: () => OperationIds, + }, + { + no: 2, + name: 'error', + kind: 'message', + oneof: 'result', + T: () => Error, + }, + ]); + } + create( + value?: PartialMessage, + ): SendOperationsResponse { + const message = { result: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SendOperationsResponse, + ): SendOperationsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.OperationIds operation_ids */ 1: + message.result = { + oneofKind: 'operationIds', + operationIds: OperationIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.result as any).operationIds, + ), + }; + break; + case /* massa.model.v1.Error error */ 2: + message.result = { + oneofKind: 'error', + error: Error.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.result as any).error, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SendOperationsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.OperationIds operation_ids = 1; */ + if (message.result.oneofKind === 'operationIds') + OperationIds.internalBinaryWrite( + message.result.operationIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Error error = 2; */ + if (message.result.oneofKind === 'error') + Error.internalBinaryWrite( + message.result.error, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SendOperationsResponse + */ +export const SendOperationsResponse = new SendOperationsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TransactionsThroughputRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.TransactionsThroughputRequest', [ + { no: 1, name: 'interval', kind: 'message', T: () => UInt64Value }, + ]); + } + create( + value?: PartialMessage, + ): TransactionsThroughputRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: TransactionsThroughputRequest, + ): TransactionsThroughputRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.UInt64Value interval */ 1: + message.interval = UInt64Value.internalBinaryRead( + reader, + reader.uint32(), + options, + message.interval, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: TransactionsThroughputRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* google.protobuf.UInt64Value interval = 1; */ + if (message.interval) + UInt64Value.internalBinaryWrite( + message.interval, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.TransactionsThroughputRequest + */ +export const TransactionsThroughputRequest = + new TransactionsThroughputRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TransactionsThroughputResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.TransactionsThroughputResponse', [ + { + no: 1, + name: 'throughput', + kind: 'scalar', + T: 13 /* ScalarType.UINT32*/, + }, + ]); + } + create( + value?: PartialMessage, + ): TransactionsThroughputResponse { + const message = { throughput: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: TransactionsThroughputResponse, + ): TransactionsThroughputResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 throughput */ 1: + message.throughput = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: TransactionsThroughputResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint32 throughput = 1; */ + if (message.throughput !== 0) + writer.tag(1, WireType.Varint).uint32(message.throughput); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.TransactionsThroughputResponse + */ +export const TransactionsThroughputResponse = + new TransactionsThroughputResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchBlocksRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchBlocksRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => SearchBlocksFilter, + }, + ]); + } + create(value?: PartialMessage): SearchBlocksRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchBlocksRequest, + ): SearchBlocksRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.SearchBlocksFilter filters */ 1: + message.filters.push( + SearchBlocksFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchBlocksRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.SearchBlocksFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + SearchBlocksFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchBlocksRequest + */ +export const SearchBlocksRequest = new SearchBlocksRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchBlocksFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchBlocksFilter', [ + { + no: 1, + name: 'block_ids', + kind: 'message', + oneof: 'filter', + T: () => BlockIds, + }, + { + no: 2, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + { + no: 3, + name: 'slot_range', + kind: 'message', + oneof: 'filter', + T: () => SlotRange, + }, + ]); + } + create(value?: PartialMessage): SearchBlocksFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchBlocksFilter, + ): SearchBlocksFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.BlockIds block_ids */ 1: + message.filter = { + oneofKind: 'blockIds', + blockIds: BlockIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).blockIds, + ), + }; + break; + case /* massa.model.v1.Addresses addresses */ 2: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + case /* massa.model.v1.SlotRange slot_range */ 3: + message.filter = { + oneofKind: 'slotRange', + slotRange: SlotRange.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).slotRange, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchBlocksFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.BlockIds block_ids = 1; */ + if (message.filter.oneofKind === 'blockIds') + BlockIds.internalBinaryWrite( + message.filter.blockIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Addresses addresses = 2; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SlotRange slot_range = 3; */ + if (message.filter.oneofKind === 'slotRange') + SlotRange.internalBinaryWrite( + message.filter.slotRange, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchBlocksFilter + */ +export const SearchBlocksFilter = new SearchBlocksFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchBlocksResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchBlocksResponse', [ + { + no: 1, + name: 'block_infos', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => BlockInfo, + }, + ]); + } + create(value?: PartialMessage): SearchBlocksResponse { + const message = { blockInfos: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchBlocksResponse, + ): SearchBlocksResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.BlockInfo block_infos */ 1: + message.blockInfos.push( + BlockInfo.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchBlocksResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.BlockInfo block_infos = 1; */ + for (let i = 0; i < message.blockInfos.length; i++) + BlockInfo.internalBinaryWrite( + message.blockInfos[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchBlocksResponse + */ +export const SearchBlocksResponse = new SearchBlocksResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchEndorsementsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchEndorsementsRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => SearchEndorsementsFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): SearchEndorsementsRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchEndorsementsRequest, + ): SearchEndorsementsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.SearchEndorsementsFilter filters */ 1: + message.filters.push( + SearchEndorsementsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchEndorsementsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.SearchEndorsementsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + SearchEndorsementsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchEndorsementsRequest + */ +export const SearchEndorsementsRequest = new SearchEndorsementsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchEndorsementsFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchEndorsementsFilter', [ + { + no: 1, + name: 'endorsement_ids', + kind: 'message', + oneof: 'filter', + T: () => EndorsementIds, + }, + { + no: 2, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + { + no: 3, + name: 'block_ids', + kind: 'message', + oneof: 'filter', + T: () => BlockIds, + }, + ]); + } + create( + value?: PartialMessage, + ): SearchEndorsementsFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchEndorsementsFilter, + ): SearchEndorsementsFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.EndorsementIds endorsement_ids */ 1: + message.filter = { + oneofKind: 'endorsementIds', + endorsementIds: EndorsementIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).endorsementIds, + ), + }; + break; + case /* massa.model.v1.Addresses addresses */ 2: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + case /* massa.model.v1.BlockIds block_ids */ 3: + message.filter = { + oneofKind: 'blockIds', + blockIds: BlockIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).blockIds, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchEndorsementsFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.EndorsementIds endorsement_ids = 1; */ + if (message.filter.oneofKind === 'endorsementIds') + EndorsementIds.internalBinaryWrite( + message.filter.endorsementIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Addresses addresses = 2; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.BlockIds block_ids = 3; */ + if (message.filter.oneofKind === 'blockIds') + BlockIds.internalBinaryWrite( + message.filter.blockIds, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchEndorsementsFilter + */ +export const SearchEndorsementsFilter = new SearchEndorsementsFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchEndorsementsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchEndorsementsResponse', [ + { + no: 1, + name: 'endorsement_infos', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => EndorsementInfo, + }, + ]); + } + create( + value?: PartialMessage, + ): SearchEndorsementsResponse { + const message = { endorsementInfos: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchEndorsementsResponse, + ): SearchEndorsementsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.EndorsementInfo endorsement_infos */ 1: + message.endorsementInfos.push( + EndorsementInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchEndorsementsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.EndorsementInfo endorsement_infos = 1; */ + for (let i = 0; i < message.endorsementInfos.length; i++) + EndorsementInfo.internalBinaryWrite( + message.endorsementInfos[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchEndorsementsResponse + */ +export const SearchEndorsementsResponse = new SearchEndorsementsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchOperationsRequest$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchOperationsRequest', [ + { + no: 1, + name: 'filters', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => SearchOperationsFilter, + }, + ]); + } + create( + value?: PartialMessage, + ): SearchOperationsRequest { + const message = { filters: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchOperationsRequest, + ): SearchOperationsRequest { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.api.v1.SearchOperationsFilter filters */ 1: + message.filters.push( + SearchOperationsFilter.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchOperationsRequest, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.api.v1.SearchOperationsFilter filters = 1; */ + for (let i = 0; i < message.filters.length; i++) + SearchOperationsFilter.internalBinaryWrite( + message.filters[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchOperationsRequest + */ +export const SearchOperationsRequest = new SearchOperationsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchOperationsFilter$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchOperationsFilter', [ + { + no: 1, + name: 'operation_ids', + kind: 'message', + oneof: 'filter', + T: () => OperationIds, + }, + { + no: 2, + name: 'addresses', + kind: 'message', + oneof: 'filter', + T: () => Addresses, + }, + ]); + } + create( + value?: PartialMessage, + ): SearchOperationsFilter { + const message = { filter: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchOperationsFilter, + ): SearchOperationsFilter { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.OperationIds operation_ids */ 1: + message.filter = { + oneofKind: 'operationIds', + operationIds: OperationIds.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).operationIds, + ), + }; + break; + case /* massa.model.v1.Addresses addresses */ 2: + message.filter = { + oneofKind: 'addresses', + addresses: Addresses.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.filter as any).addresses, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchOperationsFilter, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.OperationIds operation_ids = 1; */ + if (message.filter.oneofKind === 'operationIds') + OperationIds.internalBinaryWrite( + message.filter.operationIds, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Addresses addresses = 2; */ + if (message.filter.oneofKind === 'addresses') + Addresses.internalBinaryWrite( + message.filter.addresses, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchOperationsFilter + */ +export const SearchOperationsFilter = new SearchOperationsFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SearchOperationsResponse$Type extends MessageType { + constructor() { + super('massa.api.v1.SearchOperationsResponse', [ + { + no: 1, + name: 'operation_infos', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => OperationInfo, + }, + ]); + } + create( + value?: PartialMessage, + ): SearchOperationsResponse { + const message = { operationInfos: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SearchOperationsResponse, + ): SearchOperationsResponse { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.OperationInfo operation_infos */ 1: + message.operationInfos.push( + OperationInfo.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SearchOperationsResponse, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.OperationInfo operation_infos = 1; */ + for (let i = 0; i < message.operationInfos.length; i++) + OperationInfo.internalBinaryWrite( + message.operationInfos[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.api.v1.SearchOperationsResponse + */ +export const SearchOperationsResponse = new SearchOperationsResponse$Type(); +/** + * @generated ServiceType for protobuf service massa.api.v1.PublicService + */ +export const PublicService = new ServiceType('massa.api.v1.PublicService', [ + { + name: 'ExecuteReadOnlyCall', + options: { + 'google.api.http': { post: '/v1/execute_read_only_call', body: '*' }, + }, + I: ExecuteReadOnlyCallRequest, + O: ExecuteReadOnlyCallResponse, + }, + { + name: 'GetBlocks', + options: { 'google.api.http': { post: '/v1/get_blocks', body: '*' } }, + I: GetBlocksRequest, + O: GetBlocksResponse, + }, + { + name: 'GetDatastoreEntries', + options: { + 'google.api.http': { post: '/v1/get_datastore_entries', body: '*' }, + }, + I: GetDatastoreEntriesRequest, + O: GetDatastoreEntriesResponse, + }, + { + name: 'GetEndorsements', + options: { 'google.api.http': { post: '/v1/get_endorsements', body: '*' } }, + I: GetEndorsementsRequest, + O: GetEndorsementsResponse, + }, + { + name: 'GetNextBlockBestParents', + options: { + 'google.api.http': { post: '/v1/get_next_block_best_parents', body: '*' }, + }, + I: GetNextBlockBestParentsRequest, + O: GetNextBlockBestParentsResponse, + }, + { + name: 'GetOperations', + options: { 'google.api.http': { post: '/v1/get_operations', body: '*' } }, + I: GetOperationsRequest, + O: GetOperationsResponse, + }, + { + name: 'GetScExecutionEvents', + options: { + 'google.api.http': { post: '/v1/get_sc_execution_events', body: '*' }, + }, + I: GetScExecutionEventsRequest, + O: GetScExecutionEventsResponse, + }, + { + name: 'GetSelectorDraws', + options: { + 'google.api.http': { post: '/v1/get_selector_draws', body: '*' }, + }, + I: GetSelectorDrawsRequest, + O: GetSelectorDrawsResponse, + }, + { + name: 'GetStakers', + options: { 'google.api.http': { post: '/v1/get_stakers', body: '*' } }, + I: GetStakersRequest, + O: GetStakersResponse, + }, + { + name: 'GetStatus', + options: { 'google.api.http': { post: '/v1/get_status', body: '*' } }, + I: GetStatusRequest, + O: GetStatusResponse, + }, + { + name: 'GetTransactionsThroughput', + options: { + 'google.api.http': { post: '/v1/transactions_throughput', body: '*' }, + }, + I: GetTransactionsThroughputRequest, + O: GetTransactionsThroughputResponse, + }, + { + name: 'QueryState', + options: { 'google.api.http': { post: '/v1/query_state', body: '*' } }, + I: QueryStateRequest, + O: QueryStateResponse, + }, + { + name: 'SearchBlocks', + options: { 'google.api.http': { post: '/v1/search_blocks', body: '*' } }, + I: SearchBlocksRequest, + O: SearchBlocksResponse, + }, + { + name: 'SearchEndorsements', + options: { + 'google.api.http': { post: '/v1/search_endorsements', body: '*' }, + }, + I: SearchEndorsementsRequest, + O: SearchEndorsementsResponse, + }, + { + name: 'SearchOperations', + options: { + 'google.api.http': { post: '/v1/search_operations', body: '*' }, + }, + I: SearchOperationsRequest, + O: SearchOperationsResponse, + }, + { + name: 'NewBlocks', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: NewBlocksRequest, + O: NewBlocksResponse, + }, + { + name: 'NewEndorsements', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: NewEndorsementsRequest, + O: NewEndorsementsResponse, + }, + { + name: 'NewFilledBlocks', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: NewFilledBlocksRequest, + O: NewFilledBlocksResponse, + }, + { + name: 'NewOperations', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: NewOperationsRequest, + O: NewOperationsResponse, + }, + { + name: 'NewSlotExecutionOutputs', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: NewSlotExecutionOutputsRequest, + O: NewSlotExecutionOutputsResponse, + }, + { + name: 'NewSlotExecutionOutputsServer', + serverStreaming: true, + options: {}, + I: NewSlotExecutionOutputsRequest, + O: NewSlotExecutionOutputsResponse, + }, + { + name: 'SendBlocks', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: SendBlocksRequest, + O: SendBlocksResponse, + }, + { + name: 'SendEndorsements', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: SendEndorsementsRequest, + O: SendEndorsementsResponse, + }, + { + name: 'SendOperations', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: SendOperationsRequest, + O: SendOperationsResponse, + }, + { + name: 'TransactionsThroughput', + serverStreaming: true, + clientStreaming: true, + options: {}, + I: TransactionsThroughputRequest, + O: TransactionsThroughputResponse, + }, +]); diff --git a/frontend/src/proto-gen/massa/model/v1/address.ts b/frontend/src/proto-gen/massa/model/v1/address.ts new file mode 100644 index 0000000..02e819c --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/address.ts @@ -0,0 +1,258 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/address.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * Massa NativeAddress + * + * @generated from protobuf message massa.model.v1.NativeAddress + */ +export interface NativeAddress { + /** + * Address category + * + * @generated from protobuf field: massa.model.v1.AddressCategory category = 1; + */ + category: AddressCategory; + /** + * Address version + * + * @generated from protobuf field: uint64 version = 2; + */ + version: bigint; + /** + * Address content + * + * @generated from protobuf field: bytes content = 3; + */ + content: Uint8Array; +} +/** + * Addresses holds addresses + * + * @generated from protobuf message massa.model.v1.Addresses + */ +export interface Addresses { + /** + * Addresses + * + * @generated from protobuf field: repeated string addresses = 1; + */ + addresses: string[]; +} +/** + * Address category discriminant + * + * @generated from protobuf enum massa.model.v1.AddressCategory + */ +export enum AddressCategory { + /** + * Unspecified address category + * + * @generated from protobuf enum value: ADDRESS_CATEGORY_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * User address + * + * @generated from protobuf enum value: ADDRESS_CATEGORY_USER_ADDRESS = 1; + */ + USER_ADDRESS = 1, + /** + * Smart contract address + * + * @generated from protobuf enum value: ADDRESS_CATEGORY_SC_ADDRESS = 2; + */ + SC_ADDRESS = 2, +} +// @generated message type with reflection information, may provide speed optimized methods +class NativeAddress$Type extends MessageType { + constructor() { + super('massa.model.v1.NativeAddress', [ + { + no: 1, + name: 'category', + kind: 'enum', + T: () => [ + 'massa.model.v1.AddressCategory', + AddressCategory, + 'ADDRESS_CATEGORY_', + ], + }, + { + no: 2, + name: 'version', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 3, name: 'content', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): NativeAddress { + const message = { category: 0, version: 0n, content: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NativeAddress, + ): NativeAddress { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.AddressCategory category */ 1: + message.category = reader.int32(); + break; + case /* uint64 version */ 2: + message.version = reader.uint64().toBigInt(); + break; + case /* bytes content */ 3: + message.content = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NativeAddress, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.AddressCategory category = 1; */ + if (message.category !== 0) + writer.tag(1, WireType.Varint).int32(message.category); + /* uint64 version = 2; */ + if (message.version !== 0n) + writer.tag(2, WireType.Varint).uint64(message.version); + /* bytes content = 3; */ + if (message.content.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.content); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.NativeAddress + */ +export const NativeAddress = new NativeAddress$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Addresses$Type extends MessageType { + constructor() { + super('massa.model.v1.Addresses', [ + { + no: 1, + name: 'addresses', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): Addresses { + const message = { addresses: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Addresses, + ): Addresses { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string addresses */ 1: + message.addresses.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Addresses, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string addresses = 1; */ + for (let i = 0; i < message.addresses.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.addresses[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Addresses + */ +export const Addresses = new Addresses$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/amount.ts b/frontend/src/proto-gen/massa/model/v1/amount.ts new file mode 100644 index 0000000..2d2ae9d --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/amount.ts @@ -0,0 +1,121 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/amount.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * NativeAmount is represented as a fraction so precision can be adjusted in + * the future. value = mantissa / (10^scale) + * + * @generated from protobuf message massa.model.v1.NativeAmount + */ +export interface NativeAmount { + /** + * Mantissa + * + * @generated from protobuf field: uint64 mantissa = 1; + */ + mantissa: bigint; + /** + * Scale + * + * @generated from protobuf field: uint32 scale = 2; + */ + scale: number; +} +// @generated message type with reflection information, may provide speed optimized methods +class NativeAmount$Type extends MessageType { + constructor() { + super('massa.model.v1.NativeAmount', [ + { + no: 1, + name: 'mantissa', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 2, name: 'scale', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + ]); + } + create(value?: PartialMessage): NativeAmount { + const message = { mantissa: 0n, scale: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NativeAmount, + ): NativeAmount { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 mantissa */ 1: + message.mantissa = reader.uint64().toBigInt(); + break; + case /* uint32 scale */ 2: + message.scale = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NativeAmount, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 mantissa = 1; */ + if (message.mantissa !== 0n) + writer.tag(1, WireType.Varint).uint64(message.mantissa); + /* uint32 scale = 2; */ + if (message.scale !== 0) + writer.tag(2, WireType.Varint).uint32(message.scale); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.NativeAmount + */ +export const NativeAmount = new NativeAmount$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/block.ts b/frontend/src/proto-gen/massa/model/v1/block.ts new file mode 100644 index 0000000..525ba17 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/block.ts @@ -0,0 +1,1405 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/block.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { SignedOperation } from './operation'; +import { SignedEndorsement } from './endorsement'; +import { Slot } from './slot'; +import { UInt32Value } from '../../../google/protobuf/wrappers'; +/** + * Block + * + * @generated from protobuf message massa.model.v1.Block + */ +export interface Block { + /** + * Signed header + * + * @generated from protobuf field: massa.model.v1.SignedBlockHeader header = 1; + */ + header?: SignedBlockHeader; + /** + * Operations ids + * + * @generated from protobuf field: repeated string operations = 2; + */ + operations: string[]; +} +/** + * Filled block + * + * @generated from protobuf message massa.model.v1.FilledBlock + */ +export interface FilledBlock { + /** + * Signed header + * + * @generated from protobuf field: massa.model.v1.SignedBlockHeader header = 1; + */ + header?: SignedBlockHeader; + /** + * Operations + * + * @generated from protobuf field: repeated massa.model.v1.FilledOperationEntry operations = 2; + */ + operations: FilledOperationEntry[]; +} +/** + * Block header + * + * @generated from protobuf message massa.model.v1.BlockHeader + */ +export interface BlockHeader { + /** + * Current network version + * + * @generated from protobuf field: uint32 current_version = 1; + */ + currentVersion: number; + /** + * Announced network version(Optional) + * + * @generated from protobuf field: google.protobuf.UInt32Value announced_version = 2; + */ + announcedVersion?: UInt32Value; + /** + * Slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 3; + */ + slot?: Slot; + /** + * parents + * + * @generated from protobuf field: repeated string parents = 4; + */ + parents: string[]; + /** + * All operations hash + * + * @generated from protobuf field: string operations_hash = 5; + */ + operationsHash: string; + /** + * Signed endorsements + * + * @generated from protobuf field: repeated massa.model.v1.SignedEndorsement endorsements = 6; + */ + endorsements: SignedEndorsement[]; +} +/** + * Filled Operation Tuple + * + * @generated from protobuf message massa.model.v1.FilledOperationEntry + */ +export interface FilledOperationEntry { + /** + * Operation id + * + * @generated from protobuf field: string operation_id = 1; + */ + operationId: string; + /** + * Signed operation + * + * @generated from protobuf field: massa.model.v1.SignedOperation operation = 2; + */ + operation?: SignedOperation; +} +/** + * Signed block + * + * @generated from protobuf message massa.model.v1.SignedBlock + */ +export interface SignedBlock { + /** + * Block + * + * @generated from protobuf field: massa.model.v1.Block content = 1; + */ + content?: Block; + /** + * A cryptographically generated value using `serialized_data` and a public key. + * + * @generated from protobuf field: string signature = 2; + */ + signature: string; + /** + * The public-key component used in the generation of the signature + * + * @generated from protobuf field: string content_creator_pub_key = 3; + */ + contentCreatorPubKey: string; + /** + * Derived from the same public key used to generate the signature + * + * @generated from protobuf field: string content_creator_address = 4; + */ + contentCreatorAddress: string; + /** + * A secure hash of the non-malleable contents of a deterministic binary representation of the block header + * + * @generated from protobuf field: string secure_hash = 5; + */ + secureHash: string; + /** + * The size of the serialized block in bytes + * + * @generated from protobuf field: uint64 serialized_size = 6; + */ + serializedSize: bigint; +} +/** + * Signed block header + * + * @generated from protobuf message massa.model.v1.SignedBlockHeader + */ +export interface SignedBlockHeader { + /** + * BlockHeader + * + * @generated from protobuf field: massa.model.v1.BlockHeader content = 1; + */ + content?: BlockHeader; + /** + * A cryptographically generated value using `serialized_data` and a public key. + * + * @generated from protobuf field: string signature = 2; + */ + signature: string; + /** + * The public-key component used in the generation of the signature + * + * @generated from protobuf field: string content_creator_pub_key = 3; + */ + contentCreatorPubKey: string; + /** + * Derived from the same public key used to generate the signature + * + * @generated from protobuf field: string content_creator_address = 4; + */ + contentCreatorAddress: string; + /** + * A secure hash of the non-malleable contents of a deterministic binary representation of the block header + * + * @generated from protobuf field: string secure_hash = 5; + */ + secureHash: string; + /** + * The size of the serialized block header in bytes + * + * @generated from protobuf field: uint64 serialized_size = 6; + */ + serializedSize: bigint; +} +/** + * A wrapper around a block with its metadata + * + * @generated from protobuf message massa.model.v1.BlockWrapper + */ +export interface BlockWrapper { + /** + * The execution status of the block + * + * @generated from protobuf field: massa.model.v1.BlockStatus status = 1; + */ + status: BlockStatus; + /** + * The block object itself + * + * @generated from protobuf field: massa.model.v1.Block block = 2; + */ + block?: Block; +} +/** + * Informations about a block with its metadata + * + * @generated from protobuf message massa.model.v1.BlockInfo + */ +export interface BlockInfo { + /** + * The unique ID of the block. + * + * @generated from protobuf field: string block_id = 1; + */ + blockId: string; + /** + * The execution status of the block + * + * @generated from protobuf field: massa.model.v1.BlockStatus status = 2; + */ + status: BlockStatus; +} +/** + * BlockIds holds block ids + * + * @generated from protobuf message massa.model.v1.BlockIds + */ +export interface BlockIds { + /** + * Block ids + * + * @generated from protobuf field: repeated string block_ids = 1; + */ + blockIds: string[]; +} +/** + * Block parent tuple + * + * @generated from protobuf message massa.model.v1.BlockParent + */ +export interface BlockParent { + /** + * Block id + * + * @generated from protobuf field: string block_id = 1; + */ + blockId: string; + /** + * Period + * + * @generated from protobuf field: uint64 period = 2; + */ + period: bigint; +} +/** + * Possible statuses for a block + * + * @generated from protobuf enum massa.model.v1.BlockStatus + */ +export enum BlockStatus { + /** + * Default enum value + * + * @generated from protobuf enum value: BLOCK_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * The block is in the greatest clique (and not final) + * + * @generated from protobuf enum value: BLOCK_STATUS_NON_FINAL_BLOCKCLIQUE = 1; + */ + NON_FINAL_BLOCKCLIQUE = 1, + /** + * The block is final + * + * @generated from protobuf enum value: BLOCK_STATUS_FINAL = 2; + */ + FINAL = 2, + /** + * The block is candidate (active any clique but not final) + * + * @generated from protobuf enum value: BLOCK_STATUS_NON_FINAL_ALTERNATE_CLIQUE = 3; + */ + NON_FINAL_ALTERNATE_CLIQUE = 3, + /** + * The block is discarded + * + * @generated from protobuf enum value: BLOCK_STATUS_DISCARDED = 4; + */ + DISCARDED = 4, +} +// @generated message type with reflection information, may provide speed optimized methods +class Block$Type extends MessageType { + constructor() { + super('massa.model.v1.Block', [ + { no: 1, name: 'header', kind: 'message', T: () => SignedBlockHeader }, + { + no: 2, + name: 'operations', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): Block { + const message = { operations: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Block, + ): Block { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SignedBlockHeader header */ 1: + message.header = SignedBlockHeader.internalBinaryRead( + reader, + reader.uint32(), + options, + message.header, + ); + break; + case /* repeated string operations */ 2: + message.operations.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Block, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SignedBlockHeader header = 1; */ + if (message.header) + SignedBlockHeader.internalBinaryWrite( + message.header, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated string operations = 2; */ + for (let i = 0; i < message.operations.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.operations[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Block + */ +export const Block = new Block$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FilledBlock$Type extends MessageType { + constructor() { + super('massa.model.v1.FilledBlock', [ + { no: 1, name: 'header', kind: 'message', T: () => SignedBlockHeader }, + { + no: 2, + name: 'operations', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => FilledOperationEntry, + }, + ]); + } + create(value?: PartialMessage): FilledBlock { + const message = { operations: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FilledBlock, + ): FilledBlock { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SignedBlockHeader header */ 1: + message.header = SignedBlockHeader.internalBinaryRead( + reader, + reader.uint32(), + options, + message.header, + ); + break; + case /* repeated massa.model.v1.FilledOperationEntry operations */ 2: + message.operations.push( + FilledOperationEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FilledBlock, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SignedBlockHeader header = 1; */ + if (message.header) + SignedBlockHeader.internalBinaryWrite( + message.header, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.FilledOperationEntry operations = 2; */ + for (let i = 0; i < message.operations.length; i++) + FilledOperationEntry.internalBinaryWrite( + message.operations[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.FilledBlock + */ +export const FilledBlock = new FilledBlock$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BlockHeader$Type extends MessageType { + constructor() { + super('massa.model.v1.BlockHeader', [ + { + no: 1, + name: 'current_version', + kind: 'scalar', + T: 13 /* ScalarType.UINT32*/, + }, + { + no: 2, + name: 'announced_version', + kind: 'message', + T: () => UInt32Value, + }, + { no: 3, name: 'slot', kind: 'message', T: () => Slot }, + { + no: 4, + name: 'parents', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'operations_hash', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'endorsements', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => SignedEndorsement, + }, + ]); + } + create(value?: PartialMessage): BlockHeader { + const message = { + currentVersion: 0, + parents: [], + operationsHash: '', + endorsements: [], + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BlockHeader, + ): BlockHeader { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 current_version */ 1: + message.currentVersion = reader.uint32(); + break; + case /* google.protobuf.UInt32Value announced_version */ 2: + message.announcedVersion = UInt32Value.internalBinaryRead( + reader, + reader.uint32(), + options, + message.announcedVersion, + ); + break; + case /* massa.model.v1.Slot slot */ 3: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + case /* repeated string parents */ 4: + message.parents.push(reader.string()); + break; + case /* string operations_hash */ 5: + message.operationsHash = reader.string(); + break; + case /* repeated massa.model.v1.SignedEndorsement endorsements */ 6: + message.endorsements.push( + SignedEndorsement.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BlockHeader, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint32 current_version = 1; */ + if (message.currentVersion !== 0) + writer.tag(1, WireType.Varint).uint32(message.currentVersion); + /* google.protobuf.UInt32Value announced_version = 2; */ + if (message.announcedVersion) + UInt32Value.internalBinaryWrite( + message.announcedVersion, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot slot = 3; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated string parents = 4; */ + for (let i = 0; i < message.parents.length; i++) + writer.tag(4, WireType.LengthDelimited).string(message.parents[i]); + /* string operations_hash = 5; */ + if (message.operationsHash !== '') + writer.tag(5, WireType.LengthDelimited).string(message.operationsHash); + /* repeated massa.model.v1.SignedEndorsement endorsements = 6; */ + for (let i = 0; i < message.endorsements.length; i++) + SignedEndorsement.internalBinaryWrite( + message.endorsements[i], + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.BlockHeader + */ +export const BlockHeader = new BlockHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FilledOperationEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.FilledOperationEntry', [ + { + no: 1, + name: 'operation_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 2, name: 'operation', kind: 'message', T: () => SignedOperation }, + ]); + } + create(value?: PartialMessage): FilledOperationEntry { + const message = { operationId: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FilledOperationEntry, + ): FilledOperationEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operation_id */ 1: + message.operationId = reader.string(); + break; + case /* massa.model.v1.SignedOperation operation */ 2: + message.operation = SignedOperation.internalBinaryRead( + reader, + reader.uint32(), + options, + message.operation, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FilledOperationEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string operation_id = 1; */ + if (message.operationId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.operationId); + /* massa.model.v1.SignedOperation operation = 2; */ + if (message.operation) + SignedOperation.internalBinaryWrite( + message.operation, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.FilledOperationEntry + */ +export const FilledOperationEntry = new FilledOperationEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignedBlock$Type extends MessageType { + constructor() { + super('massa.model.v1.SignedBlock', [ + { no: 1, name: 'content', kind: 'message', T: () => Block }, + { no: 2, name: 'signature', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 3, + name: 'content_creator_pub_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'content_creator_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'secure_hash', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'serialized_size', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): SignedBlock { + const message = { + signature: '', + contentCreatorPubKey: '', + contentCreatorAddress: '', + secureHash: '', + serializedSize: 0n, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SignedBlock, + ): SignedBlock { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Block content */ 1: + message.content = Block.internalBinaryRead( + reader, + reader.uint32(), + options, + message.content, + ); + break; + case /* string signature */ 2: + message.signature = reader.string(); + break; + case /* string content_creator_pub_key */ 3: + message.contentCreatorPubKey = reader.string(); + break; + case /* string content_creator_address */ 4: + message.contentCreatorAddress = reader.string(); + break; + case /* string secure_hash */ 5: + message.secureHash = reader.string(); + break; + case /* uint64 serialized_size */ 6: + message.serializedSize = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SignedBlock, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Block content = 1; */ + if (message.content) + Block.internalBinaryWrite( + message.content, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string signature = 2; */ + if (message.signature !== '') + writer.tag(2, WireType.LengthDelimited).string(message.signature); + /* string content_creator_pub_key = 3; */ + if (message.contentCreatorPubKey !== '') + writer + .tag(3, WireType.LengthDelimited) + .string(message.contentCreatorPubKey); + /* string content_creator_address = 4; */ + if (message.contentCreatorAddress !== '') + writer + .tag(4, WireType.LengthDelimited) + .string(message.contentCreatorAddress); + /* string secure_hash = 5; */ + if (message.secureHash !== '') + writer.tag(5, WireType.LengthDelimited).string(message.secureHash); + /* uint64 serialized_size = 6; */ + if (message.serializedSize !== 0n) + writer.tag(6, WireType.Varint).uint64(message.serializedSize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SignedBlock + */ +export const SignedBlock = new SignedBlock$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignedBlockHeader$Type extends MessageType { + constructor() { + super('massa.model.v1.SignedBlockHeader', [ + { no: 1, name: 'content', kind: 'message', T: () => BlockHeader }, + { no: 2, name: 'signature', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 3, + name: 'content_creator_pub_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'content_creator_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'secure_hash', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'serialized_size', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): SignedBlockHeader { + const message = { + signature: '', + contentCreatorPubKey: '', + contentCreatorAddress: '', + secureHash: '', + serializedSize: 0n, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SignedBlockHeader, + ): SignedBlockHeader { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.BlockHeader content */ 1: + message.content = BlockHeader.internalBinaryRead( + reader, + reader.uint32(), + options, + message.content, + ); + break; + case /* string signature */ 2: + message.signature = reader.string(); + break; + case /* string content_creator_pub_key */ 3: + message.contentCreatorPubKey = reader.string(); + break; + case /* string content_creator_address */ 4: + message.contentCreatorAddress = reader.string(); + break; + case /* string secure_hash */ 5: + message.secureHash = reader.string(); + break; + case /* uint64 serialized_size */ 6: + message.serializedSize = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SignedBlockHeader, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.BlockHeader content = 1; */ + if (message.content) + BlockHeader.internalBinaryWrite( + message.content, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string signature = 2; */ + if (message.signature !== '') + writer.tag(2, WireType.LengthDelimited).string(message.signature); + /* string content_creator_pub_key = 3; */ + if (message.contentCreatorPubKey !== '') + writer + .tag(3, WireType.LengthDelimited) + .string(message.contentCreatorPubKey); + /* string content_creator_address = 4; */ + if (message.contentCreatorAddress !== '') + writer + .tag(4, WireType.LengthDelimited) + .string(message.contentCreatorAddress); + /* string secure_hash = 5; */ + if (message.secureHash !== '') + writer.tag(5, WireType.LengthDelimited).string(message.secureHash); + /* uint64 serialized_size = 6; */ + if (message.serializedSize !== 0n) + writer.tag(6, WireType.Varint).uint64(message.serializedSize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SignedBlockHeader + */ +export const SignedBlockHeader = new SignedBlockHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BlockWrapper$Type extends MessageType { + constructor() { + super('massa.model.v1.BlockWrapper', [ + { + no: 1, + name: 'status', + kind: 'enum', + T: () => ['massa.model.v1.BlockStatus', BlockStatus, 'BLOCK_STATUS_'], + }, + { no: 2, name: 'block', kind: 'message', T: () => Block }, + ]); + } + create(value?: PartialMessage): BlockWrapper { + const message = { status: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BlockWrapper, + ): BlockWrapper { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.BlockStatus status */ 1: + message.status = reader.int32(); + break; + case /* massa.model.v1.Block block */ 2: + message.block = Block.internalBinaryRead( + reader, + reader.uint32(), + options, + message.block, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BlockWrapper, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.BlockStatus status = 1; */ + if (message.status !== 0) + writer.tag(1, WireType.Varint).int32(message.status); + /* massa.model.v1.Block block = 2; */ + if (message.block) + Block.internalBinaryWrite( + message.block, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.BlockWrapper + */ +export const BlockWrapper = new BlockWrapper$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BlockInfo$Type extends MessageType { + constructor() { + super('massa.model.v1.BlockInfo', [ + { no: 1, name: 'block_id', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'status', + kind: 'enum', + T: () => ['massa.model.v1.BlockStatus', BlockStatus, 'BLOCK_STATUS_'], + }, + ]); + } + create(value?: PartialMessage): BlockInfo { + const message = { blockId: '', status: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BlockInfo, + ): BlockInfo { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string block_id */ 1: + message.blockId = reader.string(); + break; + case /* massa.model.v1.BlockStatus status */ 2: + message.status = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BlockInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string block_id = 1; */ + if (message.blockId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.blockId); + /* massa.model.v1.BlockStatus status = 2; */ + if (message.status !== 0) + writer.tag(2, WireType.Varint).int32(message.status); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.BlockInfo + */ +export const BlockInfo = new BlockInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BlockIds$Type extends MessageType { + constructor() { + super('massa.model.v1.BlockIds', [ + { + no: 1, + name: 'block_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): BlockIds { + const message = { blockIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BlockIds, + ): BlockIds { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string block_ids */ 1: + message.blockIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BlockIds, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string block_ids = 1; */ + for (let i = 0; i < message.blockIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.blockIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.BlockIds + */ +export const BlockIds = new BlockIds$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BlockParent$Type extends MessageType { + constructor() { + super('massa.model.v1.BlockParent', [ + { no: 1, name: 'block_id', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'period', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): BlockParent { + const message = { blockId: '', period: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BlockParent, + ): BlockParent { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string block_id */ 1: + message.blockId = reader.string(); + break; + case /* uint64 period */ 2: + message.period = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BlockParent, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string block_id = 1; */ + if (message.blockId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.blockId); + /* uint64 period = 2; */ + if (message.period !== 0n) + writer.tag(2, WireType.Varint).uint64(message.period); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.BlockParent + */ +export const BlockParent = new BlockParent$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/commons.ts b/frontend/src/proto-gen/massa/model/v1/commons.ts new file mode 100644 index 0000000..ef826c2 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/commons.ts @@ -0,0 +1,489 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/commons.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +// @ts-nocheck + +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * Massa error + * + * @generated from protobuf message massa.model.v1.Error + */ +export interface Error { + /** + * The error code + * + * @generated from protobuf field: int32 code = 1; + */ + code: number; + /** + * A developer-facing error message, which should be in English + * + * @generated from protobuf field: string message = 2; + */ + message: string; +} +/** + * Empty + * + * @generated from protobuf message massa.model.v1.Empty + */ +export interface Empty {} +/** + * BytesMapFieldEntry + * + * @generated from protobuf message massa.model.v1.BytesMapFieldEntry + */ +export interface BytesMapFieldEntry { + /** + * bytes key + * + * @generated from protobuf field: bytes key = 1; + */ + key: Uint8Array; + /** + * bytes key + * + * @generated from protobuf field: bytes value = 2; + */ + value: Uint8Array; +} +/** + * Array of bytes wrapper + * + * @generated from protobuf message massa.model.v1.ArrayOfBytesWrapper + */ +export interface ArrayOfBytesWrapper { + /** + * Repeated bytes + * + * @generated from protobuf field: repeated bytes items = 1; + */ + items: Uint8Array[]; +} +/** + * KeyPair + * + * @generated from protobuf message massa.model.v1.KeyPair + */ +export interface KeyPair { + /** + * Public key + * + * @generated from protobuf field: string public_key = 1; + */ + publicKey: string; + /** + * Secret key + * + * @generated from protobuf field: string secret_key = 2; + */ + secretKey: string; +} +/** + * Comparison result + * + * @generated from protobuf enum massa.model.v1.ComparisonResult + */ +export enum ComparisonResult { + /** + * @generated from protobuf enum value: COMPARISON_RESULT_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * left is lower + * + * @generated from protobuf enum value: COMPARISON_RESULT_LOWER = 1; + */ + LOWER = 1, + /** + * left and right are equal + * + * @generated from protobuf enum value: COMPARISON_RESULT_EQUAL = 2; + */ + EQUAL = 2, + /** + * left is greater + * + * @generated from protobuf enum value: COMPARISON_RESULT_GREATER = 3; + */ + GREATER = 3, +} +// @generated message type with reflection information, may provide speed optimized methods +class Error$Type extends MessageType { + constructor() { + super('massa.model.v1.Error', [ + { no: 1, name: 'code', kind: 'scalar', T: 5 /* ScalarType.INT32*/ }, + { no: 2, name: 'message', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): Error { + const message = { code: 0, message: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Error, + ): Error { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 code */ 1: + message.code = reader.int32(); + break; + case /* string message */ 2: + message.message = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Error, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* int32 code = 1; */ + if (message.code !== 0) writer.tag(1, WireType.Varint).int32(message.code); + /* string message = 2; */ + if (message.message !== '') + writer.tag(2, WireType.LengthDelimited).string(message.message); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Error + */ +export const Error = new Error$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Empty$Type extends MessageType { + constructor() { + super('massa.model.v1.Empty', []); + } + create(value?: PartialMessage): Empty { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Empty, + ): Empty { + return target ?? this.create(); + } + internalBinaryWrite( + message: Empty, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Empty + */ +export const Empty = new Empty$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BytesMapFieldEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.BytesMapFieldEntry', [ + { no: 1, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { no: 2, name: 'value', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): BytesMapFieldEntry { + const message = { key: new Uint8Array(0), value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BytesMapFieldEntry, + ): BytesMapFieldEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes key */ 1: + message.key = reader.bytes(); + break; + case /* bytes value */ 2: + message.value = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BytesMapFieldEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes key = 1; */ + if (message.key.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.key); + /* bytes value = 2; */ + if (message.value.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.BytesMapFieldEntry + */ +export const BytesMapFieldEntry = new BytesMapFieldEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ArrayOfBytesWrapper$Type extends MessageType { + constructor() { + super('massa.model.v1.ArrayOfBytesWrapper', [ + { + no: 1, + name: 'items', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): ArrayOfBytesWrapper { + const message = { items: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ArrayOfBytesWrapper, + ): ArrayOfBytesWrapper { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated bytes items */ 1: + message.items.push(reader.bytes()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ArrayOfBytesWrapper, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated bytes items = 1; */ + for (let i = 0; i < message.items.length; i++) + writer.tag(1, WireType.LengthDelimited).bytes(message.items[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ArrayOfBytesWrapper + */ +export const ArrayOfBytesWrapper = new ArrayOfBytesWrapper$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class KeyPair$Type extends MessageType { + constructor() { + super('massa.model.v1.KeyPair', [ + { + no: 1, + name: 'public_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'secret_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): KeyPair { + const message = { publicKey: '', secretKey: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: KeyPair, + ): KeyPair { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string public_key */ 1: + message.publicKey = reader.string(); + break; + case /* string secret_key */ 2: + message.secretKey = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: KeyPair, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string public_key = 1; */ + if (message.publicKey !== '') + writer.tag(1, WireType.LengthDelimited).string(message.publicKey); + /* string secret_key = 2; */ + if (message.secretKey !== '') + writer.tag(2, WireType.LengthDelimited).string(message.secretKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.KeyPair + */ +export const KeyPair = new KeyPair$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/datastore.ts b/frontend/src/proto-gen/massa/model/v1/datastore.ts new file mode 100644 index 0000000..ca33695 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/datastore.ts @@ -0,0 +1,326 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/datastore.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * AddressKeys holds a list of addresses - keys + * + * @generated from protobuf message massa.model.v1.AddressKeysEntries + */ +export interface AddressKeysEntries { + /** + * List of address- key entries + * + * @generated from protobuf field: repeated massa.model.v1.AddressKeyEntry address_key_entries = 1; + */ + addressKeyEntries: AddressKeyEntry[]; +} +/** + * AddressKeyEntry + * + * @generated from protobuf message massa.model.v1.AddressKeyEntry + */ +export interface AddressKeyEntry { + /** + * Associated address of the entry + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Datastore key + * + * @generated from protobuf field: bytes key = 2; + */ + key: Uint8Array; +} +/** + * DatastoreEntry + * + * @generated from protobuf message massa.model.v1.DatastoreEntry + */ +export interface DatastoreEntry { + /** + * final datastore entry value + * + * @generated from protobuf field: bytes final_value = 1; + */ + finalValue: Uint8Array; + /** + * candidate_value datastore entry value + * + * @generated from protobuf field: bytes candidate_value = 2; + */ + candidateValue: Uint8Array; +} +// @generated message type with reflection information, may provide speed optimized methods +class AddressKeysEntries$Type extends MessageType { + constructor() { + super('massa.model.v1.AddressKeysEntries', [ + { + no: 1, + name: 'address_key_entries', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => AddressKeyEntry, + }, + ]); + } + create(value?: PartialMessage): AddressKeysEntries { + const message = { addressKeyEntries: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressKeysEntries, + ): AddressKeysEntries { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.AddressKeyEntry address_key_entries */ 1: + message.addressKeyEntries.push( + AddressKeyEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressKeysEntries, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.AddressKeyEntry address_key_entries = 1; */ + for (let i = 0; i < message.addressKeyEntries.length; i++) + AddressKeyEntry.internalBinaryWrite( + message.addressKeyEntries[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.AddressKeysEntries + */ +export const AddressKeysEntries = new AddressKeysEntries$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddressKeyEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.AddressKeyEntry', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'key', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): AddressKeyEntry { + const message = { address: '', key: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AddressKeyEntry, + ): AddressKeyEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* bytes key */ 2: + message.key = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AddressKeyEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* bytes key = 2; */ + if (message.key.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.key); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.AddressKeyEntry + */ +export const AddressKeyEntry = new AddressKeyEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DatastoreEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.DatastoreEntry', [ + { + no: 1, + name: 'final_value', + kind: 'scalar', + T: 12 /* ScalarType.BYTES*/, + }, + { + no: 2, + name: 'candidate_value', + kind: 'scalar', + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): DatastoreEntry { + const message = { + finalValue: new Uint8Array(0), + candidateValue: new Uint8Array(0), + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DatastoreEntry, + ): DatastoreEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes final_value */ 1: + message.finalValue = reader.bytes(); + break; + case /* bytes candidate_value */ 2: + message.candidateValue = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DatastoreEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes final_value = 1; */ + if (message.finalValue.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.finalValue); + /* bytes candidate_value = 2; */ + if (message.candidateValue.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.candidateValue); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.DatastoreEntry + */ +export const DatastoreEntry = new DatastoreEntry$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/denunciation.ts b/frontend/src/proto-gen/massa/model/v1/denunciation.ts new file mode 100644 index 0000000..21ebac6 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/denunciation.ts @@ -0,0 +1,369 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/denunciation.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { Slot } from './slot'; +/** + * Index for Denunciations in collections (e.g. like a HashMap...) + * + * @generated from protobuf message massa.model.v1.DenunciationIndex + */ +export interface DenunciationIndex { + /** + * @generated from protobuf oneof: entry + */ + entry: + | { + oneofKind: 'blockHeader'; + /** + * Denunciation block header + * + * @generated from protobuf field: massa.model.v1.DenunciationBlockHeader block_header = 1; + */ + blockHeader: DenunciationBlockHeader; + } + | { + oneofKind: 'endorsement'; + /** + * Denunciation endorsement + * + * @generated from protobuf field: massa.model.v1.DenunciationEndorsement endorsement = 2; + */ + endorsement: DenunciationEndorsement; + } + | { + oneofKind: undefined; + }; +} +/** + * Variant for Block header denunciation index + * + * @generated from protobuf message massa.model.v1.DenunciationBlockHeader + */ +export interface DenunciationBlockHeader { + /** + * Denounciation slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; +} +/** + * Variant for Endorsement denunciation index + * + * @generated from protobuf message massa.model.v1.DenunciationEndorsement + */ +export interface DenunciationEndorsement { + /** + * Denounciation slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; + /** + * Denounciation index + * + * @generated from protobuf field: uint32 index = 2; + */ + index: number; +} +// @generated message type with reflection information, may provide speed optimized methods +class DenunciationIndex$Type extends MessageType { + constructor() { + super('massa.model.v1.DenunciationIndex', [ + { + no: 1, + name: 'block_header', + kind: 'message', + oneof: 'entry', + T: () => DenunciationBlockHeader, + }, + { + no: 2, + name: 'endorsement', + kind: 'message', + oneof: 'entry', + T: () => DenunciationEndorsement, + }, + ]); + } + create(value?: PartialMessage): DenunciationIndex { + const message = { entry: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DenunciationIndex, + ): DenunciationIndex { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.DenunciationBlockHeader block_header */ 1: + message.entry = { + oneofKind: 'blockHeader', + blockHeader: DenunciationBlockHeader.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.entry as any).blockHeader, + ), + }; + break; + case /* massa.model.v1.DenunciationEndorsement endorsement */ 2: + message.entry = { + oneofKind: 'endorsement', + endorsement: DenunciationEndorsement.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.entry as any).endorsement, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DenunciationIndex, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.DenunciationBlockHeader block_header = 1; */ + if (message.entry.oneofKind === 'blockHeader') + DenunciationBlockHeader.internalBinaryWrite( + message.entry.blockHeader, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.DenunciationEndorsement endorsement = 2; */ + if (message.entry.oneofKind === 'endorsement') + DenunciationEndorsement.internalBinaryWrite( + message.entry.endorsement, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.DenunciationIndex + */ +export const DenunciationIndex = new DenunciationIndex$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DenunciationBlockHeader$Type extends MessageType { + constructor() { + super('massa.model.v1.DenunciationBlockHeader', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + ]); + } + create( + value?: PartialMessage, + ): DenunciationBlockHeader { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DenunciationBlockHeader, + ): DenunciationBlockHeader { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DenunciationBlockHeader, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.DenunciationBlockHeader + */ +export const DenunciationBlockHeader = new DenunciationBlockHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DenunciationEndorsement$Type extends MessageType { + constructor() { + super('massa.model.v1.DenunciationEndorsement', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + { no: 2, name: 'index', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + ]); + } + create( + value?: PartialMessage, + ): DenunciationEndorsement { + const message = { index: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: DenunciationEndorsement, + ): DenunciationEndorsement { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + case /* uint32 index */ 2: + message.index = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: DenunciationEndorsement, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint32 index = 2; */ + if (message.index !== 0) + writer.tag(2, WireType.Varint).uint32(message.index); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.DenunciationEndorsement + */ +export const DenunciationEndorsement = new DenunciationEndorsement$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/draw.ts b/frontend/src/proto-gen/massa/model/v1/draw.ts new file mode 100644 index 0000000..4b2ec48 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/draw.ts @@ -0,0 +1,267 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/draw.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { StringValue } from '../../../google/protobuf/wrappers'; +import { Slot } from './slot'; +/** + * Slot draw + * + * @generated from protobuf message massa.model.v1.SlotDraw + */ +export interface SlotDraw { + /** + * Slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; + /** + * Block producer address (Optional) + * + * @generated from protobuf field: google.protobuf.StringValue block_producer = 2; + */ + blockProducer?: StringValue; + /** + * Endorsement draws + * + * @generated from protobuf field: repeated massa.model.v1.EndorsementDraw endorsement_draws = 3; + */ + endorsementDraws: EndorsementDraw[]; +} +/** + * Endorsement draw + * + * @generated from protobuf message massa.model.v1.EndorsementDraw + */ +export interface EndorsementDraw { + /** + * Endorsement index + * + * @generated from protobuf field: uint64 index = 1; + */ + index: bigint; + /** + * Producer address + * + * @generated from protobuf field: string producer = 2; + */ + producer: string; +} +// @generated message type with reflection information, may provide speed optimized methods +class SlotDraw$Type extends MessageType { + constructor() { + super('massa.model.v1.SlotDraw', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + { no: 2, name: 'block_producer', kind: 'message', T: () => StringValue }, + { + no: 3, + name: 'endorsement_draws', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => EndorsementDraw, + }, + ]); + } + create(value?: PartialMessage): SlotDraw { + const message = { endorsementDraws: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SlotDraw, + ): SlotDraw { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + case /* google.protobuf.StringValue block_producer */ 2: + message.blockProducer = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.blockProducer, + ); + break; + case /* repeated massa.model.v1.EndorsementDraw endorsement_draws */ 3: + message.endorsementDraws.push( + EndorsementDraw.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SlotDraw, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* google.protobuf.StringValue block_producer = 2; */ + if (message.blockProducer) + StringValue.internalBinaryWrite( + message.blockProducer, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.EndorsementDraw endorsement_draws = 3; */ + for (let i = 0; i < message.endorsementDraws.length; i++) + EndorsementDraw.internalBinaryWrite( + message.endorsementDraws[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SlotDraw + */ +export const SlotDraw = new SlotDraw$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EndorsementDraw$Type extends MessageType { + constructor() { + super('massa.model.v1.EndorsementDraw', [ + { + no: 1, + name: 'index', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 2, name: 'producer', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + ]); + } + create(value?: PartialMessage): EndorsementDraw { + const message = { index: 0n, producer: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EndorsementDraw, + ): EndorsementDraw { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 index */ 1: + message.index = reader.uint64().toBigInt(); + break; + case /* string producer */ 2: + message.producer = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EndorsementDraw, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 index = 1; */ + if (message.index !== 0n) + writer.tag(1, WireType.Varint).uint64(message.index); + /* string producer = 2; */ + if (message.producer !== '') + writer.tag(2, WireType.LengthDelimited).string(message.producer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.EndorsementDraw + */ +export const EndorsementDraw = new EndorsementDraw$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/endorsement.ts b/frontend/src/proto-gen/massa/model/v1/endorsement.ts new file mode 100644 index 0000000..1980a74 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/endorsement.ts @@ -0,0 +1,710 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/endorsement.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { Slot } from './slot'; +/** + * An endorsement, as sent in the network + * + * @generated from protobuf message massa.model.v1.Endorsement + */ +export interface Endorsement { + /** + * Slot in which the endorsement can be included + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; + /** + * Endorsement index inside the including block + * + * @generated from protobuf field: uint32 index = 2; + */ + index: number; + /** + * Hash of endorsed block + * This is the parent in thread `self.slot.thread` of the block in which the endorsement is included + * + * @generated from protobuf field: string endorsed_block = 3; + */ + endorsedBlock: string; +} +/** + * Signed endorsement + * + * @generated from protobuf message massa.model.v1.SignedEndorsement + */ +export interface SignedEndorsement { + /** + * Endorsement + * + * @generated from protobuf field: massa.model.v1.Endorsement content = 1; + */ + content?: Endorsement; + /** + * A cryptographically generated value using `serialized_data` and a public key. + * + * @generated from protobuf field: string signature = 2; + */ + signature: string; + /** + * The public-key component used in the generation of the signature + * + * @generated from protobuf field: string content_creator_pub_key = 3; + */ + contentCreatorPubKey: string; + /** + * Derived from the same public key used to generate the signature + * + * @generated from protobuf field: string content_creator_address = 4; + */ + contentCreatorAddress: string; + /** + * A secure hash of the non-malleable contents of a deterministic binary representation of the block header + * + * @generated from protobuf field: string secure_hash = 5; + */ + secureHash: string; + /** + * The size of the serialized endorsement in bytes + * + * @generated from protobuf field: uint64 serialized_size = 6; + */ + serializedSize: bigint; +} +/** + * EndorsementIds holds endorsements ids + * + * @generated from protobuf message massa.model.v1.EndorsementIds + */ +export interface EndorsementIds { + /** + * Endorsements ids + * + * @generated from protobuf field: repeated string endorsement_ids = 1; + */ + endorsementIds: string[]; +} +/** + * A wrapper around an endorsement with its metadata + * + * @generated from protobuf message massa.model.v1.EndorsementWrapper + */ +export interface EndorsementWrapper { + /** + * Whether the endorsement is still in pool + * + * @generated from protobuf field: bool in_pool = 1; + */ + inPool: boolean; + /** + * The endorsement appears in `in_blocks` + * If it appears in multiple blocks, these blocks are in different cliques + * + * @generated from protobuf field: repeated string in_blocks = 2; + */ + inBlocks: string[]; + /** + * Whether the the endorsement is final (for example in a final block) + * + * @generated from protobuf field: bool is_final = 3; + */ + isFinal: boolean; + /** + * The endorsement itself + * + * @generated from protobuf field: massa.model.v1.SignedEndorsement endorsement = 4; + */ + endorsement?: SignedEndorsement; +} +/** + * Informations about an endorsement with its metadata + * + * @generated from protobuf message massa.model.v1.EndorsementInfo + */ +export interface EndorsementInfo { + /** + * The endorsement id + * + * @generated from protobuf field: string endorsement_id = 1; + */ + endorsementId: string; + /** + * Whether the endorsement is still in pool + * + * @generated from protobuf field: bool in_pool = 2; + */ + inPool: boolean; + /** + * The endorsement appears in `in_blocks` + * If it appears in multiple blocks, these blocks are in different cliques + * + * @generated from protobuf field: repeated string in_blocks = 3; + */ + inBlocks: string[]; + /** + * Whether the the endorsement is final (for example in a final block) + * + * @generated from protobuf field: bool is_final = 4; + */ + isFinal: boolean; +} +// @generated message type with reflection information, may provide speed optimized methods +class Endorsement$Type extends MessageType { + constructor() { + super('massa.model.v1.Endorsement', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + { no: 2, name: 'index', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + { + no: 3, + name: 'endorsed_block', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): Endorsement { + const message = { index: 0, endorsedBlock: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Endorsement, + ): Endorsement { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + case /* uint32 index */ 2: + message.index = reader.uint32(); + break; + case /* string endorsed_block */ 3: + message.endorsedBlock = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Endorsement, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint32 index = 2; */ + if (message.index !== 0) + writer.tag(2, WireType.Varint).uint32(message.index); + /* string endorsed_block = 3; */ + if (message.endorsedBlock !== '') + writer.tag(3, WireType.LengthDelimited).string(message.endorsedBlock); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Endorsement + */ +export const Endorsement = new Endorsement$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignedEndorsement$Type extends MessageType { + constructor() { + super('massa.model.v1.SignedEndorsement', [ + { no: 1, name: 'content', kind: 'message', T: () => Endorsement }, + { no: 2, name: 'signature', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 3, + name: 'content_creator_pub_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'content_creator_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'secure_hash', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'serialized_size', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): SignedEndorsement { + const message = { + signature: '', + contentCreatorPubKey: '', + contentCreatorAddress: '', + secureHash: '', + serializedSize: 0n, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SignedEndorsement, + ): SignedEndorsement { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Endorsement content */ 1: + message.content = Endorsement.internalBinaryRead( + reader, + reader.uint32(), + options, + message.content, + ); + break; + case /* string signature */ 2: + message.signature = reader.string(); + break; + case /* string content_creator_pub_key */ 3: + message.contentCreatorPubKey = reader.string(); + break; + case /* string content_creator_address */ 4: + message.contentCreatorAddress = reader.string(); + break; + case /* string secure_hash */ 5: + message.secureHash = reader.string(); + break; + case /* uint64 serialized_size */ 6: + message.serializedSize = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SignedEndorsement, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Endorsement content = 1; */ + if (message.content) + Endorsement.internalBinaryWrite( + message.content, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string signature = 2; */ + if (message.signature !== '') + writer.tag(2, WireType.LengthDelimited).string(message.signature); + /* string content_creator_pub_key = 3; */ + if (message.contentCreatorPubKey !== '') + writer + .tag(3, WireType.LengthDelimited) + .string(message.contentCreatorPubKey); + /* string content_creator_address = 4; */ + if (message.contentCreatorAddress !== '') + writer + .tag(4, WireType.LengthDelimited) + .string(message.contentCreatorAddress); + /* string secure_hash = 5; */ + if (message.secureHash !== '') + writer.tag(5, WireType.LengthDelimited).string(message.secureHash); + /* uint64 serialized_size = 6; */ + if (message.serializedSize !== 0n) + writer.tag(6, WireType.Varint).uint64(message.serializedSize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SignedEndorsement + */ +export const SignedEndorsement = new SignedEndorsement$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EndorsementIds$Type extends MessageType { + constructor() { + super('massa.model.v1.EndorsementIds', [ + { + no: 1, + name: 'endorsement_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): EndorsementIds { + const message = { endorsementIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EndorsementIds, + ): EndorsementIds { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string endorsement_ids */ 1: + message.endorsementIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EndorsementIds, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string endorsement_ids = 1; */ + for (let i = 0; i < message.endorsementIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.endorsementIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.EndorsementIds + */ +export const EndorsementIds = new EndorsementIds$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EndorsementWrapper$Type extends MessageType { + constructor() { + super('massa.model.v1.EndorsementWrapper', [ + { no: 1, name: 'in_pool', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + { + no: 2, + name: 'in_blocks', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { no: 3, name: 'is_final', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + { + no: 4, + name: 'endorsement', + kind: 'message', + T: () => SignedEndorsement, + }, + ]); + } + create(value?: PartialMessage): EndorsementWrapper { + const message = { inPool: false, inBlocks: [], isFinal: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EndorsementWrapper, + ): EndorsementWrapper { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool in_pool */ 1: + message.inPool = reader.bool(); + break; + case /* repeated string in_blocks */ 2: + message.inBlocks.push(reader.string()); + break; + case /* bool is_final */ 3: + message.isFinal = reader.bool(); + break; + case /* massa.model.v1.SignedEndorsement endorsement */ 4: + message.endorsement = SignedEndorsement.internalBinaryRead( + reader, + reader.uint32(), + options, + message.endorsement, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EndorsementWrapper, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bool in_pool = 1; */ + if (message.inPool !== false) + writer.tag(1, WireType.Varint).bool(message.inPool); + /* repeated string in_blocks = 2; */ + for (let i = 0; i < message.inBlocks.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.inBlocks[i]); + /* bool is_final = 3; */ + if (message.isFinal !== false) + writer.tag(3, WireType.Varint).bool(message.isFinal); + /* massa.model.v1.SignedEndorsement endorsement = 4; */ + if (message.endorsement) + SignedEndorsement.internalBinaryWrite( + message.endorsement, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.EndorsementWrapper + */ +export const EndorsementWrapper = new EndorsementWrapper$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EndorsementInfo$Type extends MessageType { + constructor() { + super('massa.model.v1.EndorsementInfo', [ + { + no: 1, + name: 'endorsement_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 2, name: 'in_pool', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + { + no: 3, + name: 'in_blocks', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { no: 4, name: 'is_final', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): EndorsementInfo { + const message = { + endorsementId: '', + inPool: false, + inBlocks: [], + isFinal: false, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: EndorsementInfo, + ): EndorsementInfo { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string endorsement_id */ 1: + message.endorsementId = reader.string(); + break; + case /* bool in_pool */ 2: + message.inPool = reader.bool(); + break; + case /* repeated string in_blocks */ 3: + message.inBlocks.push(reader.string()); + break; + case /* bool is_final */ 4: + message.isFinal = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: EndorsementInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string endorsement_id = 1; */ + if (message.endorsementId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.endorsementId); + /* bool in_pool = 2; */ + if (message.inPool !== false) + writer.tag(2, WireType.Varint).bool(message.inPool); + /* repeated string in_blocks = 3; */ + for (let i = 0; i < message.inBlocks.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.inBlocks[i]); + /* bool is_final = 4; */ + if (message.isFinal !== false) + writer.tag(4, WireType.Varint).bool(message.isFinal); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.EndorsementInfo + */ +export const EndorsementInfo = new EndorsementInfo$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/execution.ts b/frontend/src/proto-gen/massa/model/v1/execution.ts new file mode 100644 index 0000000..bd24909 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/execution.ts @@ -0,0 +1,5020 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/execution.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { BytesMapFieldEntry } from './commons'; +import { BoolValue } from '../../../google/protobuf/wrappers'; +import { BytesValue } from '../../../google/protobuf/wrappers'; +import { UInt64Value } from '../../../google/protobuf/wrappers'; +import { Empty } from './commons'; +import { NativeAmount } from './amount'; +import { DenunciationIndex } from './denunciation'; +import { StringValue } from '../../../google/protobuf/wrappers'; +import { Slot } from './slot'; +/** + * SlotExecutionOutput + * + * @generated from protobuf message massa.model.v1.SlotExecutionOutput + */ +export interface SlotExecutionOutput { + /** + * Status + * + * @generated from protobuf field: massa.model.v1.ExecutionOutputStatus status = 1; + */ + status: ExecutionOutputStatus; + /** + * Executed slot output + * + * @generated from protobuf field: massa.model.v1.ExecutionOutput execution_output = 2; + */ + executionOutput?: ExecutionOutput; +} +/** + * FinalizedExecutionOutput + * + * @generated from protobuf message massa.model.v1.FinalizedExecutionOutput + */ +export interface FinalizedExecutionOutput { + /** + * Slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; +} +/** + * ExecutionOutput + * + * @generated from protobuf message massa.model.v1.ExecutionOutput + */ +export interface ExecutionOutput { + /** + * Slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; + /** + * Block id at that slot (Optional) + * + * @generated from protobuf field: google.protobuf.StringValue block_id = 2; + */ + blockId?: StringValue; + /** + * Events emitted by the execution step + * + * @generated from protobuf field: repeated massa.model.v1.ScExecutionEvent events = 3; + */ + events: ScExecutionEvent[]; + /** + * State changes caused by the execution step + * + * @generated from protobuf field: massa.model.v1.StateChanges state_changes = 4; + */ + stateChanges?: StateChanges; +} +/** + * ScExecutionEvent + * + * @generated from protobuf message massa.model.v1.ScExecutionEvent + */ +export interface ScExecutionEvent { + /** + * Sc execution context + * + * @generated from protobuf field: massa.model.v1.ScExecutionEventContext context = 1; + */ + context?: ScExecutionEventContext; + /** + * Generated data of the event + * + * @generated from protobuf field: bytes data = 2; + */ + data: Uint8Array; +} +/** + * ScExecutionEvent context + * + * @generated from protobuf message massa.model.v1.ScExecutionEventContext + */ +export interface ScExecutionEventContext { + /** + * When was it generated + * + * @generated from protobuf field: massa.model.v1.Slot origin_slot = 1; + */ + originSlot?: Slot; + /** + * Block id if there was a block at that slot (Optional) + * + * @generated from protobuf field: google.protobuf.StringValue block_id = 2; + */ + blockId?: StringValue; + /** + * Index of the event in the slot + * + * @generated from protobuf field: uint64 index_in_slot = 3; + */ + indexInSlot: bigint; + /** + * Call stack addresses. most recent at the end + * + * @generated from protobuf field: repeated string call_stack = 4; + */ + callStack: string[]; + /** + * Origin operation id (Optional) + * + * @generated from protobuf field: google.protobuf.StringValue origin_operation_id = 5; + */ + originOperationId?: StringValue; + /** + * If a failure occurred + * + * @generated from protobuf field: bool is_failure = 6; + */ + isFailure: boolean; + /** + * Status + * + * @generated from protobuf field: massa.model.v1.ScExecutionEventStatus status = 7; + */ + status: ScExecutionEventStatus; +} +/** + * ScExecutionEventsStatus + * + * @generated from protobuf message massa.model.v1.ScExecutionEventsStatus + */ +export interface ScExecutionEventsStatus { + /** + * Status + * + * @generated from protobuf field: repeated massa.model.v1.ScExecutionEventStatus status = 1; + */ + status: ScExecutionEventStatus[]; +} +/** + * StateChanges + * + * @generated from protobuf message massa.model.v1.StateChanges + */ +export interface StateChanges { + /** + * Ledger changes + * + * @generated from protobuf field: repeated massa.model.v1.LedgerChangeEntry ledger_changes = 1; + */ + ledgerChanges: LedgerChangeEntry[]; + /** + * Asynchronous pool changes + * + * @generated from protobuf field: repeated massa.model.v1.AsyncPoolChangeEntry async_pool_changes = 2; + */ + asyncPoolChanges: AsyncPoolChangeEntry[]; + /** + * Executed operations changes + * + * @generated from protobuf field: repeated massa.model.v1.ExecutedOpsChangeEntry executed_ops_changes = 4; + */ + executedOpsChanges: ExecutedOpsChangeEntry[]; + /** + * Executed denunciations changes + * + * @generated from protobuf field: repeated massa.model.v1.DenunciationIndex executed_denunciations_changes = 5; + */ + executedDenunciationsChanges: DenunciationIndex[]; + /** + * Execution trail hash change + * + * @generated from protobuf field: massa.model.v1.SetOrKeepString execution_trail_hash_change = 6; + */ + executionTrailHashChange?: SetOrKeepString; +} +/** + * ExecutedOpsChangeEntry + * + * @generated from protobuf message massa.model.v1.ExecutedOpsChangeEntry + */ +export interface ExecutedOpsChangeEntry { + /** + * string + * + * @generated from protobuf field: string operation_id = 1; + */ + operationId: string; + /** + * ExecutedOpsChangeValue + * + * @generated from protobuf field: massa.model.v1.ExecutedOpsChangeValue value = 2; + */ + value?: ExecutedOpsChangeValue; +} +/** + * ExecutedOpsChangeValue + * + * @generated from protobuf message massa.model.v1.ExecutedOpsChangeValue + */ +export interface ExecutedOpsChangeValue { + /** + * The status of the execution of the operation + * + * @generated from protobuf field: massa.model.v1.OperationExecutionStatus status = 1; + */ + status: OperationExecutionStatus; + /** + * Slot until which the operation remains valid (included) + * + * @generated from protobuf field: massa.model.v1.Slot slot = 2; + */ + slot?: Slot; +} +/** + * AsyncPoolChange Entry + * + * @generated from protobuf message massa.model.v1.AsyncPoolChangeEntry + */ +export interface AsyncPoolChangeEntry { + /** + * Async message id + * + * @generated from protobuf field: string async_message_id = 1; + */ + asyncMessageId: string; + /** + * AsyncPool message + * + * @generated from protobuf field: massa.model.v1.AsyncPoolChangeValue value = 2; + */ + value?: AsyncPoolChangeValue; +} +/** + * AsyncPoolChangeValue + * + * @generated from protobuf message massa.model.v1.AsyncPoolChangeValue + */ +export interface AsyncPoolChangeValue { + /** + * The type of the change + * + * @generated from protobuf field: massa.model.v1.AsyncPoolChangeType type = 1; + */ + type: AsyncPoolChangeType; + /** + * @generated from protobuf oneof: message + */ + message: + | { + oneofKind: 'createdMessage'; + /** + * Created ledger entry + * + * @generated from protobuf field: massa.model.v1.AsyncMessage created_message = 2; + */ + createdMessage: AsyncMessage; + } + | { + oneofKind: 'updatedMessage'; + /** + * Update ledger entry + * + * @generated from protobuf field: massa.model.v1.AsyncMessageUpdate updated_message = 3; + */ + updatedMessage: AsyncMessageUpdate; + } + | { + oneofKind: undefined; + }; +} +/** + * Asynchronous smart contract message + * + * @generated from protobuf message massa.model.v1.AsyncMessage + */ +export interface AsyncMessage { + /** + * Slot at which the message was emitted + * + * @generated from protobuf field: massa.model.v1.Slot emission_slot = 1; + */ + emissionSlot?: Slot; + /** + * Index of the emitted message within the `emission_slot`. + * This is used for disambiguate the emission of multiple messages at the same slot. + * + * @generated from protobuf field: uint64 emission_index = 2; + */ + emissionIndex: bigint; + /** + * The address that sent the message + * + * @generated from protobuf field: string sender = 3; + */ + sender: string; + /** + * The address towards which the message is being sent + * + * @generated from protobuf field: string destination = 4; + */ + destination: string; + /** + * the handler function name within the destination address' bytecode + * + * @generated from protobuf field: string handler = 5; + */ + handler: string; + /** + * Maximum gas to use when processing the message + * + * @generated from protobuf field: uint64 max_gas = 6; + */ + maxGas: bigint; + /** + * Fee paid by the sender when the message is processed. + * + * @generated from protobuf field: massa.model.v1.NativeAmount fee = 7; + */ + fee?: NativeAmount; + /** + * Coins sent from the sender to the target address of the message. + * Those coins are spent by the sender address when the message is sent, + * and credited to the destination address when receiving the message. + * In case of failure or discard, those coins are reimbursed to the sender. + * + * @generated from protobuf field: massa.model.v1.NativeAmount coins = 8; + */ + coins?: NativeAmount; + /** + * Slot at which the message starts being valid (bound included in the validity range) + * + * @generated from protobuf field: massa.model.v1.Slot validity_start = 9; + */ + validityStart?: Slot; + /** + * Slot at which the message stops being valid (bound not included in the validity range) + * + * @generated from protobuf field: massa.model.v1.Slot validity_end = 10; + */ + validityEnd?: Slot; + /** + * Raw payload data of the message + * + * @generated from protobuf field: bytes data = 11; + */ + data: Uint8Array; + /** + * Trigger that define whenever a message can be executed + * + * @generated from protobuf field: massa.model.v1.AsyncMessageTrigger trigger = 12; + */ + trigger?: AsyncMessageTrigger; + /** + * Boolean that determine if the message can be executed. For messages without filter this boolean is always true. + * For messages with filter, this boolean is true if the filter has been matched between `validity_start` and current slot. + * + * @generated from protobuf field: bool can_be_executed = 13; + */ + canBeExecuted: boolean; +} +/** + * Asynchronous smart contract message + * + * @generated from protobuf message massa.model.v1.AsyncMessageUpdate + */ +export interface AsyncMessageUpdate { + /** + * Change the slot at which the message was emitted + * + * @generated from protobuf field: massa.model.v1.SetOrKeepSlot emission_slot = 1; + */ + emissionSlot?: SetOrKeepSlot; + /** + * Change the index of the emitted message within the `emission_slot`. + * This is used for disambiguate the emission of multiple messages at the same slot. + * + * @generated from protobuf field: massa.model.v1.SetOrKeepUint64 emission_index = 2; + */ + emissionIndex?: SetOrKeepUint64; + /** + * Change the address that sent the message + * + * @generated from protobuf field: massa.model.v1.SetOrKeepString sender = 3; + */ + sender?: SetOrKeepString; + /** + * Change the address towards which the message is being sent + * + * @generated from protobuf field: massa.model.v1.SetOrKeepString destination = 4; + */ + destination?: SetOrKeepString; + /** + * Change the handler function name within the destination address' bytecode + * + * @generated from protobuf field: massa.model.v1.SetOrKeepString handler = 5; + */ + handler?: SetOrKeepString; + /** + * Change the maximum gas to use when processing the message + * + * @generated from protobuf field: massa.model.v1.SetOrKeepUint64 max_gas = 6; + */ + maxGas?: SetOrKeepUint64; + /** + * Change the fee paid by the sender when the message is processed. + * + * @generated from protobuf field: massa.model.v1.SetOrKeepUint64 fee = 7; + */ + fee?: SetOrKeepUint64; + /** + * Change the coins sent from the sender to the target address of the message. + * Those coins are spent by the sender address when the message is sent, + * and credited to the destination address when receiving the message. + * In case of failure or discard, those coins are reimbursed to the sender. + * + * @generated from protobuf field: massa.model.v1.SetOrKeepUint64 coins = 8; + */ + coins?: SetOrKeepUint64; + /** + * Change the slot at which the message starts being valid (bound included in the validity range) + * + * @generated from protobuf field: massa.model.v1.SetOrKeepSlot validity_start = 9; + */ + validityStart?: SetOrKeepSlot; + /** + * Change the slot at which the message stops being valid (bound not included in the validity range) + * + * @generated from protobuf field: massa.model.v1.SetOrKeepSlot validity_end = 10; + */ + validityEnd?: SetOrKeepSlot; + /** + * Change the raw payload data of the message + * + * @generated from protobuf field: massa.model.v1.SetOrKeepBytes data = 11; + */ + data?: SetOrKeepBytes; + /** + * Change the trigger that define whenever a message can be executed + * + * @generated from protobuf field: massa.model.v1.SetOrKeepAsyncMessageTrigger trigger = 12; + */ + trigger?: SetOrKeepAsyncMessageTrigger; + /** + * Change the boolean that determine if the message can be executed. For messages without filter this boolean is always true. + * For messages with filter, this boolean is true if the filter has been matched between `validity_start` and current slot. + * + * @generated from protobuf field: massa.model.v1.SetOrKeepBool can_be_executed = 13; + */ + canBeExecuted?: SetOrKeepBool; +} +/** + * Set or Keep Slot + * + * @generated from protobuf message massa.model.v1.SetOrKeepSlot + */ +export interface SetOrKeepSlot { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * The value of that entry (Optional) + * + * @generated from protobuf field: massa.model.v1.Slot set = 1; + */ + set: Slot; + } + | { + oneofKind: 'keep'; + /** + * Keep the existing value + * + * @generated from protobuf field: massa.model.v1.Empty keep = 2; + */ + keep: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Set or Keep Uint64 + * + * @generated from protobuf message massa.model.v1.SetOrKeepUint64 + */ +export interface SetOrKeepUint64 { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * The value of that entry (Optional) + * + * @generated from protobuf field: google.protobuf.UInt64Value set = 1; + */ + set: UInt64Value; + } + | { + oneofKind: 'keep'; + /** + * Keep the existing value + * + * @generated from protobuf field: massa.model.v1.Empty keep = 2; + */ + keep: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Set or Keep String + * + * @generated from protobuf message massa.model.v1.SetOrKeepString + */ +export interface SetOrKeepString { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * The value of that entry (Optional) + * + * @generated from protobuf field: google.protobuf.StringValue set = 1; + */ + set: StringValue; + } + | { + oneofKind: 'keep'; + /** + * Keep the existing value + * + * @generated from protobuf field: massa.model.v1.Empty keep = 2; + */ + keep: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Set or Keep Bytes + * + * @generated from protobuf message massa.model.v1.SetOrKeepBytes + */ +export interface SetOrKeepBytes { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * The value of that entry (Optional) + * + * @generated from protobuf field: google.protobuf.BytesValue set = 1; + */ + set: BytesValue; + } + | { + oneofKind: 'keep'; + /** + * Keep the existing value + * + * @generated from protobuf field: massa.model.v1.Empty keep = 2; + */ + keep: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Set or Keep Bool + * + * @generated from protobuf message massa.model.v1.SetOrKeepBool + */ +export interface SetOrKeepBool { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * The value of that entry (Optional) + * + * @generated from protobuf field: google.protobuf.BoolValue set = 1; + */ + set: BoolValue; + } + | { + oneofKind: 'keep'; + /** + * Keep the existing value + * + * @generated from protobuf field: massa.model.v1.Empty keep = 2; + */ + keep: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Set or Keep AsyncMessageTrigger + * + * @generated from protobuf message massa.model.v1.SetOrKeepAsyncMessageTrigger + */ +export interface SetOrKeepAsyncMessageTrigger { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * The value of that entry (Optional) + * + * @generated from protobuf field: massa.model.v1.AsyncMessageTrigger set = 1; + */ + set: AsyncMessageTrigger; + } + | { + oneofKind: 'keep'; + /** + * Keep the existing value + * + * @generated from protobuf field: massa.model.v1.Empty keep = 2; + */ + keep: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Structure defining a trigger for an asynchronous message + * + * @generated from protobuf message massa.model.v1.AsyncMessageTrigger + */ +export interface AsyncMessageTrigger { + /** + * Filter on the address + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Filter on the datastore key (Optional) + * + * @generated from protobuf field: google.protobuf.BytesValue datastore_key = 2; + */ + datastoreKey?: BytesValue; +} +/** + * LedgerChangeEntry + * + * @generated from protobuf message massa.model.v1.LedgerChangeEntry + */ +export interface LedgerChangeEntry { + /** + * Address + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Ledger message + * + * @generated from protobuf field: massa.model.v1.LedgerChangeValue value = 2; + */ + value?: LedgerChangeValue; +} +/** + * LedgerChangeValue + * + * @generated from protobuf message massa.model.v1.LedgerChangeValue + */ +export interface LedgerChangeValue { + /** + * The type of the change + * + * @generated from protobuf field: massa.model.v1.LedgerChangeType type = 1; + */ + type: LedgerChangeType; + /** + * @generated from protobuf oneof: entry + */ + entry: + | { + oneofKind: 'createdEntry'; + /** + * Created ledger entry + * + * @generated from protobuf field: massa.model.v1.LedgerEntry created_entry = 2; + */ + createdEntry: LedgerEntry; + } + | { + oneofKind: 'updatedEntry'; + /** + * Update ledger entry + * + * @generated from protobuf field: massa.model.v1.LedgerEntryUpdate updated_entry = 3; + */ + updatedEntry: LedgerEntryUpdate; + } + | { + oneofKind: undefined; + }; +} +/** + * An entry associated to an address in the `FinalLedger` + * + * @generated from protobuf message massa.model.v1.LedgerEntry + */ +export interface LedgerEntry { + /** + * The balance of that entry + * + * @generated from protobuf field: massa.model.v1.NativeAmount balance = 1; + */ + balance?: NativeAmount; + /** + * Executable bytecode + * + * @generated from protobuf field: bytes bytecode = 2; + */ + bytecode: Uint8Array; + /** + * A key-value store associating a hash to arbitrary bytes + * + * @generated from protobuf field: repeated massa.model.v1.BytesMapFieldEntry datastore = 3; + */ + datastore: BytesMapFieldEntry[]; +} +/** + * Represents an update to one or more fields of a `LedgerEntry` + * + * @generated from protobuf message massa.model.v1.LedgerEntryUpdate + */ +export interface LedgerEntryUpdate { + /** + * Change the balance + * + * @generated from protobuf field: massa.model.v1.SetOrKeepBalance balance = 1; + */ + balance?: SetOrKeepBalance; + /** + * Change the executable bytecode + * + * @generated from protobuf field: massa.model.v1.SetOrKeepBytes bytecode = 2; + */ + bytecode?: SetOrKeepBytes; + /** + * Change datastore entries + * + * @generated from protobuf field: repeated massa.model.v1.SetOrDeleteDatastoreEntry datastore = 3; + */ + datastore: SetOrDeleteDatastoreEntry[]; +} +/** + * Set or Keep Balance + * + * @generated from protobuf message massa.model.v1.SetOrKeepBalance + */ +export interface SetOrKeepBalance { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * The value of that entry (Optional) + * + * @generated from protobuf field: massa.model.v1.NativeAmount set = 1; + */ + set: NativeAmount; + } + | { + oneofKind: 'keep'; + /** + * Keep the existing value + * + * @generated from protobuf field: massa.model.v1.Empty keep = 2; + */ + keep: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Set or Delete DatastoreEntry + * + * @generated from protobuf message massa.model.v1.SetOrDeleteDatastoreEntry + */ +export interface SetOrDeleteDatastoreEntry { + /** + * @generated from protobuf oneof: change + */ + change: + | { + oneofKind: 'set'; + /** + * Executable bytecode (Optional) + * + * @generated from protobuf field: massa.model.v1.BytesMapFieldEntry set = 1; + */ + set: BytesMapFieldEntry; + } + | { + oneofKind: 'delete'; + /** + * Delete the existing bytecode + * + * @generated from protobuf field: massa.model.v1.Empty delete = 2; + */ + delete: Empty; + } + | { + oneofKind: undefined; + }; +} +/** + * Read-only execution call + * + * @generated from protobuf message massa.model.v1.ReadOnlyExecutionCall + */ +export interface ReadOnlyExecutionCall { + /** + * Maximum gas to spend in the execution. + * + * @generated from protobuf field: uint64 max_gas = 1; + */ + maxGas: bigint; + /** + * Call stack to simulate, older caller first + * + * @generated from protobuf field: repeated massa.model.v1.ExecutionStackElement call_stack = 2; + */ + callStack: ExecutionStackElement[]; + /** + * @generated from protobuf oneof: target + */ + target: + | { + oneofKind: 'bytecodeCall'; + /** + * Byte code + * + * @generated from protobuf field: massa.model.v1.BytecodeExecution bytecode_call = 3; + */ + bytecodeCall: BytecodeExecution; + } + | { + oneofKind: 'functionCall'; + /** + * Function call + * + * @generated from protobuf field: massa.model.v1.FunctionCall function_call = 4; + */ + functionCall: FunctionCall; + } + | { + oneofKind: undefined; + }; + /** + * Caller's address, (Optional) if not set, an auto-generated address will be used + * + * @generated from protobuf field: google.protobuf.StringValue caller_address = 5; + */ + callerAddress?: StringValue; + /** + * execution start state + * + * Whether to start execution from final or active state + * + * @generated from protobuf field: bool is_final = 6; + */ + isFinal: boolean; +} +/** + * / Execute a bytecode + * + * @generated from protobuf message massa.model.v1.BytecodeExecution + */ +export interface BytecodeExecution { + /** + * Byte code + * + * @generated from protobuf field: bytes bytecode = 1; + */ + bytecode: Uint8Array; + /** + * Serialized datastore (key value store) for `ExecuteSC` Operation (Optional) + * + * @generated from protobuf field: bytes operation_datastore = 2; + */ + operationDatastore: Uint8Array; +} +/** + * Execute a function call + * + * @generated from protobuf message massa.model.v1.FunctionCall + */ +export interface FunctionCall { + /** + * Target address + * + * @generated from protobuf field: string target_address = 1; + */ + targetAddress: string; + /** + * Target function + * + * @generated from protobuf field: string target_function = 2; + */ + targetFunction: string; + /** + * Parameter to pass to the target function + * + * @generated from protobuf field: bytes parameter = 3; + */ + parameter: Uint8Array; +} +/** + * Structure describing the output of a read only execution + * + * @generated from protobuf message massa.model.v1.ReadOnlyExecutionOutput + */ +export interface ReadOnlyExecutionOutput { + /** + * Output of a single execution + * + * @generated from protobuf field: massa.model.v1.ExecutionOutput out = 1; + */ + out?: ExecutionOutput; + /** + * Gas cost for this execution + * + * @generated from protobuf field: uint64 used_gas = 2; + */ + usedGas: bigint; + /** + * Returned value from the module call + * + * @generated from protobuf field: bytes call_result = 3; + */ + callResult: Uint8Array; +} +/** + * Structure describing an element of the execution stack. + * Every time a function is called from bytecode, + * a new `ExecutionStackElement` is pushed at the top of the execution stack + * to represent the local execution context of the called function, + * instead of the caller's which should lie just below in the stack. + * + * @generated from protobuf message massa.model.v1.ExecutionStackElement + */ +export interface ExecutionStackElement { + /** + * Called address + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Coins transferred to the target address during the call + * + * @generated from protobuf field: massa.model.v1.NativeAmount coins = 2; + */ + coins?: NativeAmount; + /** + * List of addresses owned by the current call, and on which the current call has write access. + * This list should contain `ExecutionStackElement::address` in the sense that an address should have write access to itself. + * This list should also contain all addresses created previously during the call + * to allow write access on newly created addresses in order to set them up, + * but only within the scope of the current stack element. + * That way, only the current scope and neither its caller not the functions it calls gain this write access, + * which is important for security. + * Note that we use a vector instead of a pre-hashed set to ensure order determinism, + * the performance hit of linear search remains minimal because `owned_addresses` will always contain very few elements. + * + * @generated from protobuf field: repeated string owned_addresses = 3; + */ + ownedAddresses: string[]; + /** + * Datastore (key value store) for `ExecuteSC` Operation (Optional) + * + * @generated from protobuf field: repeated massa.model.v1.BytesMapFieldEntry operation_datastore = 4; + */ + operationDatastore: BytesMapFieldEntry[]; +} +/** + * ScExecutionEventStatus type enum + * + * @generated from protobuf enum massa.model.v1.ScExecutionEventStatus + */ +export enum ScExecutionEventStatus { + /** + * Default enum value + * + * @generated from protobuf enum value: SC_EXECUTION_EVENT_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Final status + * + * @generated from protobuf enum value: SC_EXECUTION_EVENT_STATUS_FINAL = 1; + */ + FINAL = 1, + /** + * Read only status + * + * @generated from protobuf enum value: SC_EXECUTION_EVENT_STATUS_READ_ONLY = 2; + */ + READ_ONLY = 2, + /** + * Candidate status + * + * @generated from protobuf enum value: SC_EXECUTION_EVENT_STATUS_CANDIDATE = 3; + */ + CANDIDATE = 3, +} +/** + * ExecutionOutputStatus type enum + * + * @generated from protobuf enum massa.model.v1.ExecutionOutputStatus + */ +export enum ExecutionOutputStatus { + /** + * Default enum value + * + * @generated from protobuf enum value: EXECUTION_OUTPUT_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Candidate status + * + * @generated from protobuf enum value: EXECUTION_OUTPUT_STATUS_CANDIDATE = 1; + */ + CANDIDATE = 1, + /** + * Final status + * + * @generated from protobuf enum value: EXECUTION_OUTPUT_STATUS_FINAL = 2; + */ + FINAL = 2, + /** + * Unknown status + * + * @generated from protobuf enum value: EXECUTION_OUTPUT_STATUS_UNKNOWN = 3; + */ + UNKNOWN = 3, +} +/** + * OperationExecutionStatus type enum + * + * @generated from protobuf enum massa.model.v1.OperationExecutionStatus + */ +export enum OperationExecutionStatus { + /** + * Default enum value + * + * @generated from protobuf enum value: OPERATION_EXECUTION_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Success status + * + * @generated from protobuf enum value: OPERATION_EXECUTION_STATUS_SUCCESS = 1; + */ + SUCCESS = 1, + /** + * Failed only status + * + * @generated from protobuf enum value: OPERATION_EXECUTION_STATUS_FAILED = 2; + */ + FAILED = 2, +} +/** + * AsyncPoolChangeType type enum + * + * @generated from protobuf enum massa.model.v1.AsyncPoolChangeType + */ +export enum AsyncPoolChangeType { + /** + * Default enum value + * + * @generated from protobuf enum value: ASYNC_POOL_CHANGE_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Set type + * + * @generated from protobuf enum value: ASYNC_POOL_CHANGE_TYPE_SET = 1; + */ + SET = 1, + /** + * Activate only type + * + * @generated from protobuf enum value: ASYNC_POOL_CHANGE_TYPE_UPDATE = 2; + */ + UPDATE = 2, + /** + * Delete only type + * + * @generated from protobuf enum value: ASYNC_POOL_CHANGE_TYPE_DELETE = 3; + */ + DELETE = 3, +} +/** + * LedgerChangeType type enum + * + * @generated from protobuf enum massa.model.v1.LedgerChangeType + */ +export enum LedgerChangeType { + /** + * Default enum value + * + * @generated from protobuf enum value: LEDGER_CHANGE_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Set type + * + * @generated from protobuf enum value: LEDGER_CHANGE_TYPE_SET = 1; + */ + SET = 1, + /** + * Update type + * + * @generated from protobuf enum value: LEDGER_CHANGE_TYPE_UPDATE = 2; + */ + UPDATE = 2, + /** + * Delete type + * + * @generated from protobuf enum value: LEDGER_CHANGE_TYPE_DELETE = 3; + */ + DELETE = 3, +} +// @generated message type with reflection information, may provide speed optimized methods +class SlotExecutionOutput$Type extends MessageType { + constructor() { + super('massa.model.v1.SlotExecutionOutput', [ + { + no: 1, + name: 'status', + kind: 'enum', + T: () => [ + 'massa.model.v1.ExecutionOutputStatus', + ExecutionOutputStatus, + 'EXECUTION_OUTPUT_STATUS_', + ], + }, + { + no: 2, + name: 'execution_output', + kind: 'message', + T: () => ExecutionOutput, + }, + ]); + } + create(value?: PartialMessage): SlotExecutionOutput { + const message = { status: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SlotExecutionOutput, + ): SlotExecutionOutput { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ExecutionOutputStatus status */ 1: + message.status = reader.int32(); + break; + case /* massa.model.v1.ExecutionOutput execution_output */ 2: + message.executionOutput = ExecutionOutput.internalBinaryRead( + reader, + reader.uint32(), + options, + message.executionOutput, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SlotExecutionOutput, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ExecutionOutputStatus status = 1; */ + if (message.status !== 0) + writer.tag(1, WireType.Varint).int32(message.status); + /* massa.model.v1.ExecutionOutput execution_output = 2; */ + if (message.executionOutput) + ExecutionOutput.internalBinaryWrite( + message.executionOutput, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SlotExecutionOutput + */ +export const SlotExecutionOutput = new SlotExecutionOutput$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FinalizedExecutionOutput$Type extends MessageType { + constructor() { + super('massa.model.v1.FinalizedExecutionOutput', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + ]); + } + create( + value?: PartialMessage, + ): FinalizedExecutionOutput { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FinalizedExecutionOutput, + ): FinalizedExecutionOutput { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FinalizedExecutionOutput, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.FinalizedExecutionOutput + */ +export const FinalizedExecutionOutput = new FinalizedExecutionOutput$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionOutput$Type extends MessageType { + constructor() { + super('massa.model.v1.ExecutionOutput', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + { no: 2, name: 'block_id', kind: 'message', T: () => StringValue }, + { + no: 3, + name: 'events', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ScExecutionEvent, + }, + { no: 4, name: 'state_changes', kind: 'message', T: () => StateChanges }, + ]); + } + create(value?: PartialMessage): ExecutionOutput { + const message = { events: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionOutput, + ): ExecutionOutput { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + case /* google.protobuf.StringValue block_id */ 2: + message.blockId = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.blockId, + ); + break; + case /* repeated massa.model.v1.ScExecutionEvent events */ 3: + message.events.push( + ScExecutionEvent.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* massa.model.v1.StateChanges state_changes */ 4: + message.stateChanges = StateChanges.internalBinaryRead( + reader, + reader.uint32(), + options, + message.stateChanges, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionOutput, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* google.protobuf.StringValue block_id = 2; */ + if (message.blockId) + StringValue.internalBinaryWrite( + message.blockId, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.ScExecutionEvent events = 3; */ + for (let i = 0; i < message.events.length; i++) + ScExecutionEvent.internalBinaryWrite( + message.events[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.StateChanges state_changes = 4; */ + if (message.stateChanges) + StateChanges.internalBinaryWrite( + message.stateChanges, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ExecutionOutput + */ +export const ExecutionOutput = new ExecutionOutput$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScExecutionEvent$Type extends MessageType { + constructor() { + super('massa.model.v1.ScExecutionEvent', [ + { + no: 1, + name: 'context', + kind: 'message', + T: () => ScExecutionEventContext, + }, + { no: 2, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): ScExecutionEvent { + const message = { data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScExecutionEvent, + ): ScExecutionEvent { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ScExecutionEventContext context */ 1: + message.context = ScExecutionEventContext.internalBinaryRead( + reader, + reader.uint32(), + options, + message.context, + ); + break; + case /* bytes data */ 2: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScExecutionEvent, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ScExecutionEventContext context = 1; */ + if (message.context) + ScExecutionEventContext.internalBinaryWrite( + message.context, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bytes data = 2; */ + if (message.data.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ScExecutionEvent + */ +export const ScExecutionEvent = new ScExecutionEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScExecutionEventContext$Type extends MessageType { + constructor() { + super('massa.model.v1.ScExecutionEventContext', [ + { no: 1, name: 'origin_slot', kind: 'message', T: () => Slot }, + { no: 2, name: 'block_id', kind: 'message', T: () => StringValue }, + { + no: 3, + name: 'index_in_slot', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 4, + name: 'call_stack', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'origin_operation_id', + kind: 'message', + T: () => StringValue, + }, + { no: 6, name: 'is_failure', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + { + no: 7, + name: 'status', + kind: 'enum', + T: () => [ + 'massa.model.v1.ScExecutionEventStatus', + ScExecutionEventStatus, + 'SC_EXECUTION_EVENT_STATUS_', + ], + }, + ]); + } + create( + value?: PartialMessage, + ): ScExecutionEventContext { + const message = { + indexInSlot: 0n, + callStack: [], + isFailure: false, + status: 0, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScExecutionEventContext, + ): ScExecutionEventContext { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot origin_slot */ 1: + message.originSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.originSlot, + ); + break; + case /* google.protobuf.StringValue block_id */ 2: + message.blockId = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.blockId, + ); + break; + case /* uint64 index_in_slot */ 3: + message.indexInSlot = reader.uint64().toBigInt(); + break; + case /* repeated string call_stack */ 4: + message.callStack.push(reader.string()); + break; + case /* google.protobuf.StringValue origin_operation_id */ 5: + message.originOperationId = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.originOperationId, + ); + break; + case /* bool is_failure */ 6: + message.isFailure = reader.bool(); + break; + case /* massa.model.v1.ScExecutionEventStatus status */ 7: + message.status = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScExecutionEventContext, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot origin_slot = 1; */ + if (message.originSlot) + Slot.internalBinaryWrite( + message.originSlot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* google.protobuf.StringValue block_id = 2; */ + if (message.blockId) + StringValue.internalBinaryWrite( + message.blockId, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 index_in_slot = 3; */ + if (message.indexInSlot !== 0n) + writer.tag(3, WireType.Varint).uint64(message.indexInSlot); + /* repeated string call_stack = 4; */ + for (let i = 0; i < message.callStack.length; i++) + writer.tag(4, WireType.LengthDelimited).string(message.callStack[i]); + /* google.protobuf.StringValue origin_operation_id = 5; */ + if (message.originOperationId) + StringValue.internalBinaryWrite( + message.originOperationId, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bool is_failure = 6; */ + if (message.isFailure !== false) + writer.tag(6, WireType.Varint).bool(message.isFailure); + /* massa.model.v1.ScExecutionEventStatus status = 7; */ + if (message.status !== 0) + writer.tag(7, WireType.Varint).int32(message.status); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ScExecutionEventContext + */ +export const ScExecutionEventContext = new ScExecutionEventContext$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ScExecutionEventsStatus$Type extends MessageType { + constructor() { + super('massa.model.v1.ScExecutionEventsStatus', [ + { + no: 1, + name: 'status', + kind: 'enum', + repeat: 1 /* RepeatType.PACKED*/, + T: () => [ + 'massa.model.v1.ScExecutionEventStatus', + ScExecutionEventStatus, + 'SC_EXECUTION_EVENT_STATUS_', + ], + }, + ]); + } + create( + value?: PartialMessage, + ): ScExecutionEventsStatus { + const message = { status: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ScExecutionEventsStatus, + ): ScExecutionEventsStatus { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.ScExecutionEventStatus status */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.status.push(reader.int32()); + else message.status.push(reader.int32()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ScExecutionEventsStatus, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.ScExecutionEventStatus status = 1; */ + if (message.status.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.status.length; i++) + writer.int32(message.status[i]); + writer.join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ScExecutionEventsStatus + */ +export const ScExecutionEventsStatus = new ScExecutionEventsStatus$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StateChanges$Type extends MessageType { + constructor() { + super('massa.model.v1.StateChanges', [ + { + no: 1, + name: 'ledger_changes', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => LedgerChangeEntry, + }, + { + no: 2, + name: 'async_pool_changes', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => AsyncPoolChangeEntry, + }, + { + no: 4, + name: 'executed_ops_changes', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ExecutedOpsChangeEntry, + }, + { + no: 5, + name: 'executed_denunciations_changes', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => DenunciationIndex, + }, + { + no: 6, + name: 'execution_trail_hash_change', + kind: 'message', + T: () => SetOrKeepString, + }, + ]); + } + create(value?: PartialMessage): StateChanges { + const message = { + ledgerChanges: [], + asyncPoolChanges: [], + executedOpsChanges: [], + executedDenunciationsChanges: [], + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: StateChanges, + ): StateChanges { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.LedgerChangeEntry ledger_changes */ 1: + message.ledgerChanges.push( + LedgerChangeEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated massa.model.v1.AsyncPoolChangeEntry async_pool_changes */ 2: + message.asyncPoolChanges.push( + AsyncPoolChangeEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated massa.model.v1.ExecutedOpsChangeEntry executed_ops_changes */ 4: + message.executedOpsChanges.push( + ExecutedOpsChangeEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* repeated massa.model.v1.DenunciationIndex executed_denunciations_changes */ 5: + message.executedDenunciationsChanges.push( + DenunciationIndex.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* massa.model.v1.SetOrKeepString execution_trail_hash_change */ 6: + message.executionTrailHashChange = SetOrKeepString.internalBinaryRead( + reader, + reader.uint32(), + options, + message.executionTrailHashChange, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: StateChanges, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.LedgerChangeEntry ledger_changes = 1; */ + for (let i = 0; i < message.ledgerChanges.length; i++) + LedgerChangeEntry.internalBinaryWrite( + message.ledgerChanges[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.AsyncPoolChangeEntry async_pool_changes = 2; */ + for (let i = 0; i < message.asyncPoolChanges.length; i++) + AsyncPoolChangeEntry.internalBinaryWrite( + message.asyncPoolChanges[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.ExecutedOpsChangeEntry executed_ops_changes = 4; */ + for (let i = 0; i < message.executedOpsChanges.length; i++) + ExecutedOpsChangeEntry.internalBinaryWrite( + message.executedOpsChanges[i], + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.DenunciationIndex executed_denunciations_changes = 5; */ + for (let i = 0; i < message.executedDenunciationsChanges.length; i++) + DenunciationIndex.internalBinaryWrite( + message.executedDenunciationsChanges[i], + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepString execution_trail_hash_change = 6; */ + if (message.executionTrailHashChange) + SetOrKeepString.internalBinaryWrite( + message.executionTrailHashChange, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.StateChanges + */ +export const StateChanges = new StateChanges$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutedOpsChangeEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.ExecutedOpsChangeEntry', [ + { + no: 1, + name: 'operation_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'value', + kind: 'message', + T: () => ExecutedOpsChangeValue, + }, + ]); + } + create( + value?: PartialMessage, + ): ExecutedOpsChangeEntry { + const message = { operationId: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutedOpsChangeEntry, + ): ExecutedOpsChangeEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string operation_id */ 1: + message.operationId = reader.string(); + break; + case /* massa.model.v1.ExecutedOpsChangeValue value */ 2: + message.value = ExecutedOpsChangeValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.value, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutedOpsChangeEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string operation_id = 1; */ + if (message.operationId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.operationId); + /* massa.model.v1.ExecutedOpsChangeValue value = 2; */ + if (message.value) + ExecutedOpsChangeValue.internalBinaryWrite( + message.value, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ExecutedOpsChangeEntry + */ +export const ExecutedOpsChangeEntry = new ExecutedOpsChangeEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutedOpsChangeValue$Type extends MessageType { + constructor() { + super('massa.model.v1.ExecutedOpsChangeValue', [ + { + no: 1, + name: 'status', + kind: 'enum', + T: () => [ + 'massa.model.v1.OperationExecutionStatus', + OperationExecutionStatus, + 'OPERATION_EXECUTION_STATUS_', + ], + }, + { no: 2, name: 'slot', kind: 'message', T: () => Slot }, + ]); + } + create( + value?: PartialMessage, + ): ExecutedOpsChangeValue { + const message = { status: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutedOpsChangeValue, + ): ExecutedOpsChangeValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.OperationExecutionStatus status */ 1: + message.status = reader.int32(); + break; + case /* massa.model.v1.Slot slot */ 2: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutedOpsChangeValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.OperationExecutionStatus status = 1; */ + if (message.status !== 0) + writer.tag(1, WireType.Varint).int32(message.status); + /* massa.model.v1.Slot slot = 2; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ExecutedOpsChangeValue + */ +export const ExecutedOpsChangeValue = new ExecutedOpsChangeValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AsyncPoolChangeEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.AsyncPoolChangeEntry', [ + { + no: 1, + name: 'async_message_id', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 2, name: 'value', kind: 'message', T: () => AsyncPoolChangeValue }, + ]); + } + create(value?: PartialMessage): AsyncPoolChangeEntry { + const message = { asyncMessageId: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AsyncPoolChangeEntry, + ): AsyncPoolChangeEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string async_message_id */ 1: + message.asyncMessageId = reader.string(); + break; + case /* massa.model.v1.AsyncPoolChangeValue value */ 2: + message.value = AsyncPoolChangeValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.value, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AsyncPoolChangeEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string async_message_id = 1; */ + if (message.asyncMessageId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.asyncMessageId); + /* massa.model.v1.AsyncPoolChangeValue value = 2; */ + if (message.value) + AsyncPoolChangeValue.internalBinaryWrite( + message.value, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.AsyncPoolChangeEntry + */ +export const AsyncPoolChangeEntry = new AsyncPoolChangeEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AsyncPoolChangeValue$Type extends MessageType { + constructor() { + super('massa.model.v1.AsyncPoolChangeValue', [ + { + no: 1, + name: 'type', + kind: 'enum', + T: () => [ + 'massa.model.v1.AsyncPoolChangeType', + AsyncPoolChangeType, + 'ASYNC_POOL_CHANGE_TYPE_', + ], + }, + { + no: 2, + name: 'created_message', + kind: 'message', + oneof: 'message', + T: () => AsyncMessage, + }, + { + no: 3, + name: 'updated_message', + kind: 'message', + oneof: 'message', + T: () => AsyncMessageUpdate, + }, + ]); + } + create(value?: PartialMessage): AsyncPoolChangeValue { + const message = { type: 0, message: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AsyncPoolChangeValue, + ): AsyncPoolChangeValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.AsyncPoolChangeType type */ 1: + message.type = reader.int32(); + break; + case /* massa.model.v1.AsyncMessage created_message */ 2: + message.message = { + oneofKind: 'createdMessage', + createdMessage: AsyncMessage.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.message as any).createdMessage, + ), + }; + break; + case /* massa.model.v1.AsyncMessageUpdate updated_message */ 3: + message.message = { + oneofKind: 'updatedMessage', + updatedMessage: AsyncMessageUpdate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.message as any).updatedMessage, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AsyncPoolChangeValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.AsyncPoolChangeType type = 1; */ + if (message.type !== 0) writer.tag(1, WireType.Varint).int32(message.type); + /* massa.model.v1.AsyncMessage created_message = 2; */ + if (message.message.oneofKind === 'createdMessage') + AsyncMessage.internalBinaryWrite( + message.message.createdMessage, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.AsyncMessageUpdate updated_message = 3; */ + if (message.message.oneofKind === 'updatedMessage') + AsyncMessageUpdate.internalBinaryWrite( + message.message.updatedMessage, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.AsyncPoolChangeValue + */ +export const AsyncPoolChangeValue = new AsyncPoolChangeValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AsyncMessage$Type extends MessageType { + constructor() { + super('massa.model.v1.AsyncMessage', [ + { no: 1, name: 'emission_slot', kind: 'message', T: () => Slot }, + { + no: 2, + name: 'emission_index', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 3, name: 'sender', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 4, + name: 'destination', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 5, name: 'handler', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 6, + name: 'max_gas', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 7, name: 'fee', kind: 'message', T: () => NativeAmount }, + { no: 8, name: 'coins', kind: 'message', T: () => NativeAmount }, + { no: 9, name: 'validity_start', kind: 'message', T: () => Slot }, + { no: 10, name: 'validity_end', kind: 'message', T: () => Slot }, + { no: 11, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { + no: 12, + name: 'trigger', + kind: 'message', + T: () => AsyncMessageTrigger, + }, + { + no: 13, + name: 'can_be_executed', + kind: 'scalar', + T: 8 /* ScalarType.BOOL*/, + }, + ]); + } + create(value?: PartialMessage): AsyncMessage { + const message = { + emissionIndex: 0n, + sender: '', + destination: '', + handler: '', + maxGas: 0n, + data: new Uint8Array(0), + canBeExecuted: false, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AsyncMessage, + ): AsyncMessage { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot emission_slot */ 1: + message.emissionSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.emissionSlot, + ); + break; + case /* uint64 emission_index */ 2: + message.emissionIndex = reader.uint64().toBigInt(); + break; + case /* string sender */ 3: + message.sender = reader.string(); + break; + case /* string destination */ 4: + message.destination = reader.string(); + break; + case /* string handler */ 5: + message.handler = reader.string(); + break; + case /* uint64 max_gas */ 6: + message.maxGas = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.NativeAmount fee */ 7: + message.fee = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.fee, + ); + break; + case /* massa.model.v1.NativeAmount coins */ 8: + message.coins = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.coins, + ); + break; + case /* massa.model.v1.Slot validity_start */ 9: + message.validityStart = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.validityStart, + ); + break; + case /* massa.model.v1.Slot validity_end */ 10: + message.validityEnd = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.validityEnd, + ); + break; + case /* bytes data */ 11: + message.data = reader.bytes(); + break; + case /* massa.model.v1.AsyncMessageTrigger trigger */ 12: + message.trigger = AsyncMessageTrigger.internalBinaryRead( + reader, + reader.uint32(), + options, + message.trigger, + ); + break; + case /* bool can_be_executed */ 13: + message.canBeExecuted = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AsyncMessage, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot emission_slot = 1; */ + if (message.emissionSlot) + Slot.internalBinaryWrite( + message.emissionSlot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 emission_index = 2; */ + if (message.emissionIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.emissionIndex); + /* string sender = 3; */ + if (message.sender !== '') + writer.tag(3, WireType.LengthDelimited).string(message.sender); + /* string destination = 4; */ + if (message.destination !== '') + writer.tag(4, WireType.LengthDelimited).string(message.destination); + /* string handler = 5; */ + if (message.handler !== '') + writer.tag(5, WireType.LengthDelimited).string(message.handler); + /* uint64 max_gas = 6; */ + if (message.maxGas !== 0n) + writer.tag(6, WireType.Varint).uint64(message.maxGas); + /* massa.model.v1.NativeAmount fee = 7; */ + if (message.fee) + NativeAmount.internalBinaryWrite( + message.fee, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount coins = 8; */ + if (message.coins) + NativeAmount.internalBinaryWrite( + message.coins, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot validity_start = 9; */ + if (message.validityStart) + Slot.internalBinaryWrite( + message.validityStart, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot validity_end = 10; */ + if (message.validityEnd) + Slot.internalBinaryWrite( + message.validityEnd, + writer.tag(10, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bytes data = 11; */ + if (message.data.length) + writer.tag(11, WireType.LengthDelimited).bytes(message.data); + /* massa.model.v1.AsyncMessageTrigger trigger = 12; */ + if (message.trigger) + AsyncMessageTrigger.internalBinaryWrite( + message.trigger, + writer.tag(12, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bool can_be_executed = 13; */ + if (message.canBeExecuted !== false) + writer.tag(13, WireType.Varint).bool(message.canBeExecuted); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.AsyncMessage + */ +export const AsyncMessage = new AsyncMessage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AsyncMessageUpdate$Type extends MessageType { + constructor() { + super('massa.model.v1.AsyncMessageUpdate', [ + { no: 1, name: 'emission_slot', kind: 'message', T: () => SetOrKeepSlot }, + { + no: 2, + name: 'emission_index', + kind: 'message', + T: () => SetOrKeepUint64, + }, + { no: 3, name: 'sender', kind: 'message', T: () => SetOrKeepString }, + { no: 4, name: 'destination', kind: 'message', T: () => SetOrKeepString }, + { no: 5, name: 'handler', kind: 'message', T: () => SetOrKeepString }, + { no: 6, name: 'max_gas', kind: 'message', T: () => SetOrKeepUint64 }, + { no: 7, name: 'fee', kind: 'message', T: () => SetOrKeepUint64 }, + { no: 8, name: 'coins', kind: 'message', T: () => SetOrKeepUint64 }, + { + no: 9, + name: 'validity_start', + kind: 'message', + T: () => SetOrKeepSlot, + }, + { no: 10, name: 'validity_end', kind: 'message', T: () => SetOrKeepSlot }, + { no: 11, name: 'data', kind: 'message', T: () => SetOrKeepBytes }, + { + no: 12, + name: 'trigger', + kind: 'message', + T: () => SetOrKeepAsyncMessageTrigger, + }, + { + no: 13, + name: 'can_be_executed', + kind: 'message', + T: () => SetOrKeepBool, + }, + ]); + } + create(value?: PartialMessage): AsyncMessageUpdate { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AsyncMessageUpdate, + ): AsyncMessageUpdate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SetOrKeepSlot emission_slot */ 1: + message.emissionSlot = SetOrKeepSlot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.emissionSlot, + ); + break; + case /* massa.model.v1.SetOrKeepUint64 emission_index */ 2: + message.emissionIndex = SetOrKeepUint64.internalBinaryRead( + reader, + reader.uint32(), + options, + message.emissionIndex, + ); + break; + case /* massa.model.v1.SetOrKeepString sender */ 3: + message.sender = SetOrKeepString.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sender, + ); + break; + case /* massa.model.v1.SetOrKeepString destination */ 4: + message.destination = SetOrKeepString.internalBinaryRead( + reader, + reader.uint32(), + options, + message.destination, + ); + break; + case /* massa.model.v1.SetOrKeepString handler */ 5: + message.handler = SetOrKeepString.internalBinaryRead( + reader, + reader.uint32(), + options, + message.handler, + ); + break; + case /* massa.model.v1.SetOrKeepUint64 max_gas */ 6: + message.maxGas = SetOrKeepUint64.internalBinaryRead( + reader, + reader.uint32(), + options, + message.maxGas, + ); + break; + case /* massa.model.v1.SetOrKeepUint64 fee */ 7: + message.fee = SetOrKeepUint64.internalBinaryRead( + reader, + reader.uint32(), + options, + message.fee, + ); + break; + case /* massa.model.v1.SetOrKeepUint64 coins */ 8: + message.coins = SetOrKeepUint64.internalBinaryRead( + reader, + reader.uint32(), + options, + message.coins, + ); + break; + case /* massa.model.v1.SetOrKeepSlot validity_start */ 9: + message.validityStart = SetOrKeepSlot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.validityStart, + ); + break; + case /* massa.model.v1.SetOrKeepSlot validity_end */ 10: + message.validityEnd = SetOrKeepSlot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.validityEnd, + ); + break; + case /* massa.model.v1.SetOrKeepBytes data */ 11: + message.data = SetOrKeepBytes.internalBinaryRead( + reader, + reader.uint32(), + options, + message.data, + ); + break; + case /* massa.model.v1.SetOrKeepAsyncMessageTrigger trigger */ 12: + message.trigger = SetOrKeepAsyncMessageTrigger.internalBinaryRead( + reader, + reader.uint32(), + options, + message.trigger, + ); + break; + case /* massa.model.v1.SetOrKeepBool can_be_executed */ 13: + message.canBeExecuted = SetOrKeepBool.internalBinaryRead( + reader, + reader.uint32(), + options, + message.canBeExecuted, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AsyncMessageUpdate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SetOrKeepSlot emission_slot = 1; */ + if (message.emissionSlot) + SetOrKeepSlot.internalBinaryWrite( + message.emissionSlot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepUint64 emission_index = 2; */ + if (message.emissionIndex) + SetOrKeepUint64.internalBinaryWrite( + message.emissionIndex, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepString sender = 3; */ + if (message.sender) + SetOrKeepString.internalBinaryWrite( + message.sender, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepString destination = 4; */ + if (message.destination) + SetOrKeepString.internalBinaryWrite( + message.destination, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepString handler = 5; */ + if (message.handler) + SetOrKeepString.internalBinaryWrite( + message.handler, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepUint64 max_gas = 6; */ + if (message.maxGas) + SetOrKeepUint64.internalBinaryWrite( + message.maxGas, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepUint64 fee = 7; */ + if (message.fee) + SetOrKeepUint64.internalBinaryWrite( + message.fee, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepUint64 coins = 8; */ + if (message.coins) + SetOrKeepUint64.internalBinaryWrite( + message.coins, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepSlot validity_start = 9; */ + if (message.validityStart) + SetOrKeepSlot.internalBinaryWrite( + message.validityStart, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepSlot validity_end = 10; */ + if (message.validityEnd) + SetOrKeepSlot.internalBinaryWrite( + message.validityEnd, + writer.tag(10, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepBytes data = 11; */ + if (message.data) + SetOrKeepBytes.internalBinaryWrite( + message.data, + writer.tag(11, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepAsyncMessageTrigger trigger = 12; */ + if (message.trigger) + SetOrKeepAsyncMessageTrigger.internalBinaryWrite( + message.trigger, + writer.tag(12, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepBool can_be_executed = 13; */ + if (message.canBeExecuted) + SetOrKeepBool.internalBinaryWrite( + message.canBeExecuted, + writer.tag(13, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.AsyncMessageUpdate + */ +export const AsyncMessageUpdate = new AsyncMessageUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrKeepSlot$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrKeepSlot', [ + { no: 1, name: 'set', kind: 'message', oneof: 'change', T: () => Slot }, + { no: 2, name: 'keep', kind: 'message', oneof: 'change', T: () => Empty }, + ]); + } + create(value?: PartialMessage): SetOrKeepSlot { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrKeepSlot, + ): SetOrKeepSlot { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot set */ 1: + message.change = { + oneofKind: 'set', + set: Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty keep */ 2: + message.change = { + oneofKind: 'keep', + keep: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).keep, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrKeepSlot, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot set = 1; */ + if (message.change.oneofKind === 'set') + Slot.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty keep = 2; */ + if (message.change.oneofKind === 'keep') + Empty.internalBinaryWrite( + message.change.keep, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrKeepSlot + */ +export const SetOrKeepSlot = new SetOrKeepSlot$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrKeepUint64$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrKeepUint64', [ + { + no: 1, + name: 'set', + kind: 'message', + oneof: 'change', + T: () => UInt64Value, + }, + { no: 2, name: 'keep', kind: 'message', oneof: 'change', T: () => Empty }, + ]); + } + create(value?: PartialMessage): SetOrKeepUint64 { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrKeepUint64, + ): SetOrKeepUint64 { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.UInt64Value set */ 1: + message.change = { + oneofKind: 'set', + set: UInt64Value.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty keep */ 2: + message.change = { + oneofKind: 'keep', + keep: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).keep, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrKeepUint64, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* google.protobuf.UInt64Value set = 1; */ + if (message.change.oneofKind === 'set') + UInt64Value.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty keep = 2; */ + if (message.change.oneofKind === 'keep') + Empty.internalBinaryWrite( + message.change.keep, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrKeepUint64 + */ +export const SetOrKeepUint64 = new SetOrKeepUint64$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrKeepString$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrKeepString', [ + { + no: 1, + name: 'set', + kind: 'message', + oneof: 'change', + T: () => StringValue, + }, + { no: 2, name: 'keep', kind: 'message', oneof: 'change', T: () => Empty }, + ]); + } + create(value?: PartialMessage): SetOrKeepString { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrKeepString, + ): SetOrKeepString { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.StringValue set */ 1: + message.change = { + oneofKind: 'set', + set: StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty keep */ 2: + message.change = { + oneofKind: 'keep', + keep: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).keep, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrKeepString, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* google.protobuf.StringValue set = 1; */ + if (message.change.oneofKind === 'set') + StringValue.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty keep = 2; */ + if (message.change.oneofKind === 'keep') + Empty.internalBinaryWrite( + message.change.keep, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrKeepString + */ +export const SetOrKeepString = new SetOrKeepString$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrKeepBytes$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrKeepBytes', [ + { + no: 1, + name: 'set', + kind: 'message', + oneof: 'change', + T: () => BytesValue, + }, + { no: 2, name: 'keep', kind: 'message', oneof: 'change', T: () => Empty }, + ]); + } + create(value?: PartialMessage): SetOrKeepBytes { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrKeepBytes, + ): SetOrKeepBytes { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.BytesValue set */ 1: + message.change = { + oneofKind: 'set', + set: BytesValue.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty keep */ 2: + message.change = { + oneofKind: 'keep', + keep: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).keep, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrKeepBytes, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* google.protobuf.BytesValue set = 1; */ + if (message.change.oneofKind === 'set') + BytesValue.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty keep = 2; */ + if (message.change.oneofKind === 'keep') + Empty.internalBinaryWrite( + message.change.keep, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrKeepBytes + */ +export const SetOrKeepBytes = new SetOrKeepBytes$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrKeepBool$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrKeepBool', [ + { + no: 1, + name: 'set', + kind: 'message', + oneof: 'change', + T: () => BoolValue, + }, + { no: 2, name: 'keep', kind: 'message', oneof: 'change', T: () => Empty }, + ]); + } + create(value?: PartialMessage): SetOrKeepBool { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrKeepBool, + ): SetOrKeepBool { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.BoolValue set */ 1: + message.change = { + oneofKind: 'set', + set: BoolValue.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty keep */ 2: + message.change = { + oneofKind: 'keep', + keep: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).keep, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrKeepBool, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* google.protobuf.BoolValue set = 1; */ + if (message.change.oneofKind === 'set') + BoolValue.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty keep = 2; */ + if (message.change.oneofKind === 'keep') + Empty.internalBinaryWrite( + message.change.keep, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrKeepBool + */ +export const SetOrKeepBool = new SetOrKeepBool$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrKeepAsyncMessageTrigger$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrKeepAsyncMessageTrigger', [ + { + no: 1, + name: 'set', + kind: 'message', + oneof: 'change', + T: () => AsyncMessageTrigger, + }, + { no: 2, name: 'keep', kind: 'message', oneof: 'change', T: () => Empty }, + ]); + } + create( + value?: PartialMessage, + ): SetOrKeepAsyncMessageTrigger { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial( + this, + message, + value, + ); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrKeepAsyncMessageTrigger, + ): SetOrKeepAsyncMessageTrigger { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.AsyncMessageTrigger set */ 1: + message.change = { + oneofKind: 'set', + set: AsyncMessageTrigger.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty keep */ 2: + message.change = { + oneofKind: 'keep', + keep: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).keep, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrKeepAsyncMessageTrigger, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.AsyncMessageTrigger set = 1; */ + if (message.change.oneofKind === 'set') + AsyncMessageTrigger.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty keep = 2; */ + if (message.change.oneofKind === 'keep') + Empty.internalBinaryWrite( + message.change.keep, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrKeepAsyncMessageTrigger + */ +export const SetOrKeepAsyncMessageTrigger = + new SetOrKeepAsyncMessageTrigger$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AsyncMessageTrigger$Type extends MessageType { + constructor() { + super('massa.model.v1.AsyncMessageTrigger', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'datastore_key', kind: 'message', T: () => BytesValue }, + ]); + } + create(value?: PartialMessage): AsyncMessageTrigger { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: AsyncMessageTrigger, + ): AsyncMessageTrigger { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* google.protobuf.BytesValue datastore_key */ 2: + message.datastoreKey = BytesValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.datastoreKey, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: AsyncMessageTrigger, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* google.protobuf.BytesValue datastore_key = 2; */ + if (message.datastoreKey) + BytesValue.internalBinaryWrite( + message.datastoreKey, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.AsyncMessageTrigger + */ +export const AsyncMessageTrigger = new AsyncMessageTrigger$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LedgerChangeEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.LedgerChangeEntry', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'value', kind: 'message', T: () => LedgerChangeValue }, + ]); + } + create(value?: PartialMessage): LedgerChangeEntry { + const message = { address: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LedgerChangeEntry, + ): LedgerChangeEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* massa.model.v1.LedgerChangeValue value */ 2: + message.value = LedgerChangeValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.value, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LedgerChangeEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* massa.model.v1.LedgerChangeValue value = 2; */ + if (message.value) + LedgerChangeValue.internalBinaryWrite( + message.value, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.LedgerChangeEntry + */ +export const LedgerChangeEntry = new LedgerChangeEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LedgerChangeValue$Type extends MessageType { + constructor() { + super('massa.model.v1.LedgerChangeValue', [ + { + no: 1, + name: 'type', + kind: 'enum', + T: () => [ + 'massa.model.v1.LedgerChangeType', + LedgerChangeType, + 'LEDGER_CHANGE_TYPE_', + ], + }, + { + no: 2, + name: 'created_entry', + kind: 'message', + oneof: 'entry', + T: () => LedgerEntry, + }, + { + no: 3, + name: 'updated_entry', + kind: 'message', + oneof: 'entry', + T: () => LedgerEntryUpdate, + }, + ]); + } + create(value?: PartialMessage): LedgerChangeValue { + const message = { type: 0, entry: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LedgerChangeValue, + ): LedgerChangeValue { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.LedgerChangeType type */ 1: + message.type = reader.int32(); + break; + case /* massa.model.v1.LedgerEntry created_entry */ 2: + message.entry = { + oneofKind: 'createdEntry', + createdEntry: LedgerEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.entry as any).createdEntry, + ), + }; + break; + case /* massa.model.v1.LedgerEntryUpdate updated_entry */ 3: + message.entry = { + oneofKind: 'updatedEntry', + updatedEntry: LedgerEntryUpdate.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.entry as any).updatedEntry, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LedgerChangeValue, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.LedgerChangeType type = 1; */ + if (message.type !== 0) writer.tag(1, WireType.Varint).int32(message.type); + /* massa.model.v1.LedgerEntry created_entry = 2; */ + if (message.entry.oneofKind === 'createdEntry') + LedgerEntry.internalBinaryWrite( + message.entry.createdEntry, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.LedgerEntryUpdate updated_entry = 3; */ + if (message.entry.oneofKind === 'updatedEntry') + LedgerEntryUpdate.internalBinaryWrite( + message.entry.updatedEntry, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.LedgerChangeValue + */ +export const LedgerChangeValue = new LedgerChangeValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LedgerEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.LedgerEntry', [ + { no: 1, name: 'balance', kind: 'message', T: () => NativeAmount }, + { no: 2, name: 'bytecode', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { + no: 3, + name: 'datastore', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => BytesMapFieldEntry, + }, + ]); + } + create(value?: PartialMessage): LedgerEntry { + const message = { bytecode: new Uint8Array(0), datastore: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LedgerEntry, + ): LedgerEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount balance */ 1: + message.balance = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.balance, + ); + break; + case /* bytes bytecode */ 2: + message.bytecode = reader.bytes(); + break; + case /* repeated massa.model.v1.BytesMapFieldEntry datastore */ 3: + message.datastore.push( + BytesMapFieldEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LedgerEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount balance = 1; */ + if (message.balance) + NativeAmount.internalBinaryWrite( + message.balance, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bytes bytecode = 2; */ + if (message.bytecode.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.bytecode); + /* repeated massa.model.v1.BytesMapFieldEntry datastore = 3; */ + for (let i = 0; i < message.datastore.length; i++) + BytesMapFieldEntry.internalBinaryWrite( + message.datastore[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.LedgerEntry + */ +export const LedgerEntry = new LedgerEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LedgerEntryUpdate$Type extends MessageType { + constructor() { + super('massa.model.v1.LedgerEntryUpdate', [ + { no: 1, name: 'balance', kind: 'message', T: () => SetOrKeepBalance }, + { no: 2, name: 'bytecode', kind: 'message', T: () => SetOrKeepBytes }, + { + no: 3, + name: 'datastore', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => SetOrDeleteDatastoreEntry, + }, + ]); + } + create(value?: PartialMessage): LedgerEntryUpdate { + const message = { datastore: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: LedgerEntryUpdate, + ): LedgerEntryUpdate { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.SetOrKeepBalance balance */ 1: + message.balance = SetOrKeepBalance.internalBinaryRead( + reader, + reader.uint32(), + options, + message.balance, + ); + break; + case /* massa.model.v1.SetOrKeepBytes bytecode */ 2: + message.bytecode = SetOrKeepBytes.internalBinaryRead( + reader, + reader.uint32(), + options, + message.bytecode, + ); + break; + case /* repeated massa.model.v1.SetOrDeleteDatastoreEntry datastore */ 3: + message.datastore.push( + SetOrDeleteDatastoreEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: LedgerEntryUpdate, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.SetOrKeepBalance balance = 1; */ + if (message.balance) + SetOrKeepBalance.internalBinaryWrite( + message.balance, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.SetOrKeepBytes bytecode = 2; */ + if (message.bytecode) + SetOrKeepBytes.internalBinaryWrite( + message.bytecode, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.SetOrDeleteDatastoreEntry datastore = 3; */ + for (let i = 0; i < message.datastore.length; i++) + SetOrDeleteDatastoreEntry.internalBinaryWrite( + message.datastore[i], + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.LedgerEntryUpdate + */ +export const LedgerEntryUpdate = new LedgerEntryUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrKeepBalance$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrKeepBalance', [ + { + no: 1, + name: 'set', + kind: 'message', + oneof: 'change', + T: () => NativeAmount, + }, + { no: 2, name: 'keep', kind: 'message', oneof: 'change', T: () => Empty }, + ]); + } + create(value?: PartialMessage): SetOrKeepBalance { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrKeepBalance, + ): SetOrKeepBalance { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount set */ 1: + message.change = { + oneofKind: 'set', + set: NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty keep */ 2: + message.change = { + oneofKind: 'keep', + keep: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).keep, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrKeepBalance, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount set = 1; */ + if (message.change.oneofKind === 'set') + NativeAmount.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty keep = 2; */ + if (message.change.oneofKind === 'keep') + Empty.internalBinaryWrite( + message.change.keep, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrKeepBalance + */ +export const SetOrKeepBalance = new SetOrKeepBalance$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetOrDeleteDatastoreEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.SetOrDeleteDatastoreEntry', [ + { + no: 1, + name: 'set', + kind: 'message', + oneof: 'change', + T: () => BytesMapFieldEntry, + }, + { + no: 2, + name: 'delete', + kind: 'message', + oneof: 'change', + T: () => Empty, + }, + ]); + } + create( + value?: PartialMessage, + ): SetOrDeleteDatastoreEntry { + const message = { change: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SetOrDeleteDatastoreEntry, + ): SetOrDeleteDatastoreEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.BytesMapFieldEntry set */ 1: + message.change = { + oneofKind: 'set', + set: BytesMapFieldEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).set, + ), + }; + break; + case /* massa.model.v1.Empty delete */ 2: + message.change = { + oneofKind: 'delete', + delete: Empty.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.change as any).delete, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SetOrDeleteDatastoreEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.BytesMapFieldEntry set = 1; */ + if (message.change.oneofKind === 'set') + BytesMapFieldEntry.internalBinaryWrite( + message.change.set, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Empty delete = 2; */ + if (message.change.oneofKind === 'delete') + Empty.internalBinaryWrite( + message.change.delete, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SetOrDeleteDatastoreEntry + */ +export const SetOrDeleteDatastoreEntry = new SetOrDeleteDatastoreEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReadOnlyExecutionCall$Type extends MessageType { + constructor() { + super('massa.model.v1.ReadOnlyExecutionCall', [ + { + no: 1, + name: 'max_gas', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 2, + name: 'call_stack', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ExecutionStackElement, + }, + { + no: 3, + name: 'bytecode_call', + kind: 'message', + oneof: 'target', + T: () => BytecodeExecution, + }, + { + no: 4, + name: 'function_call', + kind: 'message', + oneof: 'target', + T: () => FunctionCall, + }, + { no: 5, name: 'caller_address', kind: 'message', T: () => StringValue }, + { no: 6, name: 'is_final', kind: 'scalar', T: 8 /* ScalarType.BOOL*/ }, + ]); + } + create(value?: PartialMessage): ReadOnlyExecutionCall { + const message = { + maxGas: 0n, + callStack: [], + target: { oneofKind: undefined }, + isFinal: false, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ReadOnlyExecutionCall, + ): ReadOnlyExecutionCall { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 max_gas */ 1: + message.maxGas = reader.uint64().toBigInt(); + break; + case /* repeated massa.model.v1.ExecutionStackElement call_stack */ 2: + message.callStack.push( + ExecutionStackElement.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + case /* massa.model.v1.BytecodeExecution bytecode_call */ 3: + message.target = { + oneofKind: 'bytecodeCall', + bytecodeCall: BytecodeExecution.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.target as any).bytecodeCall, + ), + }; + break; + case /* massa.model.v1.FunctionCall function_call */ 4: + message.target = { + oneofKind: 'functionCall', + functionCall: FunctionCall.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.target as any).functionCall, + ), + }; + break; + case /* google.protobuf.StringValue caller_address */ 5: + message.callerAddress = StringValue.internalBinaryRead( + reader, + reader.uint32(), + options, + message.callerAddress, + ); + break; + case /* bool is_final */ 6: + message.isFinal = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ReadOnlyExecutionCall, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 max_gas = 1; */ + if (message.maxGas !== 0n) + writer.tag(1, WireType.Varint).uint64(message.maxGas); + /* repeated massa.model.v1.ExecutionStackElement call_stack = 2; */ + for (let i = 0; i < message.callStack.length; i++) + ExecutionStackElement.internalBinaryWrite( + message.callStack[i], + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.BytecodeExecution bytecode_call = 3; */ + if (message.target.oneofKind === 'bytecodeCall') + BytecodeExecution.internalBinaryWrite( + message.target.bytecodeCall, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.FunctionCall function_call = 4; */ + if (message.target.oneofKind === 'functionCall') + FunctionCall.internalBinaryWrite( + message.target.functionCall, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* google.protobuf.StringValue caller_address = 5; */ + if (message.callerAddress) + StringValue.internalBinaryWrite( + message.callerAddress, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* bool is_final = 6; */ + if (message.isFinal !== false) + writer.tag(6, WireType.Varint).bool(message.isFinal); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ReadOnlyExecutionCall + */ +export const ReadOnlyExecutionCall = new ReadOnlyExecutionCall$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BytecodeExecution$Type extends MessageType { + constructor() { + super('massa.model.v1.BytecodeExecution', [ + { no: 1, name: 'bytecode', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { + no: 2, + name: 'operation_datastore', + kind: 'scalar', + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create(value?: PartialMessage): BytecodeExecution { + const message = { + bytecode: new Uint8Array(0), + operationDatastore: new Uint8Array(0), + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: BytecodeExecution, + ): BytecodeExecution { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes bytecode */ 1: + message.bytecode = reader.bytes(); + break; + case /* bytes operation_datastore */ 2: + message.operationDatastore = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: BytecodeExecution, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes bytecode = 1; */ + if (message.bytecode.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.bytecode); + /* bytes operation_datastore = 2; */ + if (message.operationDatastore.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.operationDatastore); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.BytecodeExecution + */ +export const BytecodeExecution = new BytecodeExecution$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FunctionCall$Type extends MessageType { + constructor() { + super('massa.model.v1.FunctionCall', [ + { + no: 1, + name: 'target_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'target_function', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 3, name: 'parameter', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + ]); + } + create(value?: PartialMessage): FunctionCall { + const message = { + targetAddress: '', + targetFunction: '', + parameter: new Uint8Array(0), + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: FunctionCall, + ): FunctionCall { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string target_address */ 1: + message.targetAddress = reader.string(); + break; + case /* string target_function */ 2: + message.targetFunction = reader.string(); + break; + case /* bytes parameter */ 3: + message.parameter = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: FunctionCall, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string target_address = 1; */ + if (message.targetAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.targetAddress); + /* string target_function = 2; */ + if (message.targetFunction !== '') + writer.tag(2, WireType.LengthDelimited).string(message.targetFunction); + /* bytes parameter = 3; */ + if (message.parameter.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.parameter); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.FunctionCall + */ +export const FunctionCall = new FunctionCall$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReadOnlyExecutionOutput$Type extends MessageType { + constructor() { + super('massa.model.v1.ReadOnlyExecutionOutput', [ + { no: 1, name: 'out', kind: 'message', T: () => ExecutionOutput }, + { + no: 2, + name: 'used_gas', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 3, + name: 'call_result', + kind: 'scalar', + T: 12 /* ScalarType.BYTES*/, + }, + ]); + } + create( + value?: PartialMessage, + ): ReadOnlyExecutionOutput { + const message = { usedGas: 0n, callResult: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ReadOnlyExecutionOutput, + ): ReadOnlyExecutionOutput { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.ExecutionOutput out */ 1: + message.out = ExecutionOutput.internalBinaryRead( + reader, + reader.uint32(), + options, + message.out, + ); + break; + case /* uint64 used_gas */ 2: + message.usedGas = reader.uint64().toBigInt(); + break; + case /* bytes call_result */ 3: + message.callResult = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ReadOnlyExecutionOutput, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.ExecutionOutput out = 1; */ + if (message.out) + ExecutionOutput.internalBinaryWrite( + message.out, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 used_gas = 2; */ + if (message.usedGas !== 0n) + writer.tag(2, WireType.Varint).uint64(message.usedGas); + /* bytes call_result = 3; */ + if (message.callResult.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.callResult); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ReadOnlyExecutionOutput + */ +export const ReadOnlyExecutionOutput = new ReadOnlyExecutionOutput$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionStackElement$Type extends MessageType { + constructor() { + super('massa.model.v1.ExecutionStackElement', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'coins', kind: 'message', T: () => NativeAmount }, + { + no: 3, + name: 'owned_addresses', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'operation_datastore', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => BytesMapFieldEntry, + }, + ]); + } + create(value?: PartialMessage): ExecutionStackElement { + const message = { address: '', ownedAddresses: [], operationDatastore: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionStackElement, + ): ExecutionStackElement { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* massa.model.v1.NativeAmount coins */ 2: + message.coins = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.coins, + ); + break; + case /* repeated string owned_addresses */ 3: + message.ownedAddresses.push(reader.string()); + break; + case /* repeated massa.model.v1.BytesMapFieldEntry operation_datastore */ 4: + message.operationDatastore.push( + BytesMapFieldEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionStackElement, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* massa.model.v1.NativeAmount coins = 2; */ + if (message.coins) + NativeAmount.internalBinaryWrite( + message.coins, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated string owned_addresses = 3; */ + for (let i = 0; i < message.ownedAddresses.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.ownedAddresses[i]); + /* repeated massa.model.v1.BytesMapFieldEntry operation_datastore = 4; */ + for (let i = 0; i < message.operationDatastore.length; i++) + BytesMapFieldEntry.internalBinaryWrite( + message.operationDatastore[i], + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ExecutionStackElement + */ +export const ExecutionStackElement = new ExecutionStackElement$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/node.ts b/frontend/src/proto-gen/massa/model/v1/node.ts new file mode 100644 index 0000000..6f97587 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/node.ts @@ -0,0 +1,1170 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/node.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { NativeAmount } from './amount'; +import { ExecutionStats } from './stats'; +import { NetworkStats } from './stats'; +import { PoolStats } from './stats'; +import { ConsensusStats } from './stats'; +import { Slot } from './slot'; +import { NativeTime } from './time'; +/** + * Node status + * + * @generated from protobuf message massa.model.v1.NodeStatus + */ +export interface NodeStatus { + /** + * Our node id + * + * @generated from protobuf field: string node_id = 1; + */ + nodeId: string; + /** + * Optional node ip + * + * @generated from protobuf field: string node_ip = 2; + */ + nodeIp: string; + /** + * Node version + * + * @generated from protobuf field: string version = 3; + */ + version: string; + /** + * Now + * + * @generated from protobuf field: massa.model.v1.NativeTime current_time = 4; + */ + currentTime?: NativeTime; + /** + * Current cycle + * + * @generated from protobuf field: uint64 current_cycle = 5; + */ + currentCycle: bigint; + /** + * Current cycle starting timestamp + * + * @generated from protobuf field: massa.model.v1.NativeTime current_cycle_time = 6; + */ + currentCycleTime?: NativeTime; + /** + * Next cycle starting timestamp + * + * @generated from protobuf field: massa.model.v1.NativeTime next_cycle_time = 7; + */ + nextCycleTime?: NativeTime; + /** + * Connected nodes + * + * @generated from protobuf field: repeated massa.model.v1.ConnectedNode connected_nodes = 8; + */ + connectedNodes: ConnectedNode[]; + /** + * Last executed final slot + * + * @generated from protobuf field: massa.model.v1.Slot last_executed_final_slot = 9; + */ + lastExecutedFinalSlot?: Slot; + /** + * Last executed speculative slot + * + * @generated from protobuf field: massa.model.v1.Slot last_executed_speculative_slot = 10; + */ + lastExecutedSpeculativeSlot?: Slot; + /** + * The hash of the XOF final state hash + * + * @generated from protobuf field: string final_state_fingerprint = 11; + */ + finalStateFingerprint: string; + /** + * Consensus stats + * + * @generated from protobuf field: massa.model.v1.ConsensusStats consensus_stats = 12; + */ + consensusStats?: ConsensusStats; + /** + * Pool stats (operation count and endorsement count) + * + * @generated from protobuf field: massa.model.v1.PoolStats pool_stats = 13; + */ + poolStats?: PoolStats; + /** + * Network stats + * + * @generated from protobuf field: massa.model.v1.NetworkStats network_stats = 14; + */ + networkStats?: NetworkStats; + /** + * Execution stats + * + * @generated from protobuf field: massa.model.v1.ExecutionStats execution_stats = 15; + */ + executionStats?: ExecutionStats; + /** + * Compact configuration + * + * @generated from protobuf field: massa.model.v1.CompactConfig config = 16; + */ + config?: CompactConfig; +} +/** + * Connected node + * + * @generated from protobuf message massa.model.v1.ConnectedNode + */ +export interface ConnectedNode { + /** + * Node id + * + * @generated from protobuf field: string node_id = 1; + */ + nodeId: string; + /** + * Node ip + * + * @generated from protobuf field: string node_ip = 2; + */ + nodeIp: string; + /** + * Connection type + * + * @generated from protobuf field: massa.model.v1.ConnectionType connection_type = 3; + */ + connectionType: ConnectionType; +} +/** + * Compact configuration + * + * @generated from protobuf message massa.model.v1.CompactConfig + */ +export interface CompactConfig { + /** + * Time in milliseconds when the blockclique started. + * + * @generated from protobuf field: massa.model.v1.NativeTime genesis_timestamp = 1; + */ + genesisTimestamp?: NativeTime; + /** + * TESTNET: time when the blockclique is ended. + * + * @generated from protobuf field: massa.model.v1.NativeTime end_timestamp = 2; + */ + endTimestamp?: NativeTime; + /** + * Number of threads + * + * @generated from protobuf field: uint32 thread_count = 3; + */ + threadCount: number; + /** + * Time between the periods in the same thread. + * + * @generated from protobuf field: massa.model.v1.NativeTime t0 = 4; + */ + t0?: NativeTime; + /** + * Threshold for fitness. + * + * @generated from protobuf field: uint64 delta_f0 = 5; + */ + deltaF0: bigint; + /** + * Maximum operation validity period count + * + * @generated from protobuf field: uint64 operation_validity_periods = 6; + */ + operationValidityPeriods: bigint; + /** + * cycle duration in periods + * + * @generated from protobuf field: uint64 periods_per_cycle = 7; + */ + periodsPerCycle: bigint; + /** + * Reward amount for a block creation + * + * @generated from protobuf field: massa.model.v1.NativeAmount block_reward = 8; + */ + blockReward?: NativeAmount; + /** + * Price of a roll on the network + * + * @generated from protobuf field: massa.model.v1.NativeAmount roll_price = 9; + */ + rollPrice?: NativeAmount; + /** + * Max total size of a block + * + * @generated from protobuf field: uint32 max_block_size = 10; + */ + maxBlockSize: number; +} +/** + * Public status + * + * @generated from protobuf message massa.model.v1.PublicStatus + */ +export interface PublicStatus { + /** + * Our node id + * + * @generated from protobuf field: string node_id = 1; + */ + nodeId: string; + /** + * Node version + * + * @generated from protobuf field: string version = 3; + */ + version: string; + /** + * Now + * + * @generated from protobuf field: massa.model.v1.NativeTime current_time = 4; + */ + currentTime?: NativeTime; + /** + * Current cycle + * + * @generated from protobuf field: uint64 current_cycle = 5; + */ + currentCycle: bigint; + /** + * Current cycle starting timestamp + * + * @generated from protobuf field: massa.model.v1.NativeTime current_cycle_time = 6; + */ + currentCycleTime?: NativeTime; + /** + * Next cycle starting timestamp + * + * @generated from protobuf field: massa.model.v1.NativeTime next_cycle_time = 7; + */ + nextCycleTime?: NativeTime; + /** + * Last executed final slot + * + * @generated from protobuf field: massa.model.v1.Slot last_executed_final_slot = 8; + */ + lastExecutedFinalSlot?: Slot; + /** + * Last executed speculative slot + * + * @generated from protobuf field: massa.model.v1.Slot last_executed_speculative_slot = 9; + */ + lastExecutedSpeculativeSlot?: Slot; + /** + * The hash of the XOF final state hash + * + * @generated from protobuf field: string final_state_fingerprint = 10; + */ + finalStateFingerprint: string; + /** + * Compact configuration + * + * @generated from protobuf field: massa.model.v1.CompactConfig config = 11; + */ + config?: CompactConfig; +} +/** + * ConnectionType enum + * + * @generated from protobuf enum massa.model.v1.ConnectionType + */ +export enum ConnectionType { + /** + * Default enum value + * + * @generated from protobuf enum value: CONNECTION_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Incoming connection + * + * @generated from protobuf enum value: CONNECTION_TYPE_INCOMING = 1; + */ + INCOMING = 1, + /** + * Outgoing connection + * + * @generated from protobuf enum value: CONNECTION_TYPE_OUTGOING = 2; + */ + OUTGOING = 2, +} +// @generated message type with reflection information, may provide speed optimized methods +class NodeStatus$Type extends MessageType { + constructor() { + super('massa.model.v1.NodeStatus', [ + { no: 1, name: 'node_id', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'node_ip', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 3, name: 'version', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 4, name: 'current_time', kind: 'message', T: () => NativeTime }, + { + no: 5, + name: 'current_cycle', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 6, + name: 'current_cycle_time', + kind: 'message', + T: () => NativeTime, + }, + { no: 7, name: 'next_cycle_time', kind: 'message', T: () => NativeTime }, + { + no: 8, + name: 'connected_nodes', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ConnectedNode, + }, + { + no: 9, + name: 'last_executed_final_slot', + kind: 'message', + T: () => Slot, + }, + { + no: 10, + name: 'last_executed_speculative_slot', + kind: 'message', + T: () => Slot, + }, + { + no: 11, + name: 'final_state_fingerprint', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 12, + name: 'consensus_stats', + kind: 'message', + T: () => ConsensusStats, + }, + { no: 13, name: 'pool_stats', kind: 'message', T: () => PoolStats }, + { no: 14, name: 'network_stats', kind: 'message', T: () => NetworkStats }, + { + no: 15, + name: 'execution_stats', + kind: 'message', + T: () => ExecutionStats, + }, + { no: 16, name: 'config', kind: 'message', T: () => CompactConfig }, + ]); + } + create(value?: PartialMessage): NodeStatus { + const message = { + nodeId: '', + nodeIp: '', + version: '', + currentCycle: 0n, + connectedNodes: [], + finalStateFingerprint: '', + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NodeStatus, + ): NodeStatus { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string node_id */ 1: + message.nodeId = reader.string(); + break; + case /* string node_ip */ 2: + message.nodeIp = reader.string(); + break; + case /* string version */ 3: + message.version = reader.string(); + break; + case /* massa.model.v1.NativeTime current_time */ 4: + message.currentTime = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.currentTime, + ); + break; + case /* uint64 current_cycle */ 5: + message.currentCycle = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.NativeTime current_cycle_time */ 6: + message.currentCycleTime = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.currentCycleTime, + ); + break; + case /* massa.model.v1.NativeTime next_cycle_time */ 7: + message.nextCycleTime = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.nextCycleTime, + ); + break; + case /* repeated massa.model.v1.ConnectedNode connected_nodes */ 8: + message.connectedNodes.push( + ConnectedNode.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + case /* massa.model.v1.Slot last_executed_final_slot */ 9: + message.lastExecutedFinalSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.lastExecutedFinalSlot, + ); + break; + case /* massa.model.v1.Slot last_executed_speculative_slot */ 10: + message.lastExecutedSpeculativeSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.lastExecutedSpeculativeSlot, + ); + break; + case /* string final_state_fingerprint */ 11: + message.finalStateFingerprint = reader.string(); + break; + case /* massa.model.v1.ConsensusStats consensus_stats */ 12: + message.consensusStats = ConsensusStats.internalBinaryRead( + reader, + reader.uint32(), + options, + message.consensusStats, + ); + break; + case /* massa.model.v1.PoolStats pool_stats */ 13: + message.poolStats = PoolStats.internalBinaryRead( + reader, + reader.uint32(), + options, + message.poolStats, + ); + break; + case /* massa.model.v1.NetworkStats network_stats */ 14: + message.networkStats = NetworkStats.internalBinaryRead( + reader, + reader.uint32(), + options, + message.networkStats, + ); + break; + case /* massa.model.v1.ExecutionStats execution_stats */ 15: + message.executionStats = ExecutionStats.internalBinaryRead( + reader, + reader.uint32(), + options, + message.executionStats, + ); + break; + case /* massa.model.v1.CompactConfig config */ 16: + message.config = CompactConfig.internalBinaryRead( + reader, + reader.uint32(), + options, + message.config, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NodeStatus, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string node_id = 1; */ + if (message.nodeId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.nodeId); + /* string node_ip = 2; */ + if (message.nodeIp !== '') + writer.tag(2, WireType.LengthDelimited).string(message.nodeIp); + /* string version = 3; */ + if (message.version !== '') + writer.tag(3, WireType.LengthDelimited).string(message.version); + /* massa.model.v1.NativeTime current_time = 4; */ + if (message.currentTime) + NativeTime.internalBinaryWrite( + message.currentTime, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 current_cycle = 5; */ + if (message.currentCycle !== 0n) + writer.tag(5, WireType.Varint).uint64(message.currentCycle); + /* massa.model.v1.NativeTime current_cycle_time = 6; */ + if (message.currentCycleTime) + NativeTime.internalBinaryWrite( + message.currentCycleTime, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime next_cycle_time = 7; */ + if (message.nextCycleTime) + NativeTime.internalBinaryWrite( + message.nextCycleTime, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.ConnectedNode connected_nodes = 8; */ + for (let i = 0; i < message.connectedNodes.length; i++) + ConnectedNode.internalBinaryWrite( + message.connectedNodes[i], + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot last_executed_final_slot = 9; */ + if (message.lastExecutedFinalSlot) + Slot.internalBinaryWrite( + message.lastExecutedFinalSlot, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot last_executed_speculative_slot = 10; */ + if (message.lastExecutedSpeculativeSlot) + Slot.internalBinaryWrite( + message.lastExecutedSpeculativeSlot, + writer.tag(10, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string final_state_fingerprint = 11; */ + if (message.finalStateFingerprint !== '') + writer + .tag(11, WireType.LengthDelimited) + .string(message.finalStateFingerprint); + /* massa.model.v1.ConsensusStats consensus_stats = 12; */ + if (message.consensusStats) + ConsensusStats.internalBinaryWrite( + message.consensusStats, + writer.tag(12, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.PoolStats pool_stats = 13; */ + if (message.poolStats) + PoolStats.internalBinaryWrite( + message.poolStats, + writer.tag(13, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NetworkStats network_stats = 14; */ + if (message.networkStats) + NetworkStats.internalBinaryWrite( + message.networkStats, + writer.tag(14, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.ExecutionStats execution_stats = 15; */ + if (message.executionStats) + ExecutionStats.internalBinaryWrite( + message.executionStats, + writer.tag(15, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.CompactConfig config = 16; */ + if (message.config) + CompactConfig.internalBinaryWrite( + message.config, + writer.tag(16, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.NodeStatus + */ +export const NodeStatus = new NodeStatus$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ConnectedNode$Type extends MessageType { + constructor() { + super('massa.model.v1.ConnectedNode', [ + { no: 1, name: 'node_id', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'node_ip', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 3, + name: 'connection_type', + kind: 'enum', + T: () => [ + 'massa.model.v1.ConnectionType', + ConnectionType, + 'CONNECTION_TYPE_', + ], + }, + ]); + } + create(value?: PartialMessage): ConnectedNode { + const message = { nodeId: '', nodeIp: '', connectionType: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ConnectedNode, + ): ConnectedNode { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string node_id */ 1: + message.nodeId = reader.string(); + break; + case /* string node_ip */ 2: + message.nodeIp = reader.string(); + break; + case /* massa.model.v1.ConnectionType connection_type */ 3: + message.connectionType = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ConnectedNode, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string node_id = 1; */ + if (message.nodeId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.nodeId); + /* string node_ip = 2; */ + if (message.nodeIp !== '') + writer.tag(2, WireType.LengthDelimited).string(message.nodeIp); + /* massa.model.v1.ConnectionType connection_type = 3; */ + if (message.connectionType !== 0) + writer.tag(3, WireType.Varint).int32(message.connectionType); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ConnectedNode + */ +export const ConnectedNode = new ConnectedNode$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CompactConfig$Type extends MessageType { + constructor() { + super('massa.model.v1.CompactConfig', [ + { + no: 1, + name: 'genesis_timestamp', + kind: 'message', + T: () => NativeTime, + }, + { no: 2, name: 'end_timestamp', kind: 'message', T: () => NativeTime }, + { + no: 3, + name: 'thread_count', + kind: 'scalar', + T: 13 /* ScalarType.UINT32*/, + }, + { no: 4, name: 't0', kind: 'message', T: () => NativeTime }, + { + no: 5, + name: 'delta_f0', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 6, + name: 'operation_validity_periods', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 7, + name: 'periods_per_cycle', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 8, name: 'block_reward', kind: 'message', T: () => NativeAmount }, + { no: 9, name: 'roll_price', kind: 'message', T: () => NativeAmount }, + { + no: 10, + name: 'max_block_size', + kind: 'scalar', + T: 13 /* ScalarType.UINT32*/, + }, + ]); + } + create(value?: PartialMessage): CompactConfig { + const message = { + threadCount: 0, + deltaF0: 0n, + operationValidityPeriods: 0n, + periodsPerCycle: 0n, + maxBlockSize: 0, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CompactConfig, + ): CompactConfig { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime genesis_timestamp */ 1: + message.genesisTimestamp = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.genesisTimestamp, + ); + break; + case /* massa.model.v1.NativeTime end_timestamp */ 2: + message.endTimestamp = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.endTimestamp, + ); + break; + case /* uint32 thread_count */ 3: + message.threadCount = reader.uint32(); + break; + case /* massa.model.v1.NativeTime t0 */ 4: + message.t0 = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.t0, + ); + break; + case /* uint64 delta_f0 */ 5: + message.deltaF0 = reader.uint64().toBigInt(); + break; + case /* uint64 operation_validity_periods */ 6: + message.operationValidityPeriods = reader.uint64().toBigInt(); + break; + case /* uint64 periods_per_cycle */ 7: + message.periodsPerCycle = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.NativeAmount block_reward */ 8: + message.blockReward = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.blockReward, + ); + break; + case /* massa.model.v1.NativeAmount roll_price */ 9: + message.rollPrice = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.rollPrice, + ); + break; + case /* uint32 max_block_size */ 10: + message.maxBlockSize = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CompactConfig, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime genesis_timestamp = 1; */ + if (message.genesisTimestamp) + NativeTime.internalBinaryWrite( + message.genesisTimestamp, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime end_timestamp = 2; */ + if (message.endTimestamp) + NativeTime.internalBinaryWrite( + message.endTimestamp, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint32 thread_count = 3; */ + if (message.threadCount !== 0) + writer.tag(3, WireType.Varint).uint32(message.threadCount); + /* massa.model.v1.NativeTime t0 = 4; */ + if (message.t0) + NativeTime.internalBinaryWrite( + message.t0, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 delta_f0 = 5; */ + if (message.deltaF0 !== 0n) + writer.tag(5, WireType.Varint).uint64(message.deltaF0); + /* uint64 operation_validity_periods = 6; */ + if (message.operationValidityPeriods !== 0n) + writer.tag(6, WireType.Varint).uint64(message.operationValidityPeriods); + /* uint64 periods_per_cycle = 7; */ + if (message.periodsPerCycle !== 0n) + writer.tag(7, WireType.Varint).uint64(message.periodsPerCycle); + /* massa.model.v1.NativeAmount block_reward = 8; */ + if (message.blockReward) + NativeAmount.internalBinaryWrite( + message.blockReward, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeAmount roll_price = 9; */ + if (message.rollPrice) + NativeAmount.internalBinaryWrite( + message.rollPrice, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint32 max_block_size = 10; */ + if (message.maxBlockSize !== 0) + writer.tag(10, WireType.Varint).uint32(message.maxBlockSize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.CompactConfig + */ +export const CompactConfig = new CompactConfig$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PublicStatus$Type extends MessageType { + constructor() { + super('massa.model.v1.PublicStatus', [ + { no: 1, name: 'node_id', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 3, name: 'version', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 4, name: 'current_time', kind: 'message', T: () => NativeTime }, + { + no: 5, + name: 'current_cycle', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 6, + name: 'current_cycle_time', + kind: 'message', + T: () => NativeTime, + }, + { no: 7, name: 'next_cycle_time', kind: 'message', T: () => NativeTime }, + { + no: 8, + name: 'last_executed_final_slot', + kind: 'message', + T: () => Slot, + }, + { + no: 9, + name: 'last_executed_speculative_slot', + kind: 'message', + T: () => Slot, + }, + { + no: 10, + name: 'final_state_fingerprint', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 11, name: 'config', kind: 'message', T: () => CompactConfig }, + ]); + } + create(value?: PartialMessage): PublicStatus { + const message = { + nodeId: '', + version: '', + currentCycle: 0n, + finalStateFingerprint: '', + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PublicStatus, + ): PublicStatus { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string node_id */ 1: + message.nodeId = reader.string(); + break; + case /* string version */ 3: + message.version = reader.string(); + break; + case /* massa.model.v1.NativeTime current_time */ 4: + message.currentTime = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.currentTime, + ); + break; + case /* uint64 current_cycle */ 5: + message.currentCycle = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.NativeTime current_cycle_time */ 6: + message.currentCycleTime = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.currentCycleTime, + ); + break; + case /* massa.model.v1.NativeTime next_cycle_time */ 7: + message.nextCycleTime = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.nextCycleTime, + ); + break; + case /* massa.model.v1.Slot last_executed_final_slot */ 8: + message.lastExecutedFinalSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.lastExecutedFinalSlot, + ); + break; + case /* massa.model.v1.Slot last_executed_speculative_slot */ 9: + message.lastExecutedSpeculativeSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.lastExecutedSpeculativeSlot, + ); + break; + case /* string final_state_fingerprint */ 10: + message.finalStateFingerprint = reader.string(); + break; + case /* massa.model.v1.CompactConfig config */ 11: + message.config = CompactConfig.internalBinaryRead( + reader, + reader.uint32(), + options, + message.config, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: PublicStatus, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string node_id = 1; */ + if (message.nodeId !== '') + writer.tag(1, WireType.LengthDelimited).string(message.nodeId); + /* string version = 3; */ + if (message.version !== '') + writer.tag(3, WireType.LengthDelimited).string(message.version); + /* massa.model.v1.NativeTime current_time = 4; */ + if (message.currentTime) + NativeTime.internalBinaryWrite( + message.currentTime, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 current_cycle = 5; */ + if (message.currentCycle !== 0n) + writer.tag(5, WireType.Varint).uint64(message.currentCycle); + /* massa.model.v1.NativeTime current_cycle_time = 6; */ + if (message.currentCycleTime) + NativeTime.internalBinaryWrite( + message.currentCycleTime, + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime next_cycle_time = 7; */ + if (message.nextCycleTime) + NativeTime.internalBinaryWrite( + message.nextCycleTime, + writer.tag(7, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot last_executed_final_slot = 8; */ + if (message.lastExecutedFinalSlot) + Slot.internalBinaryWrite( + message.lastExecutedFinalSlot, + writer.tag(8, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot last_executed_speculative_slot = 9; */ + if (message.lastExecutedSpeculativeSlot) + Slot.internalBinaryWrite( + message.lastExecutedSpeculativeSlot, + writer.tag(9, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string final_state_fingerprint = 10; */ + if (message.finalStateFingerprint !== '') + writer + .tag(10, WireType.LengthDelimited) + .string(message.finalStateFingerprint); + /* massa.model.v1.CompactConfig config = 11; */ + if (message.config) + CompactConfig.internalBinaryWrite( + message.config, + writer.tag(11, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.PublicStatus + */ +export const PublicStatus = new PublicStatus$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/operation.ts b/frontend/src/proto-gen/massa/model/v1/operation.ts new file mode 100644 index 0000000..47ce444 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/operation.ts @@ -0,0 +1,1685 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/operation.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { BytesMapFieldEntry } from './commons'; +import { NativeAmount } from './amount'; +/** + * The operation as sent in the network + * + * @generated from protobuf message massa.model.v1.Operation + */ +export interface Operation { + /** + * The fee they have decided for this operation + * + * @generated from protobuf field: massa.model.v1.NativeAmount fee = 1; + */ + fee?: NativeAmount; + /** + * After `expire_period` slot the operation won't be included in a block + * + * @generated from protobuf field: uint64 expire_period = 2; + */ + expirePeriod: bigint; + /** + * The type specific operation part + * + * @generated from protobuf field: massa.model.v1.OperationType op = 3; + */ + op?: OperationType; +} +/** + * Type specific operation content + * + * @generated from protobuf message massa.model.v1.OperationType + */ +export interface OperationType { + /** + * @generated from protobuf oneof: type + */ + type: + | { + oneofKind: 'transaction'; + /** + * Transfer coins from sender to recipient + * + * @generated from protobuf field: massa.model.v1.Transaction transaction = 1; + */ + transaction: Transaction; + } + | { + oneofKind: 'rollBuy'; + /** + * The sender buys `roll_count` rolls. Roll price is defined in configuration + * + * @generated from protobuf field: massa.model.v1.RollBuy roll_buy = 2; + */ + rollBuy: RollBuy; + } + | { + oneofKind: 'rollSell'; + /** + * The sender sells `roll_count` rolls. Roll price is defined in configuration + * + * @generated from protobuf field: massa.model.v1.RollSell roll_sell = 3; + */ + rollSell: RollSell; + } + | { + oneofKind: 'executSc'; + /** + * Execute a smart contract + * + * @generated from protobuf field: massa.model.v1.ExecuteSC execut_sc = 4; + */ + executSc: ExecuteSC; + } + | { + oneofKind: 'callSc'; + /** + * Calls an exported function from a stored smart contract + * + * @generated from protobuf field: massa.model.v1.CallSC call_sc = 5; + */ + callSc: CallSC; + } + | { + oneofKind: undefined; + }; +} +/** + * Transfer coins from sender to recipient + * + * @generated from protobuf message massa.model.v1.Transaction + */ +export interface Transaction { + /** + * Recipient address + * + * @generated from protobuf field: string recipient_address = 1; + */ + recipientAddress: string; + /** + * Amount + * + * @generated from protobuf field: massa.model.v1.NativeAmount amount = 2; + */ + amount?: NativeAmount; +} +/** + * The sender buys `roll_count` rolls. Roll price is defined in configuration + * + * @generated from protobuf message massa.model.v1.RollBuy + */ +export interface RollBuy { + /** + * Roll count + * + * @generated from protobuf field: uint64 roll_count = 1; + */ + rollCount: bigint; +} +/** + * The sender sells `roll_count` rolls. Roll price is defined in configuration + * + * @generated from protobuf message massa.model.v1.RollSell + */ +export interface RollSell { + /** + * Roll count + * + * @generated from protobuf field: uint64 roll_count = 1; + */ + rollCount: bigint; +} +/** + * Execute a smart contract + * + * @generated from protobuf message massa.model.v1.ExecuteSC + */ +export interface ExecuteSC { + /** + * Smart contract bytecode. + * + * @generated from protobuf field: bytes data = 1; + */ + data: Uint8Array; + /** + * The maximum of coins that could be spent by the operation sender + * + * @generated from protobuf field: uint64 max_coins = 2; + */ + maxCoins: bigint; + /** + * The maximum amount of gas that the execution of the contract is allowed to cost + * + * @generated from protobuf field: uint64 max_gas = 3; + */ + maxGas: bigint; + /** + * A key-value store associating a hash to arbitrary bytes + * + * @generated from protobuf field: repeated massa.model.v1.BytesMapFieldEntry datastore = 4; + */ + datastore: BytesMapFieldEntry[]; +} +/** + * Calls an exported function from a stored smart contract + * + * @generated from protobuf message massa.model.v1.CallSC + */ +export interface CallSC { + /** + * Target smart contract address + * + * @generated from protobuf field: string target_address = 1; + */ + targetAddress: string; + /** + * Target function name. No function is called if empty + * + * @generated from protobuf field: string target_function = 2; + */ + targetFunction: string; + /** + * Parameter to pass to the target function + * + * @generated from protobuf field: bytes parameter = 3; + */ + parameter: Uint8Array; + /** + * The maximum amount of gas that the execution of the contract is allowed to cost + * + * @generated from protobuf field: uint64 max_gas = 4; + */ + maxGas: bigint; + /** + * Extra coins that are spent from the caller's balance and transferred to the target + * + * @generated from protobuf field: massa.model.v1.NativeAmount coins = 5; + */ + coins?: NativeAmount; +} +/** + * Signed operation + * + * @generated from protobuf message massa.model.v1.SignedOperation + */ +export interface SignedOperation { + /** + * Operation + * + * @generated from protobuf field: massa.model.v1.Operation content = 1; + */ + content?: Operation; + /** + * A cryptographically generated value using `serialized_data` and a public key. + * + * @generated from protobuf field: string signature = 2; + */ + signature: string; + /** + * The public-key component used in the generation of the signature + * + * @generated from protobuf field: string content_creator_pub_key = 3; + */ + contentCreatorPubKey: string; + /** + * Derived from the same public key used to generate the signature + * + * @generated from protobuf field: string content_creator_address = 4; + */ + contentCreatorAddress: string; + /** + * A secure hash of the non-malleable contents of a deterministic binary representation of the block header + * + * @generated from protobuf field: string secure_hash = 5; + */ + secureHash: string; + /** + * The size of the serialized operation in bytes + * + * @generated from protobuf field: uint64 serialized_size = 6; + */ + serializedSize: bigint; +} +/** + * A wrapper around an operation with its metadata + * + * @generated from protobuf message massa.model.v1.OperationWrapper + */ +export interface OperationWrapper { + /** + * The IDs of the blocks in which the operation appears + * + * @generated from protobuf field: repeated string block_ids = 1; + */ + blockIds: string[]; + /** + * The thread in which the operation can be included + * + * @generated from protobuf field: uint32 thread = 2; + */ + thread: number; + /** + * The operation object itself + * + * @generated from protobuf field: massa.model.v1.SignedOperation operation = 3; + */ + operation?: SignedOperation; +} +/** + * Information about an operation with its metadata + * + * @generated from protobuf message massa.model.v1.OperationInfo + */ +export interface OperationInfo { + /** + * The unique ID of the operation. + * + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * The IDs of the blocks in which the operation appears + * + * @generated from protobuf field: repeated string block_ids = 2; + */ + blockIds: string[]; + /** + * The thread in which the operation can be included + * + * @generated from protobuf field: uint32 thread = 3; + */ + thread: number; +} +/** + * OperationIds + * + * @generated from protobuf message massa.model.v1.OperationIds + */ +export interface OperationIds { + /** + * Operations ids + * + * @generated from protobuf field: repeated string operation_ids = 1; + */ + operationIds: string[]; +} +/** + * OpTypes + * + * @generated from protobuf message massa.model.v1.OpTypes + */ +export interface OpTypes { + /** + * Operations types + * + * @generated from protobuf field: repeated massa.model.v1.OpType op_types = 1; + */ + opTypes: OpType[]; +} +/** + * Operation type enum + * + * @generated from protobuf enum massa.model.v1.OpType + */ +export enum OpType { + /** + * Default enum value + * + * @generated from protobuf enum value: OP_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Transaction + * + * @generated from protobuf enum value: OP_TYPE_TRANSACTION = 1; + */ + TRANSACTION = 1, + /** + * Roll buy + * + * @generated from protobuf enum value: OP_TYPE_ROLL_BUY = 2; + */ + ROLL_BUY = 2, + /** + * Roll sell + * + * @generated from protobuf enum value: OP_TYPE_ROLL_SELL = 3; + */ + ROLL_SELL = 3, + /** + * Execute smart contract + * + * @generated from protobuf enum value: OP_TYPE_EXECUTE_SC = 4; + */ + EXECUTE_SC = 4, + /** + * Call smart contract + * + * @generated from protobuf enum value: OP_TYPE_CALL_SC = 5; + */ + CALL_SC = 5, +} +// @generated message type with reflection information, may provide speed optimized methods +class Operation$Type extends MessageType { + constructor() { + super('massa.model.v1.Operation', [ + { no: 1, name: 'fee', kind: 'message', T: () => NativeAmount }, + { + no: 2, + name: 'expire_period', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 3, name: 'op', kind: 'message', T: () => OperationType }, + ]); + } + create(value?: PartialMessage): Operation { + const message = { expirePeriod: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Operation, + ): Operation { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeAmount fee */ 1: + message.fee = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.fee, + ); + break; + case /* uint64 expire_period */ 2: + message.expirePeriod = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.OperationType op */ 3: + message.op = OperationType.internalBinaryRead( + reader, + reader.uint32(), + options, + message.op, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Operation, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeAmount fee = 1; */ + if (message.fee) + NativeAmount.internalBinaryWrite( + message.fee, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 expire_period = 2; */ + if (message.expirePeriod !== 0n) + writer.tag(2, WireType.Varint).uint64(message.expirePeriod); + /* massa.model.v1.OperationType op = 3; */ + if (message.op) + OperationType.internalBinaryWrite( + message.op, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Operation + */ +export const Operation = new Operation$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OperationType$Type extends MessageType { + constructor() { + super('massa.model.v1.OperationType', [ + { + no: 1, + name: 'transaction', + kind: 'message', + oneof: 'type', + T: () => Transaction, + }, + { + no: 2, + name: 'roll_buy', + kind: 'message', + oneof: 'type', + T: () => RollBuy, + }, + { + no: 3, + name: 'roll_sell', + kind: 'message', + oneof: 'type', + T: () => RollSell, + }, + { + no: 4, + name: 'execut_sc', + kind: 'message', + oneof: 'type', + T: () => ExecuteSC, + }, + { + no: 5, + name: 'call_sc', + kind: 'message', + oneof: 'type', + T: () => CallSC, + }, + ]); + } + create(value?: PartialMessage): OperationType { + const message = { type: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OperationType, + ): OperationType { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Transaction transaction */ 1: + message.type = { + oneofKind: 'transaction', + transaction: Transaction.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.type as any).transaction, + ), + }; + break; + case /* massa.model.v1.RollBuy roll_buy */ 2: + message.type = { + oneofKind: 'rollBuy', + rollBuy: RollBuy.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.type as any).rollBuy, + ), + }; + break; + case /* massa.model.v1.RollSell roll_sell */ 3: + message.type = { + oneofKind: 'rollSell', + rollSell: RollSell.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.type as any).rollSell, + ), + }; + break; + case /* massa.model.v1.ExecuteSC execut_sc */ 4: + message.type = { + oneofKind: 'executSc', + executSc: ExecuteSC.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.type as any).executSc, + ), + }; + break; + case /* massa.model.v1.CallSC call_sc */ 5: + message.type = { + oneofKind: 'callSc', + callSc: CallSC.internalBinaryRead( + reader, + reader.uint32(), + options, + (message.type as any).callSc, + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OperationType, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Transaction transaction = 1; */ + if (message.type.oneofKind === 'transaction') + Transaction.internalBinaryWrite( + message.type.transaction, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.RollBuy roll_buy = 2; */ + if (message.type.oneofKind === 'rollBuy') + RollBuy.internalBinaryWrite( + message.type.rollBuy, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.RollSell roll_sell = 3; */ + if (message.type.oneofKind === 'rollSell') + RollSell.internalBinaryWrite( + message.type.rollSell, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.ExecuteSC execut_sc = 4; */ + if (message.type.oneofKind === 'executSc') + ExecuteSC.internalBinaryWrite( + message.type.executSc, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.CallSC call_sc = 5; */ + if (message.type.oneofKind === 'callSc') + CallSC.internalBinaryWrite( + message.type.callSc, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.OperationType + */ +export const OperationType = new OperationType$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Transaction$Type extends MessageType { + constructor() { + super('massa.model.v1.Transaction', [ + { + no: 1, + name: 'recipient_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 2, name: 'amount', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): Transaction { + const message = { recipientAddress: '' }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Transaction, + ): Transaction { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string recipient_address */ 1: + message.recipientAddress = reader.string(); + break; + case /* massa.model.v1.NativeAmount amount */ 2: + message.amount = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.amount, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Transaction, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string recipient_address = 1; */ + if (message.recipientAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.recipientAddress); + /* massa.model.v1.NativeAmount amount = 2; */ + if (message.amount) + NativeAmount.internalBinaryWrite( + message.amount, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Transaction + */ +export const Transaction = new Transaction$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RollBuy$Type extends MessageType { + constructor() { + super('massa.model.v1.RollBuy', [ + { + no: 1, + name: 'roll_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): RollBuy { + const message = { rollCount: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RollBuy, + ): RollBuy { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 roll_count */ 1: + message.rollCount = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: RollBuy, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 roll_count = 1; */ + if (message.rollCount !== 0n) + writer.tag(1, WireType.Varint).uint64(message.rollCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.RollBuy + */ +export const RollBuy = new RollBuy$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RollSell$Type extends MessageType { + constructor() { + super('massa.model.v1.RollSell', [ + { + no: 1, + name: 'roll_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): RollSell { + const message = { rollCount: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: RollSell, + ): RollSell { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 roll_count */ 1: + message.rollCount = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: RollSell, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 roll_count = 1; */ + if (message.rollCount !== 0n) + writer.tag(1, WireType.Varint).uint64(message.rollCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.RollSell + */ +export const RollSell = new RollSell$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecuteSC$Type extends MessageType { + constructor() { + super('massa.model.v1.ExecuteSC', [ + { no: 1, name: 'data', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { + no: 2, + name: 'max_coins', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 3, + name: 'max_gas', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 4, + name: 'datastore', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => BytesMapFieldEntry, + }, + ]); + } + create(value?: PartialMessage): ExecuteSC { + const message = { + data: new Uint8Array(0), + maxCoins: 0n, + maxGas: 0n, + datastore: [], + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecuteSC, + ): ExecuteSC { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes data */ 1: + message.data = reader.bytes(); + break; + case /* uint64 max_coins */ 2: + message.maxCoins = reader.uint64().toBigInt(); + break; + case /* uint64 max_gas */ 3: + message.maxGas = reader.uint64().toBigInt(); + break; + case /* repeated massa.model.v1.BytesMapFieldEntry datastore */ 4: + message.datastore.push( + BytesMapFieldEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecuteSC, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* bytes data = 1; */ + if (message.data.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.data); + /* uint64 max_coins = 2; */ + if (message.maxCoins !== 0n) + writer.tag(2, WireType.Varint).uint64(message.maxCoins); + /* uint64 max_gas = 3; */ + if (message.maxGas !== 0n) + writer.tag(3, WireType.Varint).uint64(message.maxGas); + /* repeated massa.model.v1.BytesMapFieldEntry datastore = 4; */ + for (let i = 0; i < message.datastore.length; i++) + BytesMapFieldEntry.internalBinaryWrite( + message.datastore[i], + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ExecuteSC + */ +export const ExecuteSC = new ExecuteSC$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CallSC$Type extends MessageType { + constructor() { + super('massa.model.v1.CallSC', [ + { + no: 1, + name: 'target_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 2, + name: 'target_function', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { no: 3, name: 'parameter', kind: 'scalar', T: 12 /* ScalarType.BYTES*/ }, + { + no: 4, + name: 'max_gas', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 5, name: 'coins', kind: 'message', T: () => NativeAmount }, + ]); + } + create(value?: PartialMessage): CallSC { + const message = { + targetAddress: '', + targetFunction: '', + parameter: new Uint8Array(0), + maxGas: 0n, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: CallSC, + ): CallSC { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string target_address */ 1: + message.targetAddress = reader.string(); + break; + case /* string target_function */ 2: + message.targetFunction = reader.string(); + break; + case /* bytes parameter */ 3: + message.parameter = reader.bytes(); + break; + case /* uint64 max_gas */ 4: + message.maxGas = reader.uint64().toBigInt(); + break; + case /* massa.model.v1.NativeAmount coins */ 5: + message.coins = NativeAmount.internalBinaryRead( + reader, + reader.uint32(), + options, + message.coins, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: CallSC, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string target_address = 1; */ + if (message.targetAddress !== '') + writer.tag(1, WireType.LengthDelimited).string(message.targetAddress); + /* string target_function = 2; */ + if (message.targetFunction !== '') + writer.tag(2, WireType.LengthDelimited).string(message.targetFunction); + /* bytes parameter = 3; */ + if (message.parameter.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.parameter); + /* uint64 max_gas = 4; */ + if (message.maxGas !== 0n) + writer.tag(4, WireType.Varint).uint64(message.maxGas); + /* massa.model.v1.NativeAmount coins = 5; */ + if (message.coins) + NativeAmount.internalBinaryWrite( + message.coins, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.CallSC + */ +export const CallSC = new CallSC$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignedOperation$Type extends MessageType { + constructor() { + super('massa.model.v1.SignedOperation', [ + { no: 1, name: 'content', kind: 'message', T: () => Operation }, + { no: 2, name: 'signature', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 3, + name: 'content_creator_pub_key', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 4, + name: 'content_creator_address', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 5, + name: 'secure_hash', + kind: 'scalar', + T: 9 /* ScalarType.STRING*/, + }, + { + no: 6, + name: 'serialized_size', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): SignedOperation { + const message = { + signature: '', + contentCreatorPubKey: '', + contentCreatorAddress: '', + secureHash: '', + serializedSize: 0n, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SignedOperation, + ): SignedOperation { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Operation content */ 1: + message.content = Operation.internalBinaryRead( + reader, + reader.uint32(), + options, + message.content, + ); + break; + case /* string signature */ 2: + message.signature = reader.string(); + break; + case /* string content_creator_pub_key */ 3: + message.contentCreatorPubKey = reader.string(); + break; + case /* string content_creator_address */ 4: + message.contentCreatorAddress = reader.string(); + break; + case /* string secure_hash */ 5: + message.secureHash = reader.string(); + break; + case /* uint64 serialized_size */ 6: + message.serializedSize = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SignedOperation, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Operation content = 1; */ + if (message.content) + Operation.internalBinaryWrite( + message.content, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* string signature = 2; */ + if (message.signature !== '') + writer.tag(2, WireType.LengthDelimited).string(message.signature); + /* string content_creator_pub_key = 3; */ + if (message.contentCreatorPubKey !== '') + writer + .tag(3, WireType.LengthDelimited) + .string(message.contentCreatorPubKey); + /* string content_creator_address = 4; */ + if (message.contentCreatorAddress !== '') + writer + .tag(4, WireType.LengthDelimited) + .string(message.contentCreatorAddress); + /* string secure_hash = 5; */ + if (message.secureHash !== '') + writer.tag(5, WireType.LengthDelimited).string(message.secureHash); + /* uint64 serialized_size = 6; */ + if (message.serializedSize !== 0n) + writer.tag(6, WireType.Varint).uint64(message.serializedSize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SignedOperation + */ +export const SignedOperation = new SignedOperation$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OperationWrapper$Type extends MessageType { + constructor() { + super('massa.model.v1.OperationWrapper', [ + { + no: 1, + name: 'block_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { no: 2, name: 'thread', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + { no: 3, name: 'operation', kind: 'message', T: () => SignedOperation }, + ]); + } + create(value?: PartialMessage): OperationWrapper { + const message = { blockIds: [], thread: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OperationWrapper, + ): OperationWrapper { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string block_ids */ 1: + message.blockIds.push(reader.string()); + break; + case /* uint32 thread */ 2: + message.thread = reader.uint32(); + break; + case /* massa.model.v1.SignedOperation operation */ 3: + message.operation = SignedOperation.internalBinaryRead( + reader, + reader.uint32(), + options, + message.operation, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OperationWrapper, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string block_ids = 1; */ + for (let i = 0; i < message.blockIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.blockIds[i]); + /* uint32 thread = 2; */ + if (message.thread !== 0) + writer.tag(2, WireType.Varint).uint32(message.thread); + /* massa.model.v1.SignedOperation operation = 3; */ + if (message.operation) + SignedOperation.internalBinaryWrite( + message.operation, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.OperationWrapper + */ +export const OperationWrapper = new OperationWrapper$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OperationInfo$Type extends MessageType { + constructor() { + super('massa.model.v1.OperationInfo', [ + { no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'block_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + { no: 3, name: 'thread', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + ]); + } + create(value?: PartialMessage): OperationInfo { + const message = { id: '', blockIds: [], thread: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OperationInfo, + ): OperationInfo { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* repeated string block_ids */ 2: + message.blockIds.push(reader.string()); + break; + case /* uint32 thread */ 3: + message.thread = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OperationInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string id = 1; */ + if (message.id !== '') + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* repeated string block_ids = 2; */ + for (let i = 0; i < message.blockIds.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.blockIds[i]); + /* uint32 thread = 3; */ + if (message.thread !== 0) + writer.tag(3, WireType.Varint).uint32(message.thread); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.OperationInfo + */ +export const OperationInfo = new OperationInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OperationIds$Type extends MessageType { + constructor() { + super('massa.model.v1.OperationIds', [ + { + no: 1, + name: 'operation_ids', + kind: 'scalar', + repeat: 2 /* RepeatType.UNPACKED*/, + T: 9 /* ScalarType.STRING*/, + }, + ]); + } + create(value?: PartialMessage): OperationIds { + const message = { operationIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OperationIds, + ): OperationIds { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string operation_ids */ 1: + message.operationIds.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OperationIds, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated string operation_ids = 1; */ + for (let i = 0; i < message.operationIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.operationIds[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.OperationIds + */ +export const OperationIds = new OperationIds$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OpTypes$Type extends MessageType { + constructor() { + super('massa.model.v1.OpTypes', [ + { + no: 1, + name: 'op_types', + kind: 'enum', + repeat: 1 /* RepeatType.PACKED*/, + T: () => ['massa.model.v1.OpType', OpType, 'OP_TYPE_'], + }, + ]); + } + create(value?: PartialMessage): OpTypes { + const message = { opTypes: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: OpTypes, + ): OpTypes { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.OpType op_types */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e; ) + message.opTypes.push(reader.int32()); + else message.opTypes.push(reader.int32()); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: OpTypes, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.OpType op_types = 1; */ + if (message.opTypes.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.opTypes.length; i++) + writer.int32(message.opTypes[i]); + writer.join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.OpTypes + */ +export const OpTypes = new OpTypes$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/slot.ts b/frontend/src/proto-gen/massa/model/v1/slot.ts new file mode 100644 index 0000000..791d96c --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/slot.ts @@ -0,0 +1,445 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/slot.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * When an address is drawn to create an endorsement it is selected for a specific index + * + * @generated from protobuf message massa.model.v1.IndexedSlot + */ +export interface IndexedSlot { + /** + * Slot + * + * @generated from protobuf field: massa.model.v1.Slot slot = 1; + */ + slot?: Slot; + /** + * Endorsement index in the slot + * + * @generated from protobuf field: uint64 index = 2; + */ + index: bigint; +} +/** + * A point in time where a block is expected + * + * @generated from protobuf message massa.model.v1.Slot + */ +export interface Slot { + /** + * Period + * + * @generated from protobuf field: uint64 period = 1; + */ + period: bigint; + /** + * Thread + * + * @generated from protobuf field: uint32 thread = 2; + */ + thread: number; +} +/** + * Slots + * + * @generated from protobuf message massa.model.v1.Slots + */ +export interface Slots { + /** + * Slots + * + * @generated from protobuf field: repeated massa.model.v1.Slot slots = 1; + */ + slots: Slot[]; +} +/** + * SlotRange + * + * @generated from protobuf message massa.model.v1.SlotRange + */ +export interface SlotRange { + /** + * Start lot (Optional) + * + * @generated from protobuf field: massa.model.v1.Slot start_slot = 1; + */ + startSlot?: Slot; + /** + * End slot (Optional) + * + * @generated from protobuf field: massa.model.v1.Slot end_slot = 2; + */ + endSlot?: Slot; +} +// @generated message type with reflection information, may provide speed optimized methods +class IndexedSlot$Type extends MessageType { + constructor() { + super('massa.model.v1.IndexedSlot', [ + { no: 1, name: 'slot', kind: 'message', T: () => Slot }, + { + no: 2, + name: 'index', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): IndexedSlot { + const message = { index: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: IndexedSlot, + ): IndexedSlot { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot slot */ 1: + message.slot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.slot, + ); + break; + case /* uint64 index */ 2: + message.index = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: IndexedSlot, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot slot = 1; */ + if (message.slot) + Slot.internalBinaryWrite( + message.slot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 index = 2; */ + if (message.index !== 0n) + writer.tag(2, WireType.Varint).uint64(message.index); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.IndexedSlot + */ +export const IndexedSlot = new IndexedSlot$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Slot$Type extends MessageType { + constructor() { + super('massa.model.v1.Slot', [ + { + no: 1, + name: 'period', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { no: 2, name: 'thread', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + ]); + } + create(value?: PartialMessage): Slot { + const message = { period: 0n, thread: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Slot, + ): Slot { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 period */ 1: + message.period = reader.uint64().toBigInt(); + break; + case /* uint32 thread */ 2: + message.thread = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Slot, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 period = 1; */ + if (message.period !== 0n) + writer.tag(1, WireType.Varint).uint64(message.period); + /* uint32 thread = 2; */ + if (message.thread !== 0) + writer.tag(2, WireType.Varint).uint32(message.thread); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Slot + */ +export const Slot = new Slot$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Slots$Type extends MessageType { + constructor() { + super('massa.model.v1.Slots', [ + { + no: 1, + name: 'slots', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => Slot, + }, + ]); + } + create(value?: PartialMessage): Slots { + const message = { slots: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: Slots, + ): Slots { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated massa.model.v1.Slot slots */ 1: + message.slots.push( + Slot.internalBinaryRead(reader, reader.uint32(), options), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: Slots, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* repeated massa.model.v1.Slot slots = 1; */ + for (let i = 0; i < message.slots.length; i++) + Slot.internalBinaryWrite( + message.slots[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.Slots + */ +export const Slots = new Slots$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SlotRange$Type extends MessageType { + constructor() { + super('massa.model.v1.SlotRange', [ + { no: 1, name: 'start_slot', kind: 'message', T: () => Slot }, + { no: 2, name: 'end_slot', kind: 'message', T: () => Slot }, + ]); + } + create(value?: PartialMessage): SlotRange { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: SlotRange, + ): SlotRange { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.Slot start_slot */ 1: + message.startSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.startSlot, + ); + break; + case /* massa.model.v1.Slot end_slot */ 2: + message.endSlot = Slot.internalBinaryRead( + reader, + reader.uint32(), + options, + message.endSlot, + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: SlotRange, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.Slot start_slot = 1; */ + if (message.startSlot) + Slot.internalBinaryWrite( + message.startSlot, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.Slot end_slot = 2; */ + if (message.endSlot) + Slot.internalBinaryWrite( + message.endSlot, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.SlotRange + */ +export const SlotRange = new SlotRange$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/staker.ts b/frontend/src/proto-gen/massa/model/v1/staker.ts new file mode 100644 index 0000000..9e41182 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/staker.ts @@ -0,0 +1,120 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/staker.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * StakerEntry + * + * @generated from protobuf message massa.model.v1.StakerEntry + */ +export interface StakerEntry { + /** + * Address + * + * @generated from protobuf field: string address = 1; + */ + address: string; + /** + * Rolls + * + * @generated from protobuf field: uint64 rolls = 2; + */ + rolls: bigint; +} +// @generated message type with reflection information, may provide speed optimized methods +class StakerEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.StakerEntry', [ + { no: 1, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { + no: 2, + name: 'rolls', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): StakerEntry { + const message = { address: '', rolls: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: StakerEntry, + ): StakerEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + case /* uint64 rolls */ 2: + message.rolls = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: StakerEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string address = 1; */ + if (message.address !== '') + writer.tag(1, WireType.LengthDelimited).string(message.address); + /* uint64 rolls = 2; */ + if (message.rolls !== 0n) + writer.tag(2, WireType.Varint).uint64(message.rolls); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.StakerEntry + */ +export const StakerEntry = new StakerEntry$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/stats.ts b/frontend/src/proto-gen/massa/model/v1/stats.ts new file mode 100644 index 0000000..d47c5d3 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/stats.ts @@ -0,0 +1,638 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/stats.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { NativeTime } from './time'; +/** + * Consensus statistics + * + * @generated from protobuf message massa.model.v1.ConsensusStats + */ +export interface ConsensusStats { + /** + * Start of the time span for stats + * + * @generated from protobuf field: massa.model.v1.NativeTime start_timespan = 1; + */ + startTimespan?: NativeTime; + /** + * End of the time span for stats + * + * @generated from protobuf field: massa.model.v1.NativeTime end_timespan = 2; + */ + endTimespan?: NativeTime; + /** + * Number of final blocks + * + * @generated from protobuf field: uint64 final_block_count = 3; + */ + finalBlockCount: bigint; + /** + * Number of stale blocks in memory + * + * @generated from protobuf field: uint64 stale_block_count = 4; + */ + staleBlockCount: bigint; + /** + * Number of actives cliques + * + * @generated from protobuf field: uint64 clique_count = 5; + */ + cliqueCount: bigint; +} +/** + * Pool statistics + * + * @generated from protobuf message massa.model.v1.PoolStats + */ +export interface PoolStats { + /** + * Endorsements + * + * @generated from protobuf field: uint64 endorsements_count = 1; + */ + endorsementsCount: bigint; + /** + * Operations + * + * @generated from protobuf field: uint64 operations_count = 2; + */ + operationsCount: bigint; +} +/** + * Network statistics + * + * @generated from protobuf message massa.model.v1.NetworkStats + */ +export interface NetworkStats { + /** + * In connections count + * + * @generated from protobuf field: uint64 in_connection_count = 1; + */ + inConnectionCount: bigint; + /** + * Out connections count + * + * @generated from protobuf field: uint64 out_connection_count = 2; + */ + outConnectionCount: bigint; + /** + * Total known peers count + * + * @generated from protobuf field: uint64 known_peer_count = 3; + */ + knownPeerCount: bigint; + /** + * Banned node count + * + * @generated from protobuf field: uint64 banned_peer_count = 4; + */ + bannedPeerCount: bigint; + /** + * Active node count + * + * @generated from protobuf field: uint64 active_node_count = 5; + */ + activeNodeCount: bigint; +} +/** + * Execution statistics + * + * @generated from protobuf message massa.model.v1.ExecutionStats + */ +export interface ExecutionStats { + /** + * Time window start + * + * @generated from protobuf field: massa.model.v1.NativeTime time_window_start = 1; + */ + timeWindowStart?: NativeTime; + /** + * Time window end + * + * @generated from protobuf field: massa.model.v1.NativeTime time_window_end = 2; + */ + timeWindowEnd?: NativeTime; + /** + * Number of final blocks in the time window + * + * @generated from protobuf field: uint64 final_block_count = 3; + */ + finalBlockCount: bigint; + /** + * Number of final executed operations in the time window + * + * @generated from protobuf field: uint64 final_executed_operations_count = 4; + */ + finalExecutedOperationsCount: bigint; +} +// @generated message type with reflection information, may provide speed optimized methods +class ConsensusStats$Type extends MessageType { + constructor() { + super('massa.model.v1.ConsensusStats', [ + { no: 1, name: 'start_timespan', kind: 'message', T: () => NativeTime }, + { no: 2, name: 'end_timespan', kind: 'message', T: () => NativeTime }, + { + no: 3, + name: 'final_block_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 4, + name: 'stale_block_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 5, + name: 'clique_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): ConsensusStats { + const message = { + finalBlockCount: 0n, + staleBlockCount: 0n, + cliqueCount: 0n, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ConsensusStats, + ): ConsensusStats { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime start_timespan */ 1: + message.startTimespan = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.startTimespan, + ); + break; + case /* massa.model.v1.NativeTime end_timespan */ 2: + message.endTimespan = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.endTimespan, + ); + break; + case /* uint64 final_block_count */ 3: + message.finalBlockCount = reader.uint64().toBigInt(); + break; + case /* uint64 stale_block_count */ 4: + message.staleBlockCount = reader.uint64().toBigInt(); + break; + case /* uint64 clique_count */ 5: + message.cliqueCount = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ConsensusStats, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime start_timespan = 1; */ + if (message.startTimespan) + NativeTime.internalBinaryWrite( + message.startTimespan, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime end_timespan = 2; */ + if (message.endTimespan) + NativeTime.internalBinaryWrite( + message.endTimespan, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 final_block_count = 3; */ + if (message.finalBlockCount !== 0n) + writer.tag(3, WireType.Varint).uint64(message.finalBlockCount); + /* uint64 stale_block_count = 4; */ + if (message.staleBlockCount !== 0n) + writer.tag(4, WireType.Varint).uint64(message.staleBlockCount); + /* uint64 clique_count = 5; */ + if (message.cliqueCount !== 0n) + writer.tag(5, WireType.Varint).uint64(message.cliqueCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ConsensusStats + */ +export const ConsensusStats = new ConsensusStats$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PoolStats$Type extends MessageType { + constructor() { + super('massa.model.v1.PoolStats', [ + { + no: 1, + name: 'endorsements_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 2, + name: 'operations_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): PoolStats { + const message = { endorsementsCount: 0n, operationsCount: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: PoolStats, + ): PoolStats { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 endorsements_count */ 1: + message.endorsementsCount = reader.uint64().toBigInt(); + break; + case /* uint64 operations_count */ 2: + message.operationsCount = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: PoolStats, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 endorsements_count = 1; */ + if (message.endorsementsCount !== 0n) + writer.tag(1, WireType.Varint).uint64(message.endorsementsCount); + /* uint64 operations_count = 2; */ + if (message.operationsCount !== 0n) + writer.tag(2, WireType.Varint).uint64(message.operationsCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.PoolStats + */ +export const PoolStats = new PoolStats$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NetworkStats$Type extends MessageType { + constructor() { + super('massa.model.v1.NetworkStats', [ + { + no: 1, + name: 'in_connection_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 2, + name: 'out_connection_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 3, + name: 'known_peer_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 4, + name: 'banned_peer_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 5, + name: 'active_node_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): NetworkStats { + const message = { + inConnectionCount: 0n, + outConnectionCount: 0n, + knownPeerCount: 0n, + bannedPeerCount: 0n, + activeNodeCount: 0n, + }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NetworkStats, + ): NetworkStats { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 in_connection_count */ 1: + message.inConnectionCount = reader.uint64().toBigInt(); + break; + case /* uint64 out_connection_count */ 2: + message.outConnectionCount = reader.uint64().toBigInt(); + break; + case /* uint64 known_peer_count */ 3: + message.knownPeerCount = reader.uint64().toBigInt(); + break; + case /* uint64 banned_peer_count */ 4: + message.bannedPeerCount = reader.uint64().toBigInt(); + break; + case /* uint64 active_node_count */ 5: + message.activeNodeCount = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NetworkStats, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 in_connection_count = 1; */ + if (message.inConnectionCount !== 0n) + writer.tag(1, WireType.Varint).uint64(message.inConnectionCount); + /* uint64 out_connection_count = 2; */ + if (message.outConnectionCount !== 0n) + writer.tag(2, WireType.Varint).uint64(message.outConnectionCount); + /* uint64 known_peer_count = 3; */ + if (message.knownPeerCount !== 0n) + writer.tag(3, WireType.Varint).uint64(message.knownPeerCount); + /* uint64 banned_peer_count = 4; */ + if (message.bannedPeerCount !== 0n) + writer.tag(4, WireType.Varint).uint64(message.bannedPeerCount); + /* uint64 active_node_count = 5; */ + if (message.activeNodeCount !== 0n) + writer.tag(5, WireType.Varint).uint64(message.activeNodeCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.NetworkStats + */ +export const NetworkStats = new NetworkStats$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExecutionStats$Type extends MessageType { + constructor() { + super('massa.model.v1.ExecutionStats', [ + { + no: 1, + name: 'time_window_start', + kind: 'message', + T: () => NativeTime, + }, + { no: 2, name: 'time_window_end', kind: 'message', T: () => NativeTime }, + { + no: 3, + name: 'final_block_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + { + no: 4, + name: 'final_executed_operations_count', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): ExecutionStats { + const message = { finalBlockCount: 0n, finalExecutedOperationsCount: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: ExecutionStats, + ): ExecutionStats { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.NativeTime time_window_start */ 1: + message.timeWindowStart = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.timeWindowStart, + ); + break; + case /* massa.model.v1.NativeTime time_window_end */ 2: + message.timeWindowEnd = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.timeWindowEnd, + ); + break; + case /* uint64 final_block_count */ 3: + message.finalBlockCount = reader.uint64().toBigInt(); + break; + case /* uint64 final_executed_operations_count */ 4: + message.finalExecutedOperationsCount = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: ExecutionStats, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.NativeTime time_window_start = 1; */ + if (message.timeWindowStart) + NativeTime.internalBinaryWrite( + message.timeWindowStart, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime time_window_end = 2; */ + if (message.timeWindowEnd) + NativeTime.internalBinaryWrite( + message.timeWindowEnd, + writer.tag(2, WireType.LengthDelimited).fork(), + options, + ).join(); + /* uint64 final_block_count = 3; */ + if (message.finalBlockCount !== 0n) + writer.tag(3, WireType.Varint).uint64(message.finalBlockCount); + /* uint64 final_executed_operations_count = 4; */ + if (message.finalExecutedOperationsCount !== 0n) + writer + .tag(4, WireType.Varint) + .uint64(message.finalExecutedOperationsCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.ExecutionStats + */ +export const ExecutionStats = new ExecutionStats$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/time.ts b/frontend/src/proto-gen/massa/model/v1/time.ts new file mode 100644 index 0000000..a45fcf8 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/time.ts @@ -0,0 +1,107 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/time.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +/** + * NativeTime represents a native duration or unix timestamp + * + * @generated from protobuf message massa.model.v1.NativeTime + */ +export interface NativeTime { + /** + * Milliseconds + * + * @generated from protobuf field: uint64 milliseconds = 1; + */ + milliseconds: bigint; +} +// @generated message type with reflection information, may provide speed optimized methods +class NativeTime$Type extends MessageType { + constructor() { + super('massa.model.v1.NativeTime', [ + { + no: 1, + name: 'milliseconds', + kind: 'scalar', + T: 4 /* ScalarType.UINT64*/, + L: 0 /* LongType.BIGINT*/, + }, + ]); + } + create(value?: PartialMessage): NativeTime { + const message = { milliseconds: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: NativeTime, + ): NativeTime { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 milliseconds */ 1: + message.milliseconds = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: NativeTime, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* uint64 milliseconds = 1; */ + if (message.milliseconds !== 0n) + writer.tag(1, WireType.Varint).uint64(message.milliseconds); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.NativeTime + */ +export const NativeTime = new NativeTime$Type(); diff --git a/frontend/src/proto-gen/massa/model/v1/versioning.ts b/frontend/src/proto-gen/massa/model/v1/versioning.ts new file mode 100644 index 0000000..e4350a6 --- /dev/null +++ b/frontend/src/proto-gen/massa/model/v1/versioning.ts @@ -0,0 +1,506 @@ +// @generated by protobuf-ts 2.9.1 with parameter generate_dependencies +// @generated from protobuf file "massa/model/v1/versioning.proto" (package "massa.model.v1", syntax proto3) +// tslint:disable +// +// Copyright (c) 2023 MASSA LABS +// +import type { BinaryWriteOptions } from '@protobuf-ts/runtime'; +import type { IBinaryWriter } from '@protobuf-ts/runtime'; +import { WireType } from '@protobuf-ts/runtime'; +import type { BinaryReadOptions } from '@protobuf-ts/runtime'; +import type { IBinaryReader } from '@protobuf-ts/runtime'; +import { UnknownFieldHandler } from '@protobuf-ts/runtime'; +import type { PartialMessage } from '@protobuf-ts/runtime'; +import { reflectionMergePartial } from '@protobuf-ts/runtime'; +import { MESSAGE_TYPE } from '@protobuf-ts/runtime'; +import { MessageType } from '@protobuf-ts/runtime'; +import { NativeTime } from './time'; +/** + * Entry for GetMipStatusResponse + * + * @generated from protobuf message massa.model.v1.MipStatusEntry + */ +export interface MipStatusEntry { + /** + * Mip info + * + * @generated from protobuf field: massa.model.v1.MipInfo mip_info = 1; + */ + mipInfo?: MipInfo; + /** + * State id + * + * @generated from protobuf field: massa.model.v1.ComponentStateId state_id = 2; + */ + stateId: ComponentStateId; +} +/** + * MIP info (name & versions & time range for a MIP) + * + * @generated from protobuf message massa.model.v1.MipInfo + */ +export interface MipInfo { + /** + * MIP name or descriptive name + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * Network (or global) version (to be included in block header) + * + * @generated from protobuf field: uint32 version = 2; + */ + version: number; + /** + * A timestamp at which the version gains its meaning (e.g. announced in block header) + * + * @generated from protobuf field: massa.model.v1.NativeTime start = 3; + */ + start?: NativeTime; + /** + * A timestamp at the which the deployment is considered failed + * + * @generated from protobuf field: massa.model.v1.NativeTime timeout = 4; + */ + timeout?: NativeTime; + /** + * Once deployment has been locked, wait for this duration before deployment is considered active + * + * @generated from protobuf field: massa.model.v1.NativeTime activation_delay = 5; + */ + activationDelay?: NativeTime; + /** + * Components concerned by this versioning (e.g. a new Block version), and the associated component_version + * + * @generated from protobuf field: repeated massa.model.v1.MipComponentEntry components = 6; + */ + components: MipComponentEntry[]; +} +/** + * MipComponentEntry + * + * @generated from protobuf message massa.model.v1.MipComponentEntry + */ +export interface MipComponentEntry { + /** + * Kind + * + * @generated from protobuf field: massa.model.v1.MipComponent kind = 1; + */ + kind: MipComponent; + /** + * Version + * + * @generated from protobuf field: uint32 version = 2; + */ + version: number; +} +/** + * State machine for a Versioning component that tracks the deployment state + * + * @generated from protobuf enum massa.model.v1.ComponentStateId + */ +export enum ComponentStateId { + /** + * Default enum value + * + * @generated from protobuf enum value: COMPONENT_STATE_ID_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Error state + * + * @generated from protobuf enum value: COMPONENT_STATE_ID_ERROR = 1; + */ + ERROR = 1, + /** + * Initial state + * + * @generated from protobuf enum value: COMPONENT_STATE_ID_DEFINED = 2; + */ + DEFINED = 2, + /** + * Past start, can only go to LockedIn after the threshold is above a given value + * + * @generated from protobuf enum value: COMPONENT_STATE_ID_STARTED = 3; + */ + STARTED = 3, + /** + * Locked but wait for some time before going to active (to let users the time to upgrade) + * + * @generated from protobuf enum value: COMPONENT_STATE_ID_LOCKEDIN = 4; + */ + LOCKEDIN = 4, + /** + * After LockedIn, deployment is considered successful (after activation delay) + * + * @generated from protobuf enum value: COMPONENT_STATE_ID_ACTIVE = 5; + */ + ACTIVE = 5, + /** + * Past the timeout, if LockedIn is not reach + * + * @generated from protobuf enum value: COMPONENT_STATE_ID_FAILED = 6; + */ + FAILED = 6, +} +/** + * Versioning component enum + * + * @generated from protobuf enum massa.model.v1.MipComponent + */ +export enum MipComponent { + /** + * Default enum value + * + * @generated from protobuf enum value: MIP_COMPONENT_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Address component + * + * @generated from protobuf enum value: MIP_COMPONENT_ADDRESS = 1; + */ + ADDRESS = 1, + /** + * Keypair component + * + * @generated from protobuf enum value: MIP_COMPONENT_KEYPAIR = 2; + */ + KEYPAIR = 2, +} +// @generated message type with reflection information, may provide speed optimized methods +class MipStatusEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.MipStatusEntry', [ + { no: 1, name: 'mip_info', kind: 'message', T: () => MipInfo }, + { + no: 2, + name: 'state_id', + kind: 'enum', + T: () => [ + 'massa.model.v1.ComponentStateId', + ComponentStateId, + 'COMPONENT_STATE_ID_', + ], + }, + ]); + } + create(value?: PartialMessage): MipStatusEntry { + const message = { stateId: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: MipStatusEntry, + ): MipStatusEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.MipInfo mip_info */ 1: + message.mipInfo = MipInfo.internalBinaryRead( + reader, + reader.uint32(), + options, + message.mipInfo, + ); + break; + case /* massa.model.v1.ComponentStateId state_id */ 2: + message.stateId = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: MipStatusEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.MipInfo mip_info = 1; */ + if (message.mipInfo) + MipInfo.internalBinaryWrite( + message.mipInfo, + writer.tag(1, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.ComponentStateId state_id = 2; */ + if (message.stateId !== 0) + writer.tag(2, WireType.Varint).int32(message.stateId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.MipStatusEntry + */ +export const MipStatusEntry = new MipStatusEntry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MipInfo$Type extends MessageType { + constructor() { + super('massa.model.v1.MipInfo', [ + { no: 1, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING*/ }, + { no: 2, name: 'version', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + { no: 3, name: 'start', kind: 'message', T: () => NativeTime }, + { no: 4, name: 'timeout', kind: 'message', T: () => NativeTime }, + { no: 5, name: 'activation_delay', kind: 'message', T: () => NativeTime }, + { + no: 6, + name: 'components', + kind: 'message', + repeat: 1 /* RepeatType.PACKED*/, + T: () => MipComponentEntry, + }, + ]); + } + create(value?: PartialMessage): MipInfo { + const message = { name: '', version: 0, components: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: MipInfo, + ): MipInfo { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* uint32 version */ 2: + message.version = reader.uint32(); + break; + case /* massa.model.v1.NativeTime start */ 3: + message.start = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.start, + ); + break; + case /* massa.model.v1.NativeTime timeout */ 4: + message.timeout = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.timeout, + ); + break; + case /* massa.model.v1.NativeTime activation_delay */ 5: + message.activationDelay = NativeTime.internalBinaryRead( + reader, + reader.uint32(), + options, + message.activationDelay, + ); + break; + case /* repeated massa.model.v1.MipComponentEntry components */ 6: + message.components.push( + MipComponentEntry.internalBinaryRead( + reader, + reader.uint32(), + options, + ), + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: MipInfo, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* string name = 1; */ + if (message.name !== '') + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* uint32 version = 2; */ + if (message.version !== 0) + writer.tag(2, WireType.Varint).uint32(message.version); + /* massa.model.v1.NativeTime start = 3; */ + if (message.start) + NativeTime.internalBinaryWrite( + message.start, + writer.tag(3, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime timeout = 4; */ + if (message.timeout) + NativeTime.internalBinaryWrite( + message.timeout, + writer.tag(4, WireType.LengthDelimited).fork(), + options, + ).join(); + /* massa.model.v1.NativeTime activation_delay = 5; */ + if (message.activationDelay) + NativeTime.internalBinaryWrite( + message.activationDelay, + writer.tag(5, WireType.LengthDelimited).fork(), + options, + ).join(); + /* repeated massa.model.v1.MipComponentEntry components = 6; */ + for (let i = 0; i < message.components.length; i++) + MipComponentEntry.internalBinaryWrite( + message.components[i], + writer.tag(6, WireType.LengthDelimited).fork(), + options, + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.MipInfo + */ +export const MipInfo = new MipInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MipComponentEntry$Type extends MessageType { + constructor() { + super('massa.model.v1.MipComponentEntry', [ + { + no: 1, + name: 'kind', + kind: 'enum', + T: () => [ + 'massa.model.v1.MipComponent', + MipComponent, + 'MIP_COMPONENT_', + ], + }, + { no: 2, name: 'version', kind: 'scalar', T: 13 /* ScalarType.UINT32*/ }, + ]); + } + create(value?: PartialMessage): MipComponentEntry { + const message = { kind: 0, version: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader: IBinaryReader, + length: number, + options: BinaryReadOptions, + target?: MipComponentEntry, + ): MipComponentEntry { + let message = target ?? this.create(); + let end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* massa.model.v1.MipComponent kind */ 1: + message.kind = reader.int32(); + break; + case /* uint32 version */ 2: + message.version = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`, + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d, + ); + } + } + return message; + } + internalBinaryWrite( + message: MipComponentEntry, + writer: IBinaryWriter, + options: BinaryWriteOptions, + ): IBinaryWriter { + /* massa.model.v1.MipComponent kind = 1; */ + if (message.kind !== 0) writer.tag(1, WireType.Varint).int32(message.kind); + /* uint32 version = 2; */ + if (message.version !== 0) + writer.tag(2, WireType.Varint).uint32(message.version); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer, + ); + return writer; + } +} +/** + * @generated MessageType for protobuf message massa.model.v1.MipComponentEntry + */ +export const MipComponentEntry = new MipComponentEntry$Type(); diff --git a/frontend/src/utils/grpc-client.tsx b/frontend/src/utils/grpc-client.tsx new file mode 100644 index 0000000..1083591 --- /dev/null +++ b/frontend/src/utils/grpc-client.tsx @@ -0,0 +1,16 @@ +// create a new grpc client and export a getCLient function +import { PublicServiceClient } from '../proto-gen/massa/api/v1/public.client'; +import { CHAIN_ID } from '@massalabs/massa-web3'; +import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'; + +const MAINNET_URL = 'http://mainnet.massa.net:33037'; +const BUILDNET_URL = 'http://buildnet-explorer.massa.net:33037'; + +export function getClient(chainId: bigint) { + let baseUrl = MAINNET_URL; + if (chainId === CHAIN_ID.BuildNet) { + baseUrl = BUILDNET_URL; + } + const transport = new GrpcWebFetchTransport({ baseUrl }); + return new PublicServiceClient(transport); +} diff --git a/frontend/src/utils/useGRPC.tsx b/frontend/src/utils/useGRPC.tsx new file mode 100644 index 0000000..2c635d3 --- /dev/null +++ b/frontend/src/utils/useGRPC.tsx @@ -0,0 +1,72 @@ +import { useAccountStore } from '../lib/connectMassaWallets/store'; +import { useState, useCallback } from 'react'; +import { getClient } from './grpc-client'; +import { + AddressDatastoreKeysCandidate, + QueryStateRequest, +} from '../proto-gen/massa/api/v1/public'; + +/** + * Custom hook to make gRPC calls to the AddressDatastoreKeysFinal function. + * + * @param {Object} grpcClient - The initialized gRPC client object. + * @returns {Object} - Contains loading state, error, data, and the call function. + */ +const useGRPC = () => { + const [loading, setLoading] = useState(false); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const [error, setError] = useState(null); + + const { chainId } = useAccountStore(); + + /** + * Function to make the gRPC call. + * @param {Object} request - The request payload to send to AddressDatastoreKeysFinal. + */ + const datastoreKeysCandidate = useCallback( + async (address: string, filter: Uint8Array = new Uint8Array()) => { + if (!chainId) { + return; + } + setLoading(true); + setError(null); + + try { + const client = getClient(chainId); + const addressDatastoreKeysCandidate = + AddressDatastoreKeysCandidate.create({ + address, + prefix: filter, + }); + console.log( + 'addressDatastoreKeysCandidate', + addressDatastoreKeysCandidate, + ); + + const request = QueryStateRequest.create({ + queries: [ + { + requestItem: { + oneofKind: 'addressDatastoreKeysCandidate', + addressDatastoreKeysCandidate, + }, + }, + ], + }); + + const { response } = await client.queryState(request); + console.log('response', response); + return response; + } catch (e) { + setError(e); + } finally { + setLoading(false); + } + }, + [chainId], + ); + + return { loading, error, datastoreKeysCandidate }; +}; + +export default useGRPC; diff --git a/frontend/src/utils/write-mns-sc.tsx b/frontend/src/utils/write-mns-sc.tsx index 7350ca1..2ede711 100644 --- a/frontend/src/utils/write-mns-sc.tsx +++ b/frontend/src/utils/write-mns-sc.tsx @@ -22,7 +22,7 @@ import { import { OperationToast } from '../lib/connectMassaWallets/components/OperationToast'; import { logSmartContractEvents } from '../lib/connectMassaWallets/utils'; import { useAccountStore } from '../lib/connectMassaWallets/store'; -import { isEqual } from 'lodash'; +import useGRPC from './useGRPC'; interface ToasterMessage { pending: string; @@ -77,7 +77,7 @@ function minBigInt(a: bigint, b: bigint) { return a < b ? a : b; } -function getScAddress(chainId: bigint | undefined) { +export function getScAddress(chainId: bigint | undefined) { switch (chainId) { case CHAIN_ID.BuildNet: return BUILDNET_SC_ADDRESS; @@ -93,10 +93,12 @@ export function useWriteMNS(client?: Client) { const [isSuccess, setIsSuccess] = useState(false); const [isError, setIsError] = useState(false); const [opId, setOpId] = useState(undefined); - const [list, setList] = useState([]); + const [domainsList, setDomainsList] = useState([]); const [listSpinning, setListSpinning] = useState(false); const { chainId } = useAccountStore(); + const { datastoreKeysCandidate } = useGRPC(); + async function getAllocCost( params: DnsAllocParams, ): Promise { @@ -349,21 +351,18 @@ export function useWriteMNS(client?: Client) { if (!resultBalance) { toast.error('Failed to get user entry list', { duration: 5000 }); setListSpinning(false); + setDomainsList([]); return []; } - let list: DnsUserEntryListResult[] = []; - - const addressInfo = await client?.publicApi().getAddresses([SC_ADDRESS]); - const filter = [ + const filter = Uint8Array.from([ ...strToBytes('ownedTokens'), ...strToBytes(params.address), - ]; - const ownedKeys = addressInfo?.[0].candidate_datastore_keys.filter( - (key) => { - return isEqual(key.slice(0, filter.length), filter); - }, - ); + ]); + + let list: DnsUserEntryListResult[] = []; + + const ownedKeys = await datastoreKeysCandidate(SC_ADDRESS, filter); if (ownedKeys) { const tokenIdsBytes = ownedKeys.map((key) => key.slice(filter.length)); @@ -420,7 +419,7 @@ export function useWriteMNS(client?: Client) { tokenId: tokenIds[index], })); } - setList(list); + setDomainsList(list); setListSpinning(false); return list; } @@ -478,7 +477,7 @@ export function useWriteMNS(client?: Client) { isPending, isSuccess, isError, - list, + domainsList, listSpinning, dnsAlloc, getAllocCost, diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index d0204cb..a3e4b2d 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -19,5 +19,6 @@ "noFallthroughCasesInSwitch": true }, "include": ["src"], + "exclude": ["src/proto-gen"], "references": [{ "path": "./tsconfig.node.json" }] }