From 747e91feacb43bfb7fdb2f10ed6227f115361997 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Wed, 7 Aug 2024 16:26:53 -0500 Subject: [PATCH] update ts client --- .../package-lock.json | 100 +- .../src/grpc/geyser.ts | 2287 +++++------------ .../src/grpc/solana-storage.ts | 945 +++---- 3 files changed, 1034 insertions(+), 2298 deletions(-) diff --git a/yellowstone-grpc-client-nodejs/package-lock.json b/yellowstone-grpc-client-nodejs/package-lock.json index 4bf73b70..e536ddfd 100644 --- a/yellowstone-grpc-client-nodejs/package-lock.json +++ b/yellowstone-grpc-client-nodejs/package-lock.json @@ -18,26 +18,27 @@ } }, "node_modules/@grpc/grpc-js": { - "version": "1.8.17", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.17.tgz", - "integrity": "sha512-DGuSbtMFbaRsyffMf+VEkVu8HkSXEUfO3UyGJNtqxW9ABdtTIA+2UXAJpwbJS+xfQxuwqLUeELmL6FuZkOqPxw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.11.1.tgz", + "integrity": "sha512-gyt/WayZrVPH2w/UTLansS7F9Nwld472JxxaETamrM8HNlsa+jSLNyKAZmhxI2Me4c3mQHFiS1wWHDY1g1Kthw==", + "license": "Apache-2.0", "dependencies": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" }, "engines": { - "node": "^8.13.0 || >=10.10.0" + "node": ">=12.10.0" } }, "node_modules/@grpc/proto-loader": { - "version": "0.7.7", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.7.tgz", - "integrity": "sha512-1TIeXOi8TuSCQprPItwoMymZXxWT0CPxUhkrkeCUH+D8U7QDwQ6b7SUz2MaLuWM2llT+J/TVFLmQI5KtML3BhQ==", + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", + "license": "Apache-2.0", "dependencies": { - "@types/long": "^4.0.1", "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", "yargs": "^17.7.2" }, "bin": { @@ -47,6 +48,22 @@ "node": ">=6" } }, + "node_modules/@grpc/proto-loader/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -104,7 +121,8 @@ "node_modules/@types/long": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "dev": true }, "node_modules/@types/node": { "version": "20.3.2", @@ -121,6 +139,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -129,6 +148,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -155,6 +175,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -168,6 +189,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -178,7 +200,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" }, "node_modules/dataloader": { "version": "1.4.0", @@ -210,12 +233,14 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -224,6 +249,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -232,6 +258,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", "engines": { "node": ">=8" } @@ -239,12 +266,14 @@ "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" }, "node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "dev": true }, "node_modules/object-hash": { "version": "3.0.0", @@ -271,10 +300,11 @@ } }, "node_modules/protobufjs": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz", - "integrity": "sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", + "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -296,12 +326,14 @@ "node_modules/protobufjs/node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -310,6 +342,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -323,6 +356,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -368,11 +402,12 @@ } }, "node_modules/ts-proto-descriptors/node_modules/protobufjs": { - "version": "6.11.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", - "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "dev": true, "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -394,11 +429,12 @@ } }, "node_modules/ts-proto/node_modules/protobufjs": { - "version": "6.11.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", - "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "dev": true, "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -436,6 +472,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -452,6 +489,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", "engines": { "node": ">=10" } @@ -460,6 +498,7 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -477,6 +516,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", "engines": { "node": ">=12" } diff --git a/yellowstone-grpc-client-nodejs/src/grpc/geyser.ts b/yellowstone-grpc-client-nodejs/src/grpc/geyser.ts index 0368f441..f06cd3eb 100644 --- a/yellowstone-grpc-client-nodejs/src/grpc/geyser.ts +++ b/yellowstone-grpc-client-nodejs/src/grpc/geyser.ts @@ -152,9 +152,11 @@ export interface SubscribeRequestFilterBlocks { includeEntries?: boolean | undefined; } -export interface SubscribeRequestFilterBlocksMeta {} +export interface SubscribeRequestFilterBlocksMeta { +} -export interface SubscribeRequestFilterEntry {} +export interface SubscribeRequestFilterEntry { +} export interface SubscribeRequestAccountsDataSlice { offset: string; @@ -260,7 +262,8 @@ export interface SubscribeUpdateEntry { startingTransactionIndex: string; } -export interface SubscribeUpdatePing {} +export interface SubscribeUpdatePing { +} export interface SubscribeUpdatePong { id: number; @@ -300,7 +303,8 @@ export interface GetSlotResponse { slot: string; } -export interface GetVersionRequest {} +export interface GetVersionRequest { +} export interface GetVersionResponse { version: string; @@ -332,73 +336,42 @@ function createBaseSubscribeRequest(): SubscribeRequest { } export const SubscribeRequest = { - encode( - message: SubscribeRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { Object.entries(message.accounts).forEach(([key, value]) => { - SubscribeRequest_AccountsEntry.encode( - { key: key as any, value }, - writer.uint32(10).fork() - ).ldelim(); + SubscribeRequest_AccountsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim(); }); Object.entries(message.slots).forEach(([key, value]) => { - SubscribeRequest_SlotsEntry.encode( - { key: key as any, value }, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequest_SlotsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); }); Object.entries(message.transactions).forEach(([key, value]) => { - SubscribeRequest_TransactionsEntry.encode( - { key: key as any, value }, - writer.uint32(26).fork() - ).ldelim(); + SubscribeRequest_TransactionsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).ldelim(); }); Object.entries(message.transactionsStatus).forEach(([key, value]) => { - SubscribeRequest_TransactionsStatusEntry.encode( - { key: key as any, value }, - writer.uint32(82).fork() - ).ldelim(); + SubscribeRequest_TransactionsStatusEntry.encode({ key: key as any, value }, writer.uint32(82).fork()).ldelim(); }); Object.entries(message.blocks).forEach(([key, value]) => { - SubscribeRequest_BlocksEntry.encode( - { key: key as any, value }, - writer.uint32(34).fork() - ).ldelim(); + SubscribeRequest_BlocksEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).ldelim(); }); Object.entries(message.blocksMeta).forEach(([key, value]) => { - SubscribeRequest_BlocksMetaEntry.encode( - { key: key as any, value }, - writer.uint32(42).fork() - ).ldelim(); + SubscribeRequest_BlocksMetaEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).ldelim(); }); Object.entries(message.entry).forEach(([key, value]) => { - SubscribeRequest_EntryEntry.encode( - { key: key as any, value }, - writer.uint32(66).fork() - ).ldelim(); + SubscribeRequest_EntryEntry.encode({ key: key as any, value }, writer.uint32(66).fork()).ldelim(); }); if (message.commitment !== undefined) { writer.uint32(48).int32(message.commitment); } for (const v of message.accountsDataSlice) { - SubscribeRequestAccountsDataSlice.encode( - v!, - writer.uint32(58).fork() - ).ldelim(); + SubscribeRequestAccountsDataSlice.encode(v!, writer.uint32(58).fork()).ldelim(); } if (message.ping !== undefined) { - SubscribeRequestPing.encode( - message.ping, - writer.uint32(74).fork() - ).ldelim(); + SubscribeRequestPing.encode(message.ping, writer.uint32(74).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest(); while (reader.pos < end) { @@ -409,10 +382,7 @@ export const SubscribeRequest = { break; } - const entry1 = SubscribeRequest_AccountsEntry.decode( - reader, - reader.uint32() - ); + const entry1 = SubscribeRequest_AccountsEntry.decode(reader, reader.uint32()); if (entry1.value !== undefined) { message.accounts[entry1.key] = entry1.value; } @@ -422,10 +392,7 @@ export const SubscribeRequest = { break; } - const entry2 = SubscribeRequest_SlotsEntry.decode( - reader, - reader.uint32() - ); + const entry2 = SubscribeRequest_SlotsEntry.decode(reader, reader.uint32()); if (entry2.value !== undefined) { message.slots[entry2.key] = entry2.value; } @@ -435,10 +402,7 @@ export const SubscribeRequest = { break; } - const entry3 = SubscribeRequest_TransactionsEntry.decode( - reader, - reader.uint32() - ); + const entry3 = SubscribeRequest_TransactionsEntry.decode(reader, reader.uint32()); if (entry3.value !== undefined) { message.transactions[entry3.key] = entry3.value; } @@ -448,10 +412,7 @@ export const SubscribeRequest = { break; } - const entry10 = SubscribeRequest_TransactionsStatusEntry.decode( - reader, - reader.uint32() - ); + const entry10 = SubscribeRequest_TransactionsStatusEntry.decode(reader, reader.uint32()); if (entry10.value !== undefined) { message.transactionsStatus[entry10.key] = entry10.value; } @@ -461,10 +422,7 @@ export const SubscribeRequest = { break; } - const entry4 = SubscribeRequest_BlocksEntry.decode( - reader, - reader.uint32() - ); + const entry4 = SubscribeRequest_BlocksEntry.decode(reader, reader.uint32()); if (entry4.value !== undefined) { message.blocks[entry4.key] = entry4.value; } @@ -474,10 +432,7 @@ export const SubscribeRequest = { break; } - const entry5 = SubscribeRequest_BlocksMetaEntry.decode( - reader, - reader.uint32() - ); + const entry5 = SubscribeRequest_BlocksMetaEntry.decode(reader, reader.uint32()); if (entry5.value !== undefined) { message.blocksMeta[entry5.key] = entry5.value; } @@ -487,10 +442,7 @@ export const SubscribeRequest = { break; } - const entry8 = SubscribeRequest_EntryEntry.decode( - reader, - reader.uint32() - ); + const entry8 = SubscribeRequest_EntryEntry.decode(reader, reader.uint32()); if (entry8.value !== undefined) { message.entry[entry8.key] = entry8.value; } @@ -507,9 +459,7 @@ export const SubscribeRequest = { break; } - message.accountsDataSlice.push( - SubscribeRequestAccountsDataSlice.decode(reader, reader.uint32()) - ); + message.accountsDataSlice.push(SubscribeRequestAccountsDataSlice.decode(reader, reader.uint32())); continue; case 9: if (tag !== 74) { @@ -530,72 +480,64 @@ export const SubscribeRequest = { fromJSON(object: any): SubscribeRequest { return { accounts: isObject(object.accounts) - ? Object.entries(object.accounts).reduce<{ - [key: string]: SubscribeRequestFilterAccounts; - }>((acc, [key, value]) => { + ? Object.entries(object.accounts).reduce<{ [key: string]: SubscribeRequestFilterAccounts }>( + (acc, [key, value]) => { acc[key] = SubscribeRequestFilterAccounts.fromJSON(value); return acc; - }, {}) + }, + {}, + ) : {}, slots: isObject(object.slots) - ? Object.entries(object.slots).reduce<{ - [key: string]: SubscribeRequestFilterSlots; - }>((acc, [key, value]) => { - acc[key] = SubscribeRequestFilterSlots.fromJSON(value); - return acc; - }, {}) + ? Object.entries(object.slots).reduce<{ [key: string]: SubscribeRequestFilterSlots }>((acc, [key, value]) => { + acc[key] = SubscribeRequestFilterSlots.fromJSON(value); + return acc; + }, {}) : {}, transactions: isObject(object.transactions) - ? Object.entries(object.transactions).reduce<{ - [key: string]: SubscribeRequestFilterTransactions; - }>((acc, [key, value]) => { + ? Object.entries(object.transactions).reduce<{ [key: string]: SubscribeRequestFilterTransactions }>( + (acc, [key, value]) => { acc[key] = SubscribeRequestFilterTransactions.fromJSON(value); return acc; - }, {}) + }, + {}, + ) : {}, transactionsStatus: isObject(object.transactionsStatus) - ? Object.entries(object.transactionsStatus).reduce<{ - [key: string]: SubscribeRequestFilterTransactions; - }>((acc, [key, value]) => { + ? Object.entries(object.transactionsStatus).reduce<{ [key: string]: SubscribeRequestFilterTransactions }>( + (acc, [key, value]) => { acc[key] = SubscribeRequestFilterTransactions.fromJSON(value); return acc; - }, {}) + }, + {}, + ) : {}, blocks: isObject(object.blocks) - ? Object.entries(object.blocks).reduce<{ - [key: string]: SubscribeRequestFilterBlocks; - }>((acc, [key, value]) => { - acc[key] = SubscribeRequestFilterBlocks.fromJSON(value); - return acc; - }, {}) + ? Object.entries(object.blocks).reduce<{ [key: string]: SubscribeRequestFilterBlocks }>((acc, [key, value]) => { + acc[key] = SubscribeRequestFilterBlocks.fromJSON(value); + return acc; + }, {}) : {}, blocksMeta: isObject(object.blocksMeta) - ? Object.entries(object.blocksMeta).reduce<{ - [key: string]: SubscribeRequestFilterBlocksMeta; - }>((acc, [key, value]) => { + ? Object.entries(object.blocksMeta).reduce<{ [key: string]: SubscribeRequestFilterBlocksMeta }>( + (acc, [key, value]) => { acc[key] = SubscribeRequestFilterBlocksMeta.fromJSON(value); return acc; - }, {}) + }, + {}, + ) : {}, entry: isObject(object.entry) - ? Object.entries(object.entry).reduce<{ - [key: string]: SubscribeRequestFilterEntry; - }>((acc, [key, value]) => { - acc[key] = SubscribeRequestFilterEntry.fromJSON(value); - return acc; - }, {}) + ? Object.entries(object.entry).reduce<{ [key: string]: SubscribeRequestFilterEntry }>((acc, [key, value]) => { + acc[key] = SubscribeRequestFilterEntry.fromJSON(value); + return acc; + }, {}) : {}, - commitment: isSet(object.commitment) - ? commitmentLevelFromJSON(object.commitment) - : undefined, + commitment: isSet(object.commitment) ? commitmentLevelFromJSON(object.commitment) : undefined, accountsDataSlice: Array.isArray(object?.accountsDataSlice) - ? object.accountsDataSlice.map((e: any) => - SubscribeRequestAccountsDataSlice.fromJSON(e) - ) + ? object.accountsDataSlice.map((e: any) => SubscribeRequestAccountsDataSlice.fromJSON(e)) : [], - ping: isSet(object.ping) - ? SubscribeRequestPing.fromJSON(object.ping) - : undefined, + ping: isSet(object.ping) ? SubscribeRequestPing.fromJSON(object.ping) : undefined, }; }, @@ -622,8 +564,7 @@ export const SubscribeRequest = { obj.transactionsStatus = {}; if (message.transactionsStatus) { Object.entries(message.transactionsStatus).forEach(([k, v]) => { - obj.transactionsStatus[k] = - SubscribeRequestFilterTransactions.toJSON(v); + obj.transactionsStatus[k] = SubscribeRequestFilterTransactions.toJSON(v); }); } obj.blocks = {}; @@ -645,10 +586,7 @@ export const SubscribeRequest = { }); } message.commitment !== undefined && - (obj.commitment = - message.commitment !== undefined - ? commitmentLevelToJSON(message.commitment) - : undefined); + (obj.commitment = message.commitment !== undefined ? commitmentLevelToJSON(message.commitment) : undefined); if (message.accountsDataSlice) { obj.accountsDataSlice = message.accountsDataSlice.map((e) => e ? SubscribeRequestAccountsDataSlice.toJSON(e) : undefined @@ -656,91 +594,82 @@ export const SubscribeRequest = { } else { obj.accountsDataSlice = []; } - message.ping !== undefined && - (obj.ping = message.ping - ? SubscribeRequestPing.toJSON(message.ping) - : undefined); + message.ping !== undefined && (obj.ping = message.ping ? SubscribeRequestPing.toJSON(message.ping) : undefined); return obj; }, - create, I>>( - base?: I - ): SubscribeRequest { + create, I>>(base?: I): SubscribeRequest { return SubscribeRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeRequest { + fromPartial, I>>(object: I): SubscribeRequest { const message = createBaseSubscribeRequest(); - message.accounts = Object.entries(object.accounts ?? {}).reduce<{ - [key: string]: SubscribeRequestFilterAccounts; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = SubscribeRequestFilterAccounts.fromPartial(value); - } - return acc; - }, {}); - message.slots = Object.entries(object.slots ?? {}).reduce<{ - [key: string]: SubscribeRequestFilterSlots; - }>((acc, [key, value]) => { + message.accounts = Object.entries(object.accounts ?? {}).reduce<{ [key: string]: SubscribeRequestFilterAccounts }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = SubscribeRequestFilterAccounts.fromPartial(value); + } + return acc; + }, + {}, + ); + message.slots = Object.entries(object.slots ?? {}).reduce<{ [key: string]: SubscribeRequestFilterSlots }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = SubscribeRequestFilterSlots.fromPartial(value); + } + return acc; + }, + {}, + ); + message.transactions = Object.entries(object.transactions ?? {}).reduce< + { [key: string]: SubscribeRequestFilterTransactions } + >((acc, [key, value]) => { if (value !== undefined) { - acc[key] = SubscribeRequestFilterSlots.fromPartial(value); + acc[key] = SubscribeRequestFilterTransactions.fromPartial(value); } return acc; }, {}); - message.transactions = Object.entries(object.transactions ?? {}).reduce<{ - [key: string]: SubscribeRequestFilterTransactions; - }>((acc, [key, value]) => { + message.transactionsStatus = Object.entries(object.transactionsStatus ?? {}).reduce< + { [key: string]: SubscribeRequestFilterTransactions } + >((acc, [key, value]) => { if (value !== undefined) { acc[key] = SubscribeRequestFilterTransactions.fromPartial(value); } return acc; }, {}); - message.transactionsStatus = Object.entries( - object.transactionsStatus ?? {} - ).reduce<{ [key: string]: SubscribeRequestFilterTransactions }>( + message.blocks = Object.entries(object.blocks ?? {}).reduce<{ [key: string]: SubscribeRequestFilterBlocks }>( (acc, [key, value]) => { if (value !== undefined) { - acc[key] = SubscribeRequestFilterTransactions.fromPartial(value); + acc[key] = SubscribeRequestFilterBlocks.fromPartial(value); } return acc; }, - {} + {}, ); - message.blocks = Object.entries(object.blocks ?? {}).reduce<{ - [key: string]: SubscribeRequestFilterBlocks; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = SubscribeRequestFilterBlocks.fromPartial(value); - } - return acc; - }, {}); - message.blocksMeta = Object.entries(object.blocksMeta ?? {}).reduce<{ - [key: string]: SubscribeRequestFilterBlocksMeta; - }>((acc, [key, value]) => { + message.blocksMeta = Object.entries(object.blocksMeta ?? {}).reduce< + { [key: string]: SubscribeRequestFilterBlocksMeta } + >((acc, [key, value]) => { if (value !== undefined) { acc[key] = SubscribeRequestFilterBlocksMeta.fromPartial(value); } return acc; }, {}); - message.entry = Object.entries(object.entry ?? {}).reduce<{ - [key: string]: SubscribeRequestFilterEntry; - }>((acc, [key, value]) => { - if (value !== undefined) { - acc[key] = SubscribeRequestFilterEntry.fromPartial(value); - } - return acc; - }, {}); + message.entry = Object.entries(object.entry ?? {}).reduce<{ [key: string]: SubscribeRequestFilterEntry }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = SubscribeRequestFilterEntry.fromPartial(value); + } + return acc; + }, + {}, + ); message.commitment = object.commitment ?? undefined; message.accountsDataSlice = - object.accountsDataSlice?.map((e) => - SubscribeRequestAccountsDataSlice.fromPartial(e) - ) || []; - message.ping = - object.ping !== undefined && object.ping !== null - ? SubscribeRequestPing.fromPartial(object.ping) - : undefined; + object.accountsDataSlice?.map((e) => SubscribeRequestAccountsDataSlice.fromPartial(e)) || []; + message.ping = (object.ping !== undefined && object.ping !== null) + ? SubscribeRequestPing.fromPartial(object.ping) + : undefined; return message; }, }; @@ -750,28 +679,18 @@ function createBaseSubscribeRequest_AccountsEntry(): SubscribeRequest_AccountsEn } export const SubscribeRequest_AccountsEntry = { - encode( - message: SubscribeRequest_AccountsEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest_AccountsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - SubscribeRequestFilterAccounts.encode( - message.value, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequestFilterAccounts.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequest_AccountsEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest_AccountsEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest_AccountsEntry(); while (reader.pos < end) { @@ -789,10 +708,7 @@ export const SubscribeRequest_AccountsEntry = { break; } - message.value = SubscribeRequestFilterAccounts.decode( - reader, - reader.uint32() - ); + message.value = SubscribeRequestFilterAccounts.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -806,9 +722,7 @@ export const SubscribeRequest_AccountsEntry = { fromJSON(object: any): SubscribeRequest_AccountsEntry { return { key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SubscribeRequestFilterAccounts.fromJSON(object.value) - : undefined, + value: isSet(object.value) ? SubscribeRequestFilterAccounts.fromJSON(object.value) : undefined, }; }, @@ -816,27 +730,22 @@ export const SubscribeRequest_AccountsEntry = { const obj: any = {}; message.key !== undefined && (obj.key = message.key); message.value !== undefined && - (obj.value = message.value - ? SubscribeRequestFilterAccounts.toJSON(message.value) - : undefined); + (obj.value = message.value ? SubscribeRequestFilterAccounts.toJSON(message.value) : undefined); return obj; }, - create, I>>( - base?: I - ): SubscribeRequest_AccountsEntry { + create, I>>(base?: I): SubscribeRequest_AccountsEntry { return SubscribeRequest_AccountsEntry.fromPartial(base ?? {}); }, fromPartial, I>>( - object: I + object: I, ): SubscribeRequest_AccountsEntry { const message = createBaseSubscribeRequest_AccountsEntry(); message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SubscribeRequestFilterAccounts.fromPartial(object.value) - : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? SubscribeRequestFilterAccounts.fromPartial(object.value) + : undefined; return message; }, }; @@ -846,28 +755,18 @@ function createBaseSubscribeRequest_SlotsEntry(): SubscribeRequest_SlotsEntry { } export const SubscribeRequest_SlotsEntry = { - encode( - message: SubscribeRequest_SlotsEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest_SlotsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - SubscribeRequestFilterSlots.encode( - message.value, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequestFilterSlots.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequest_SlotsEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest_SlotsEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest_SlotsEntry(); while (reader.pos < end) { @@ -885,10 +784,7 @@ export const SubscribeRequest_SlotsEntry = { break; } - message.value = SubscribeRequestFilterSlots.decode( - reader, - reader.uint32() - ); + message.value = SubscribeRequestFilterSlots.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -902,9 +798,7 @@ export const SubscribeRequest_SlotsEntry = { fromJSON(object: any): SubscribeRequest_SlotsEntry { return { key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SubscribeRequestFilterSlots.fromJSON(object.value) - : undefined, + value: isSet(object.value) ? SubscribeRequestFilterSlots.fromJSON(object.value) : undefined, }; }, @@ -912,27 +806,20 @@ export const SubscribeRequest_SlotsEntry = { const obj: any = {}; message.key !== undefined && (obj.key = message.key); message.value !== undefined && - (obj.value = message.value - ? SubscribeRequestFilterSlots.toJSON(message.value) - : undefined); + (obj.value = message.value ? SubscribeRequestFilterSlots.toJSON(message.value) : undefined); return obj; }, - create, I>>( - base?: I - ): SubscribeRequest_SlotsEntry { + create, I>>(base?: I): SubscribeRequest_SlotsEntry { return SubscribeRequest_SlotsEntry.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeRequest_SlotsEntry { + fromPartial, I>>(object: I): SubscribeRequest_SlotsEntry { const message = createBaseSubscribeRequest_SlotsEntry(); message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SubscribeRequestFilterSlots.fromPartial(object.value) - : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? SubscribeRequestFilterSlots.fromPartial(object.value) + : undefined; return message; }, }; @@ -942,28 +829,18 @@ function createBaseSubscribeRequest_TransactionsEntry(): SubscribeRequest_Transa } export const SubscribeRequest_TransactionsEntry = { - encode( - message: SubscribeRequest_TransactionsEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest_TransactionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - SubscribeRequestFilterTransactions.encode( - message.value, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequestFilterTransactions.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequest_TransactionsEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest_TransactionsEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest_TransactionsEntry(); while (reader.pos < end) { @@ -981,10 +858,7 @@ export const SubscribeRequest_TransactionsEntry = { break; } - message.value = SubscribeRequestFilterTransactions.decode( - reader, - reader.uint32() - ); + message.value = SubscribeRequestFilterTransactions.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -998,9 +872,7 @@ export const SubscribeRequest_TransactionsEntry = { fromJSON(object: any): SubscribeRequest_TransactionsEntry { return { key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SubscribeRequestFilterTransactions.fromJSON(object.value) - : undefined, + value: isSet(object.value) ? SubscribeRequestFilterTransactions.fromJSON(object.value) : undefined, }; }, @@ -1008,27 +880,24 @@ export const SubscribeRequest_TransactionsEntry = { const obj: any = {}; message.key !== undefined && (obj.key = message.key); message.value !== undefined && - (obj.value = message.value - ? SubscribeRequestFilterTransactions.toJSON(message.value) - : undefined); + (obj.value = message.value ? SubscribeRequestFilterTransactions.toJSON(message.value) : undefined); return obj; }, create, I>>( - base?: I + base?: I, ): SubscribeRequest_TransactionsEntry { return SubscribeRequest_TransactionsEntry.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeRequest_TransactionsEntry { + fromPartial, I>>( + object: I, + ): SubscribeRequest_TransactionsEntry { const message = createBaseSubscribeRequest_TransactionsEntry(); message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SubscribeRequestFilterTransactions.fromPartial(object.value) - : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? SubscribeRequestFilterTransactions.fromPartial(object.value) + : undefined; return message; }, }; @@ -1038,28 +907,18 @@ function createBaseSubscribeRequest_TransactionsStatusEntry(): SubscribeRequest_ } export const SubscribeRequest_TransactionsStatusEntry = { - encode( - message: SubscribeRequest_TransactionsStatusEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest_TransactionsStatusEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - SubscribeRequestFilterTransactions.encode( - message.value, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequestFilterTransactions.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequest_TransactionsStatusEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest_TransactionsStatusEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest_TransactionsStatusEntry(); while (reader.pos < end) { @@ -1077,10 +936,7 @@ export const SubscribeRequest_TransactionsStatusEntry = { break; } - message.value = SubscribeRequestFilterTransactions.decode( - reader, - reader.uint32() - ); + message.value = SubscribeRequestFilterTransactions.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1094,9 +950,7 @@ export const SubscribeRequest_TransactionsStatusEntry = { fromJSON(object: any): SubscribeRequest_TransactionsStatusEntry { return { key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SubscribeRequestFilterTransactions.fromJSON(object.value) - : undefined, + value: isSet(object.value) ? SubscribeRequestFilterTransactions.fromJSON(object.value) : undefined, }; }, @@ -1104,27 +958,24 @@ export const SubscribeRequest_TransactionsStatusEntry = { const obj: any = {}; message.key !== undefined && (obj.key = message.key); message.value !== undefined && - (obj.value = message.value - ? SubscribeRequestFilterTransactions.toJSON(message.value) - : undefined); + (obj.value = message.value ? SubscribeRequestFilterTransactions.toJSON(message.value) : undefined); return obj; }, - create< - I extends Exact, I> - >(base?: I): SubscribeRequest_TransactionsStatusEntry { + create, I>>( + base?: I, + ): SubscribeRequest_TransactionsStatusEntry { return SubscribeRequest_TransactionsStatusEntry.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeRequest_TransactionsStatusEntry { + fromPartial, I>>( + object: I, + ): SubscribeRequest_TransactionsStatusEntry { const message = createBaseSubscribeRequest_TransactionsStatusEntry(); message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SubscribeRequestFilterTransactions.fromPartial(object.value) - : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? SubscribeRequestFilterTransactions.fromPartial(object.value) + : undefined; return message; }, }; @@ -1134,28 +985,18 @@ function createBaseSubscribeRequest_BlocksEntry(): SubscribeRequest_BlocksEntry } export const SubscribeRequest_BlocksEntry = { - encode( - message: SubscribeRequest_BlocksEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest_BlocksEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - SubscribeRequestFilterBlocks.encode( - message.value, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequestFilterBlocks.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequest_BlocksEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest_BlocksEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest_BlocksEntry(); while (reader.pos < end) { @@ -1173,10 +1014,7 @@ export const SubscribeRequest_BlocksEntry = { break; } - message.value = SubscribeRequestFilterBlocks.decode( - reader, - reader.uint32() - ); + message.value = SubscribeRequestFilterBlocks.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1190,9 +1028,7 @@ export const SubscribeRequest_BlocksEntry = { fromJSON(object: any): SubscribeRequest_BlocksEntry { return { key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SubscribeRequestFilterBlocks.fromJSON(object.value) - : undefined, + value: isSet(object.value) ? SubscribeRequestFilterBlocks.fromJSON(object.value) : undefined, }; }, @@ -1200,27 +1036,20 @@ export const SubscribeRequest_BlocksEntry = { const obj: any = {}; message.key !== undefined && (obj.key = message.key); message.value !== undefined && - (obj.value = message.value - ? SubscribeRequestFilterBlocks.toJSON(message.value) - : undefined); + (obj.value = message.value ? SubscribeRequestFilterBlocks.toJSON(message.value) : undefined); return obj; }, - create, I>>( - base?: I - ): SubscribeRequest_BlocksEntry { + create, I>>(base?: I): SubscribeRequest_BlocksEntry { return SubscribeRequest_BlocksEntry.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeRequest_BlocksEntry { + fromPartial, I>>(object: I): SubscribeRequest_BlocksEntry { const message = createBaseSubscribeRequest_BlocksEntry(); message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SubscribeRequestFilterBlocks.fromPartial(object.value) - : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? SubscribeRequestFilterBlocks.fromPartial(object.value) + : undefined; return message; }, }; @@ -1230,28 +1059,18 @@ function createBaseSubscribeRequest_BlocksMetaEntry(): SubscribeRequest_BlocksMe } export const SubscribeRequest_BlocksMetaEntry = { - encode( - message: SubscribeRequest_BlocksMetaEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest_BlocksMetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - SubscribeRequestFilterBlocksMeta.encode( - message.value, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequestFilterBlocksMeta.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequest_BlocksMetaEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest_BlocksMetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest_BlocksMetaEntry(); while (reader.pos < end) { @@ -1269,10 +1088,7 @@ export const SubscribeRequest_BlocksMetaEntry = { break; } - message.value = SubscribeRequestFilterBlocksMeta.decode( - reader, - reader.uint32() - ); + message.value = SubscribeRequestFilterBlocksMeta.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1286,9 +1102,7 @@ export const SubscribeRequest_BlocksMetaEntry = { fromJSON(object: any): SubscribeRequest_BlocksMetaEntry { return { key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SubscribeRequestFilterBlocksMeta.fromJSON(object.value) - : undefined, + value: isSet(object.value) ? SubscribeRequestFilterBlocksMeta.fromJSON(object.value) : undefined, }; }, @@ -1296,27 +1110,24 @@ export const SubscribeRequest_BlocksMetaEntry = { const obj: any = {}; message.key !== undefined && (obj.key = message.key); message.value !== undefined && - (obj.value = message.value - ? SubscribeRequestFilterBlocksMeta.toJSON(message.value) - : undefined); + (obj.value = message.value ? SubscribeRequestFilterBlocksMeta.toJSON(message.value) : undefined); return obj; }, create, I>>( - base?: I + base?: I, ): SubscribeRequest_BlocksMetaEntry { return SubscribeRequest_BlocksMetaEntry.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeRequest_BlocksMetaEntry { + fromPartial, I>>( + object: I, + ): SubscribeRequest_BlocksMetaEntry { const message = createBaseSubscribeRequest_BlocksMetaEntry(); message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SubscribeRequestFilterBlocksMeta.fromPartial(object.value) - : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? SubscribeRequestFilterBlocksMeta.fromPartial(object.value) + : undefined; return message; }, }; @@ -1326,28 +1137,18 @@ function createBaseSubscribeRequest_EntryEntry(): SubscribeRequest_EntryEntry { } export const SubscribeRequest_EntryEntry = { - encode( - message: SubscribeRequest_EntryEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequest_EntryEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== undefined) { - SubscribeRequestFilterEntry.encode( - message.value, - writer.uint32(18).fork() - ).ldelim(); + SubscribeRequestFilterEntry.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequest_EntryEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequest_EntryEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequest_EntryEntry(); while (reader.pos < end) { @@ -1365,10 +1166,7 @@ export const SubscribeRequest_EntryEntry = { break; } - message.value = SubscribeRequestFilterEntry.decode( - reader, - reader.uint32() - ); + message.value = SubscribeRequestFilterEntry.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1382,9 +1180,7 @@ export const SubscribeRequest_EntryEntry = { fromJSON(object: any): SubscribeRequest_EntryEntry { return { key: isSet(object.key) ? String(object.key) : "", - value: isSet(object.value) - ? SubscribeRequestFilterEntry.fromJSON(object.value) - : undefined, + value: isSet(object.value) ? SubscribeRequestFilterEntry.fromJSON(object.value) : undefined, }; }, @@ -1392,27 +1188,20 @@ export const SubscribeRequest_EntryEntry = { const obj: any = {}; message.key !== undefined && (obj.key = message.key); message.value !== undefined && - (obj.value = message.value - ? SubscribeRequestFilterEntry.toJSON(message.value) - : undefined); + (obj.value = message.value ? SubscribeRequestFilterEntry.toJSON(message.value) : undefined); return obj; }, - create, I>>( - base?: I - ): SubscribeRequest_EntryEntry { + create, I>>(base?: I): SubscribeRequest_EntryEntry { return SubscribeRequest_EntryEntry.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeRequest_EntryEntry { + fromPartial, I>>(object: I): SubscribeRequest_EntryEntry { const message = createBaseSubscribeRequest_EntryEntry(); message.key = object.key ?? ""; - message.value = - object.value !== undefined && object.value !== null - ? SubscribeRequestFilterEntry.fromPartial(object.value) - : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? SubscribeRequestFilterEntry.fromPartial(object.value) + : undefined; return message; }, }; @@ -1422,10 +1211,7 @@ function createBaseSubscribeRequestFilterAccounts(): SubscribeRequestFilterAccou } export const SubscribeRequestFilterAccounts = { - encode( - message: SubscribeRequestFilterAccounts, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestFilterAccounts, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.account) { writer.uint32(18).string(v!); } @@ -1433,20 +1219,13 @@ export const SubscribeRequestFilterAccounts = { writer.uint32(26).string(v!); } for (const v of message.filters) { - SubscribeRequestFilterAccountsFilter.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); + SubscribeRequestFilterAccountsFilter.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterAccounts { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterAccounts { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterAccounts(); while (reader.pos < end) { @@ -1471,9 +1250,7 @@ export const SubscribeRequestFilterAccounts = { break; } - message.filters.push( - SubscribeRequestFilterAccountsFilter.decode(reader, reader.uint32()) - ); + message.filters.push(SubscribeRequestFilterAccountsFilter.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1486,16 +1263,10 @@ export const SubscribeRequestFilterAccounts = { fromJSON(object: any): SubscribeRequestFilterAccounts { return { - account: Array.isArray(object?.account) - ? object.account.map((e: any) => String(e)) - : [], - owner: Array.isArray(object?.owner) - ? object.owner.map((e: any) => String(e)) - : [], + account: Array.isArray(object?.account) ? object.account.map((e: any) => String(e)) : [], + owner: Array.isArray(object?.owner) ? object.owner.map((e: any) => String(e)) : [], filters: Array.isArray(object?.filters) - ? object.filters.map((e: any) => - SubscribeRequestFilterAccountsFilter.fromJSON(e) - ) + ? object.filters.map((e: any) => SubscribeRequestFilterAccountsFilter.fromJSON(e)) : [], }; }, @@ -1513,53 +1284,36 @@ export const SubscribeRequestFilterAccounts = { obj.owner = []; } if (message.filters) { - obj.filters = message.filters.map((e) => - e ? SubscribeRequestFilterAccountsFilter.toJSON(e) : undefined - ); + obj.filters = message.filters.map((e) => e ? SubscribeRequestFilterAccountsFilter.toJSON(e) : undefined); } else { obj.filters = []; } return obj; }, - create, I>>( - base?: I - ): SubscribeRequestFilterAccounts { + create, I>>(base?: I): SubscribeRequestFilterAccounts { return SubscribeRequestFilterAccounts.fromPartial(base ?? {}); }, fromPartial, I>>( - object: I + object: I, ): SubscribeRequestFilterAccounts { const message = createBaseSubscribeRequestFilterAccounts(); message.account = object.account?.map((e) => e) || []; message.owner = object.owner?.map((e) => e) || []; - message.filters = - object.filters?.map((e) => - SubscribeRequestFilterAccountsFilter.fromPartial(e) - ) || []; + message.filters = object.filters?.map((e) => SubscribeRequestFilterAccountsFilter.fromPartial(e)) || []; return message; }, }; function createBaseSubscribeRequestFilterAccountsFilter(): SubscribeRequestFilterAccountsFilter { - return { - memcmp: undefined, - datasize: undefined, - tokenAccountState: undefined, - }; + return { memcmp: undefined, datasize: undefined, tokenAccountState: undefined }; } export const SubscribeRequestFilterAccountsFilter = { - encode( - message: SubscribeRequestFilterAccountsFilter, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestFilterAccountsFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.memcmp !== undefined) { - SubscribeRequestFilterAccountsFilterMemcmp.encode( - message.memcmp, - writer.uint32(10).fork() - ).ldelim(); + SubscribeRequestFilterAccountsFilterMemcmp.encode(message.memcmp, writer.uint32(10).fork()).ldelim(); } if (message.datasize !== undefined) { writer.uint32(16).uint64(message.datasize); @@ -1570,12 +1324,8 @@ export const SubscribeRequestFilterAccountsFilter = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterAccountsFilter { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterAccountsFilter { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterAccountsFilter(); while (reader.pos < end) { @@ -1586,10 +1336,7 @@ export const SubscribeRequestFilterAccountsFilter = { break; } - message.memcmp = SubscribeRequestFilterAccountsFilterMemcmp.decode( - reader, - reader.uint32() - ); + message.memcmp = SubscribeRequestFilterAccountsFilterMemcmp.decode(reader, reader.uint32()); continue; case 2: if (tag !== 16) { @@ -1616,42 +1363,34 @@ export const SubscribeRequestFilterAccountsFilter = { fromJSON(object: any): SubscribeRequestFilterAccountsFilter { return { - memcmp: isSet(object.memcmp) - ? SubscribeRequestFilterAccountsFilterMemcmp.fromJSON(object.memcmp) - : undefined, + memcmp: isSet(object.memcmp) ? SubscribeRequestFilterAccountsFilterMemcmp.fromJSON(object.memcmp) : undefined, datasize: isSet(object.datasize) ? String(object.datasize) : undefined, - tokenAccountState: isSet(object.tokenAccountState) - ? Boolean(object.tokenAccountState) - : undefined, + tokenAccountState: isSet(object.tokenAccountState) ? Boolean(object.tokenAccountState) : undefined, }; }, toJSON(message: SubscribeRequestFilterAccountsFilter): unknown { const obj: any = {}; message.memcmp !== undefined && - (obj.memcmp = message.memcmp - ? SubscribeRequestFilterAccountsFilterMemcmp.toJSON(message.memcmp) - : undefined); + (obj.memcmp = message.memcmp ? SubscribeRequestFilterAccountsFilterMemcmp.toJSON(message.memcmp) : undefined); message.datasize !== undefined && (obj.datasize = message.datasize); - message.tokenAccountState !== undefined && - (obj.tokenAccountState = message.tokenAccountState); + message.tokenAccountState !== undefined && (obj.tokenAccountState = message.tokenAccountState); return obj; }, create, I>>( - base?: I + base?: I, ): SubscribeRequestFilterAccountsFilter { return SubscribeRequestFilterAccountsFilter.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeRequestFilterAccountsFilter { + fromPartial, I>>( + object: I, + ): SubscribeRequestFilterAccountsFilter { const message = createBaseSubscribeRequestFilterAccountsFilter(); - message.memcmp = - object.memcmp !== undefined && object.memcmp !== null - ? SubscribeRequestFilterAccountsFilterMemcmp.fromPartial(object.memcmp) - : undefined; + message.memcmp = (object.memcmp !== undefined && object.memcmp !== null) + ? SubscribeRequestFilterAccountsFilterMemcmp.fromPartial(object.memcmp) + : undefined; message.datasize = object.datasize ?? undefined; message.tokenAccountState = object.tokenAccountState ?? undefined; return message; @@ -1659,19 +1398,11 @@ export const SubscribeRequestFilterAccountsFilter = { }; function createBaseSubscribeRequestFilterAccountsFilterMemcmp(): SubscribeRequestFilterAccountsFilterMemcmp { - return { - offset: "0", - bytes: undefined, - base58: undefined, - base64: undefined, - }; + return { offset: "0", bytes: undefined, base58: undefined, base64: undefined }; } export const SubscribeRequestFilterAccountsFilterMemcmp = { - encode( - message: SubscribeRequestFilterAccountsFilterMemcmp, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestFilterAccountsFilterMemcmp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.offset !== "0") { writer.uint32(8).uint64(message.offset); } @@ -1687,12 +1418,8 @@ export const SubscribeRequestFilterAccountsFilterMemcmp = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterAccountsFilterMemcmp { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterAccountsFilterMemcmp { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterAccountsFilterMemcmp(); while (reader.pos < end) { @@ -1748,24 +1475,21 @@ export const SubscribeRequestFilterAccountsFilterMemcmp = { const obj: any = {}; message.offset !== undefined && (obj.offset = message.offset); message.bytes !== undefined && - (obj.bytes = - message.bytes !== undefined - ? base64FromBytes(message.bytes) - : undefined); + (obj.bytes = message.bytes !== undefined ? base64FromBytes(message.bytes) : undefined); message.base58 !== undefined && (obj.base58 = message.base58); message.base64 !== undefined && (obj.base64 = message.base64); return obj; }, - create< - I extends Exact, I> - >(base?: I): SubscribeRequestFilterAccountsFilterMemcmp { + create, I>>( + base?: I, + ): SubscribeRequestFilterAccountsFilterMemcmp { return SubscribeRequestFilterAccountsFilterMemcmp.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeRequestFilterAccountsFilterMemcmp { + fromPartial, I>>( + object: I, + ): SubscribeRequestFilterAccountsFilterMemcmp { const message = createBaseSubscribeRequestFilterAccountsFilterMemcmp(); message.offset = object.offset ?? "0"; message.bytes = object.bytes ?? undefined; @@ -1780,22 +1504,15 @@ function createBaseSubscribeRequestFilterSlots(): SubscribeRequestFilterSlots { } export const SubscribeRequestFilterSlots = { - encode( - message: SubscribeRequestFilterSlots, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestFilterSlots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.filterByCommitment !== undefined) { writer.uint32(8).bool(message.filterByCommitment); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterSlots { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterSlots { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterSlots(); while (reader.pos < end) { @@ -1818,29 +1535,20 @@ export const SubscribeRequestFilterSlots = { }, fromJSON(object: any): SubscribeRequestFilterSlots { - return { - filterByCommitment: isSet(object.filterByCommitment) - ? Boolean(object.filterByCommitment) - : undefined, - }; + return { filterByCommitment: isSet(object.filterByCommitment) ? Boolean(object.filterByCommitment) : undefined }; }, toJSON(message: SubscribeRequestFilterSlots): unknown { const obj: any = {}; - message.filterByCommitment !== undefined && - (obj.filterByCommitment = message.filterByCommitment); + message.filterByCommitment !== undefined && (obj.filterByCommitment = message.filterByCommitment); return obj; }, - create, I>>( - base?: I - ): SubscribeRequestFilterSlots { + create, I>>(base?: I): SubscribeRequestFilterSlots { return SubscribeRequestFilterSlots.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeRequestFilterSlots { + fromPartial, I>>(object: I): SubscribeRequestFilterSlots { const message = createBaseSubscribeRequestFilterSlots(); message.filterByCommitment = object.filterByCommitment ?? undefined; return message; @@ -1859,10 +1567,7 @@ function createBaseSubscribeRequestFilterTransactions(): SubscribeRequestFilterT } export const SubscribeRequestFilterTransactions = { - encode( - message: SubscribeRequestFilterTransactions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestFilterTransactions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.vote !== undefined) { writer.uint32(8).bool(message.vote); } @@ -1884,12 +1589,8 @@ export const SubscribeRequestFilterTransactions = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterTransactions { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterTransactions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterTransactions(); while (reader.pos < end) { @@ -1951,15 +1652,9 @@ export const SubscribeRequestFilterTransactions = { vote: isSet(object.vote) ? Boolean(object.vote) : undefined, failed: isSet(object.failed) ? Boolean(object.failed) : undefined, signature: isSet(object.signature) ? String(object.signature) : undefined, - accountInclude: Array.isArray(object?.accountInclude) - ? object.accountInclude.map((e: any) => String(e)) - : [], - accountExclude: Array.isArray(object?.accountExclude) - ? object.accountExclude.map((e: any) => String(e)) - : [], - accountRequired: Array.isArray(object?.accountRequired) - ? object.accountRequired.map((e: any) => String(e)) - : [], + accountInclude: Array.isArray(object?.accountInclude) ? object.accountInclude.map((e: any) => String(e)) : [], + accountExclude: Array.isArray(object?.accountExclude) ? object.accountExclude.map((e: any) => String(e)) : [], + accountRequired: Array.isArray(object?.accountRequired) ? object.accountRequired.map((e: any) => String(e)) : [], }; }, @@ -1987,14 +1682,14 @@ export const SubscribeRequestFilterTransactions = { }, create, I>>( - base?: I + base?: I, ): SubscribeRequestFilterTransactions { return SubscribeRequestFilterTransactions.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeRequestFilterTransactions { + fromPartial, I>>( + object: I, + ): SubscribeRequestFilterTransactions { const message = createBaseSubscribeRequestFilterTransactions(); message.vote = object.vote ?? undefined; message.failed = object.failed ?? undefined; @@ -2007,19 +1702,11 @@ export const SubscribeRequestFilterTransactions = { }; function createBaseSubscribeRequestFilterBlocks(): SubscribeRequestFilterBlocks { - return { - accountInclude: [], - includeTransactions: undefined, - includeAccounts: undefined, - includeEntries: undefined, - }; + return { accountInclude: [], includeTransactions: undefined, includeAccounts: undefined, includeEntries: undefined }; } export const SubscribeRequestFilterBlocks = { - encode( - message: SubscribeRequestFilterBlocks, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestFilterBlocks, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.accountInclude) { writer.uint32(10).string(v!); } @@ -2035,12 +1722,8 @@ export const SubscribeRequestFilterBlocks = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterBlocks { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterBlocks { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterBlocks(); while (reader.pos < end) { @@ -2085,18 +1768,10 @@ export const SubscribeRequestFilterBlocks = { fromJSON(object: any): SubscribeRequestFilterBlocks { return { - accountInclude: Array.isArray(object?.accountInclude) - ? object.accountInclude.map((e: any) => String(e)) - : [], - includeTransactions: isSet(object.includeTransactions) - ? Boolean(object.includeTransactions) - : undefined, - includeAccounts: isSet(object.includeAccounts) - ? Boolean(object.includeAccounts) - : undefined, - includeEntries: isSet(object.includeEntries) - ? Boolean(object.includeEntries) - : undefined, + accountInclude: Array.isArray(object?.accountInclude) ? object.accountInclude.map((e: any) => String(e)) : [], + includeTransactions: isSet(object.includeTransactions) ? Boolean(object.includeTransactions) : undefined, + includeAccounts: isSet(object.includeAccounts) ? Boolean(object.includeAccounts) : undefined, + includeEntries: isSet(object.includeEntries) ? Boolean(object.includeEntries) : undefined, }; }, @@ -2107,24 +1782,17 @@ export const SubscribeRequestFilterBlocks = { } else { obj.accountInclude = []; } - message.includeTransactions !== undefined && - (obj.includeTransactions = message.includeTransactions); - message.includeAccounts !== undefined && - (obj.includeAccounts = message.includeAccounts); - message.includeEntries !== undefined && - (obj.includeEntries = message.includeEntries); + message.includeTransactions !== undefined && (obj.includeTransactions = message.includeTransactions); + message.includeAccounts !== undefined && (obj.includeAccounts = message.includeAccounts); + message.includeEntries !== undefined && (obj.includeEntries = message.includeEntries); return obj; }, - create, I>>( - base?: I - ): SubscribeRequestFilterBlocks { + create, I>>(base?: I): SubscribeRequestFilterBlocks { return SubscribeRequestFilterBlocks.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeRequestFilterBlocks { + fromPartial, I>>(object: I): SubscribeRequestFilterBlocks { const message = createBaseSubscribeRequestFilterBlocks(); message.accountInclude = object.accountInclude?.map((e) => e) || []; message.includeTransactions = object.includeTransactions ?? undefined; @@ -2139,19 +1807,12 @@ function createBaseSubscribeRequestFilterBlocksMeta(): SubscribeRequestFilterBlo } export const SubscribeRequestFilterBlocksMeta = { - encode( - _: SubscribeRequestFilterBlocksMeta, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(_: SubscribeRequestFilterBlocksMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterBlocksMeta { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterBlocksMeta { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterBlocksMeta(); while (reader.pos < end) { @@ -2176,14 +1837,14 @@ export const SubscribeRequestFilterBlocksMeta = { }, create, I>>( - base?: I + base?: I, ): SubscribeRequestFilterBlocksMeta { return SubscribeRequestFilterBlocksMeta.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(_: I): SubscribeRequestFilterBlocksMeta { + fromPartial, I>>( + _: I, + ): SubscribeRequestFilterBlocksMeta { const message = createBaseSubscribeRequestFilterBlocksMeta(); return message; }, @@ -2194,19 +1855,12 @@ function createBaseSubscribeRequestFilterEntry(): SubscribeRequestFilterEntry { } export const SubscribeRequestFilterEntry = { - encode( - _: SubscribeRequestFilterEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(_: SubscribeRequestFilterEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestFilterEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestFilterEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestFilterEntry(); while (reader.pos < end) { @@ -2230,15 +1884,11 @@ export const SubscribeRequestFilterEntry = { return obj; }, - create, I>>( - base?: I - ): SubscribeRequestFilterEntry { + create, I>>(base?: I): SubscribeRequestFilterEntry { return SubscribeRequestFilterEntry.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I - ): SubscribeRequestFilterEntry { + fromPartial, I>>(_: I): SubscribeRequestFilterEntry { const message = createBaseSubscribeRequestFilterEntry(); return message; }, @@ -2249,10 +1899,7 @@ function createBaseSubscribeRequestAccountsDataSlice(): SubscribeRequestAccounts } export const SubscribeRequestAccountsDataSlice = { - encode( - message: SubscribeRequestAccountsDataSlice, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestAccountsDataSlice, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.offset !== "0") { writer.uint32(8).uint64(message.offset); } @@ -2262,12 +1909,8 @@ export const SubscribeRequestAccountsDataSlice = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestAccountsDataSlice { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestAccountsDataSlice { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestAccountsDataSlice(); while (reader.pos < end) { @@ -2311,14 +1954,14 @@ export const SubscribeRequestAccountsDataSlice = { }, create, I>>( - base?: I + base?: I, ): SubscribeRequestAccountsDataSlice { return SubscribeRequestAccountsDataSlice.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeRequestAccountsDataSlice { + fromPartial, I>>( + object: I, + ): SubscribeRequestAccountsDataSlice { const message = createBaseSubscribeRequestAccountsDataSlice(); message.offset = object.offset ?? "0"; message.length = object.length ?? "0"; @@ -2331,22 +1974,15 @@ function createBaseSubscribeRequestPing(): SubscribeRequestPing { } export const SubscribeRequestPing = { - encode( - message: SubscribeRequestPing, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeRequestPing, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.id !== 0) { writer.uint32(8).int32(message.id); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeRequestPing { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeRequestPing { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeRequestPing(); while (reader.pos < end) { @@ -2378,15 +2014,11 @@ export const SubscribeRequestPing = { return obj; }, - create, I>>( - base?: I - ): SubscribeRequestPing { + create, I>>(base?: I): SubscribeRequestPing { return SubscribeRequestPing.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeRequestPing { + fromPartial, I>>(object: I): SubscribeRequestPing { const message = createBaseSubscribeRequestPing(); message.id = object.id ?? 0; return message; @@ -2409,73 +2041,42 @@ function createBaseSubscribeUpdate(): SubscribeUpdate { } export const SubscribeUpdate = { - encode( - message: SubscribeUpdate, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.filters) { writer.uint32(10).string(v!); } if (message.account !== undefined) { - SubscribeUpdateAccount.encode( - message.account, - writer.uint32(18).fork() - ).ldelim(); + SubscribeUpdateAccount.encode(message.account, writer.uint32(18).fork()).ldelim(); } if (message.slot !== undefined) { - SubscribeUpdateSlot.encode( - message.slot, - writer.uint32(26).fork() - ).ldelim(); + SubscribeUpdateSlot.encode(message.slot, writer.uint32(26).fork()).ldelim(); } if (message.transaction !== undefined) { - SubscribeUpdateTransaction.encode( - message.transaction, - writer.uint32(34).fork() - ).ldelim(); + SubscribeUpdateTransaction.encode(message.transaction, writer.uint32(34).fork()).ldelim(); } if (message.transactionStatus !== undefined) { - SubscribeUpdateTransactionStatus.encode( - message.transactionStatus, - writer.uint32(82).fork() - ).ldelim(); + SubscribeUpdateTransactionStatus.encode(message.transactionStatus, writer.uint32(82).fork()).ldelim(); } if (message.block !== undefined) { - SubscribeUpdateBlock.encode( - message.block, - writer.uint32(42).fork() - ).ldelim(); + SubscribeUpdateBlock.encode(message.block, writer.uint32(42).fork()).ldelim(); } if (message.ping !== undefined) { - SubscribeUpdatePing.encode( - message.ping, - writer.uint32(50).fork() - ).ldelim(); + SubscribeUpdatePing.encode(message.ping, writer.uint32(50).fork()).ldelim(); } if (message.pong !== undefined) { - SubscribeUpdatePong.encode( - message.pong, - writer.uint32(74).fork() - ).ldelim(); + SubscribeUpdatePong.encode(message.pong, writer.uint32(74).fork()).ldelim(); } if (message.blockMeta !== undefined) { - SubscribeUpdateBlockMeta.encode( - message.blockMeta, - writer.uint32(58).fork() - ).ldelim(); + SubscribeUpdateBlockMeta.encode(message.blockMeta, writer.uint32(58).fork()).ldelim(); } if (message.entry !== undefined) { - SubscribeUpdateEntry.encode( - message.entry, - writer.uint32(66).fork() - ).ldelim(); + SubscribeUpdateEntry.encode(message.entry, writer.uint32(66).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdate { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdate(); while (reader.pos < end) { @@ -2493,10 +2094,7 @@ export const SubscribeUpdate = { break; } - message.account = SubscribeUpdateAccount.decode( - reader, - reader.uint32() - ); + message.account = SubscribeUpdateAccount.decode(reader, reader.uint32()); continue; case 3: if (tag !== 26) { @@ -2510,20 +2108,14 @@ export const SubscribeUpdate = { break; } - message.transaction = SubscribeUpdateTransaction.decode( - reader, - reader.uint32() - ); + message.transaction = SubscribeUpdateTransaction.decode(reader, reader.uint32()); continue; case 10: if (tag !== 82) { break; } - message.transactionStatus = SubscribeUpdateTransactionStatus.decode( - reader, - reader.uint32() - ); + message.transactionStatus = SubscribeUpdateTransactionStatus.decode(reader, reader.uint32()); continue; case 5: if (tag !== 42) { @@ -2551,10 +2143,7 @@ export const SubscribeUpdate = { break; } - message.blockMeta = SubscribeUpdateBlockMeta.decode( - reader, - reader.uint32() - ); + message.blockMeta = SubscribeUpdateBlockMeta.decode(reader, reader.uint32()); continue; case 8: if (tag !== 66) { @@ -2574,36 +2163,18 @@ export const SubscribeUpdate = { fromJSON(object: any): SubscribeUpdate { return { - filters: Array.isArray(object?.filters) - ? object.filters.map((e: any) => String(e)) - : [], - account: isSet(object.account) - ? SubscribeUpdateAccount.fromJSON(object.account) - : undefined, - slot: isSet(object.slot) - ? SubscribeUpdateSlot.fromJSON(object.slot) - : undefined, - transaction: isSet(object.transaction) - ? SubscribeUpdateTransaction.fromJSON(object.transaction) - : undefined, + filters: Array.isArray(object?.filters) ? object.filters.map((e: any) => String(e)) : [], + account: isSet(object.account) ? SubscribeUpdateAccount.fromJSON(object.account) : undefined, + slot: isSet(object.slot) ? SubscribeUpdateSlot.fromJSON(object.slot) : undefined, + transaction: isSet(object.transaction) ? SubscribeUpdateTransaction.fromJSON(object.transaction) : undefined, transactionStatus: isSet(object.transactionStatus) ? SubscribeUpdateTransactionStatus.fromJSON(object.transactionStatus) : undefined, - block: isSet(object.block) - ? SubscribeUpdateBlock.fromJSON(object.block) - : undefined, - ping: isSet(object.ping) - ? SubscribeUpdatePing.fromJSON(object.ping) - : undefined, - pong: isSet(object.pong) - ? SubscribeUpdatePong.fromJSON(object.pong) - : undefined, - blockMeta: isSet(object.blockMeta) - ? SubscribeUpdateBlockMeta.fromJSON(object.blockMeta) - : undefined, - entry: isSet(object.entry) - ? SubscribeUpdateEntry.fromJSON(object.entry) - : undefined, + block: isSet(object.block) ? SubscribeUpdateBlock.fromJSON(object.block) : undefined, + ping: isSet(object.ping) ? SubscribeUpdatePing.fromJSON(object.ping) : undefined, + pong: isSet(object.pong) ? SubscribeUpdatePong.fromJSON(object.pong) : undefined, + blockMeta: isSet(object.blockMeta) ? SubscribeUpdateBlockMeta.fromJSON(object.blockMeta) : undefined, + entry: isSet(object.entry) ? SubscribeUpdateEntry.fromJSON(object.entry) : undefined, }; }, @@ -2615,92 +2186,56 @@ export const SubscribeUpdate = { obj.filters = []; } message.account !== undefined && - (obj.account = message.account - ? SubscribeUpdateAccount.toJSON(message.account) - : undefined); - message.slot !== undefined && - (obj.slot = message.slot - ? SubscribeUpdateSlot.toJSON(message.slot) - : undefined); + (obj.account = message.account ? SubscribeUpdateAccount.toJSON(message.account) : undefined); + message.slot !== undefined && (obj.slot = message.slot ? SubscribeUpdateSlot.toJSON(message.slot) : undefined); message.transaction !== undefined && - (obj.transaction = message.transaction - ? SubscribeUpdateTransaction.toJSON(message.transaction) - : undefined); - message.transactionStatus !== undefined && - (obj.transactionStatus = message.transactionStatus - ? SubscribeUpdateTransactionStatus.toJSON(message.transactionStatus) - : undefined); - message.block !== undefined && - (obj.block = message.block - ? SubscribeUpdateBlock.toJSON(message.block) - : undefined); - message.ping !== undefined && - (obj.ping = message.ping - ? SubscribeUpdatePing.toJSON(message.ping) - : undefined); - message.pong !== undefined && - (obj.pong = message.pong - ? SubscribeUpdatePong.toJSON(message.pong) - : undefined); + (obj.transaction = message.transaction ? SubscribeUpdateTransaction.toJSON(message.transaction) : undefined); + message.transactionStatus !== undefined && (obj.transactionStatus = message.transactionStatus + ? SubscribeUpdateTransactionStatus.toJSON(message.transactionStatus) + : undefined); + message.block !== undefined && (obj.block = message.block ? SubscribeUpdateBlock.toJSON(message.block) : undefined); + message.ping !== undefined && (obj.ping = message.ping ? SubscribeUpdatePing.toJSON(message.ping) : undefined); + message.pong !== undefined && (obj.pong = message.pong ? SubscribeUpdatePong.toJSON(message.pong) : undefined); message.blockMeta !== undefined && - (obj.blockMeta = message.blockMeta - ? SubscribeUpdateBlockMeta.toJSON(message.blockMeta) - : undefined); - message.entry !== undefined && - (obj.entry = message.entry - ? SubscribeUpdateEntry.toJSON(message.entry) - : undefined); + (obj.blockMeta = message.blockMeta ? SubscribeUpdateBlockMeta.toJSON(message.blockMeta) : undefined); + message.entry !== undefined && (obj.entry = message.entry ? SubscribeUpdateEntry.toJSON(message.entry) : undefined); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdate { + create, I>>(base?: I): SubscribeUpdate { return SubscribeUpdate.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdate { + fromPartial, I>>(object: I): SubscribeUpdate { const message = createBaseSubscribeUpdate(); message.filters = object.filters?.map((e) => e) || []; - message.account = - object.account !== undefined && object.account !== null - ? SubscribeUpdateAccount.fromPartial(object.account) - : undefined; - message.slot = - object.slot !== undefined && object.slot !== null - ? SubscribeUpdateSlot.fromPartial(object.slot) - : undefined; - message.transaction = - object.transaction !== undefined && object.transaction !== null - ? SubscribeUpdateTransaction.fromPartial(object.transaction) - : undefined; - message.transactionStatus = - object.transactionStatus !== undefined && - object.transactionStatus !== null - ? SubscribeUpdateTransactionStatus.fromPartial(object.transactionStatus) - : undefined; - message.block = - object.block !== undefined && object.block !== null - ? SubscribeUpdateBlock.fromPartial(object.block) - : undefined; - message.ping = - object.ping !== undefined && object.ping !== null - ? SubscribeUpdatePing.fromPartial(object.ping) - : undefined; - message.pong = - object.pong !== undefined && object.pong !== null - ? SubscribeUpdatePong.fromPartial(object.pong) - : undefined; - message.blockMeta = - object.blockMeta !== undefined && object.blockMeta !== null - ? SubscribeUpdateBlockMeta.fromPartial(object.blockMeta) - : undefined; - message.entry = - object.entry !== undefined && object.entry !== null - ? SubscribeUpdateEntry.fromPartial(object.entry) - : undefined; + message.account = (object.account !== undefined && object.account !== null) + ? SubscribeUpdateAccount.fromPartial(object.account) + : undefined; + message.slot = (object.slot !== undefined && object.slot !== null) + ? SubscribeUpdateSlot.fromPartial(object.slot) + : undefined; + message.transaction = (object.transaction !== undefined && object.transaction !== null) + ? SubscribeUpdateTransaction.fromPartial(object.transaction) + : undefined; + message.transactionStatus = (object.transactionStatus !== undefined && object.transactionStatus !== null) + ? SubscribeUpdateTransactionStatus.fromPartial(object.transactionStatus) + : undefined; + message.block = (object.block !== undefined && object.block !== null) + ? SubscribeUpdateBlock.fromPartial(object.block) + : undefined; + message.ping = (object.ping !== undefined && object.ping !== null) + ? SubscribeUpdatePing.fromPartial(object.ping) + : undefined; + message.pong = (object.pong !== undefined && object.pong !== null) + ? SubscribeUpdatePong.fromPartial(object.pong) + : undefined; + message.blockMeta = (object.blockMeta !== undefined && object.blockMeta !== null) + ? SubscribeUpdateBlockMeta.fromPartial(object.blockMeta) + : undefined; + message.entry = (object.entry !== undefined && object.entry !== null) + ? SubscribeUpdateEntry.fromPartial(object.entry) + : undefined; return message; }, }; @@ -2710,15 +2245,9 @@ function createBaseSubscribeUpdateAccount(): SubscribeUpdateAccount { } export const SubscribeUpdateAccount = { - encode( - message: SubscribeUpdateAccount, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.account !== undefined) { - SubscribeUpdateAccountInfo.encode( - message.account, - writer.uint32(10).fork() - ).ldelim(); + SubscribeUpdateAccountInfo.encode(message.account, writer.uint32(10).fork()).ldelim(); } if (message.slot !== "0") { writer.uint32(16).uint64(message.slot); @@ -2729,12 +2258,8 @@ export const SubscribeUpdateAccount = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateAccount { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateAccount { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateAccount(); while (reader.pos < end) { @@ -2745,10 +2270,7 @@ export const SubscribeUpdateAccount = { break; } - message.account = SubscribeUpdateAccountInfo.decode( - reader, - reader.uint32() - ); + message.account = SubscribeUpdateAccountInfo.decode(reader, reader.uint32()); continue; case 2: if (tag !== 16) { @@ -2775,9 +2297,7 @@ export const SubscribeUpdateAccount = { fromJSON(object: any): SubscribeUpdateAccount { return { - account: isSet(object.account) - ? SubscribeUpdateAccountInfo.fromJSON(object.account) - : undefined, + account: isSet(object.account) ? SubscribeUpdateAccountInfo.fromJSON(object.account) : undefined, slot: isSet(object.slot) ? String(object.slot) : "0", isStartup: isSet(object.isStartup) ? Boolean(object.isStartup) : false, }; @@ -2786,28 +2306,21 @@ export const SubscribeUpdateAccount = { toJSON(message: SubscribeUpdateAccount): unknown { const obj: any = {}; message.account !== undefined && - (obj.account = message.account - ? SubscribeUpdateAccountInfo.toJSON(message.account) - : undefined); + (obj.account = message.account ? SubscribeUpdateAccountInfo.toJSON(message.account) : undefined); message.slot !== undefined && (obj.slot = message.slot); message.isStartup !== undefined && (obj.isStartup = message.isStartup); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateAccount { + create, I>>(base?: I): SubscribeUpdateAccount { return SubscribeUpdateAccount.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdateAccount { + fromPartial, I>>(object: I): SubscribeUpdateAccount { const message = createBaseSubscribeUpdateAccount(); - message.account = - object.account !== undefined && object.account !== null - ? SubscribeUpdateAccountInfo.fromPartial(object.account) - : undefined; + message.account = (object.account !== undefined && object.account !== null) + ? SubscribeUpdateAccountInfo.fromPartial(object.account) + : undefined; message.slot = object.slot ?? "0"; message.isStartup = object.isStartup ?? false; return message; @@ -2828,10 +2341,7 @@ function createBaseSubscribeUpdateAccountInfo(): SubscribeUpdateAccountInfo { } export const SubscribeUpdateAccountInfo = { - encode( - message: SubscribeUpdateAccountInfo, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateAccountInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pubkey.length !== 0) { writer.uint32(10).bytes(message.pubkey); } @@ -2859,12 +2369,8 @@ export const SubscribeUpdateAccountInfo = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateAccountInfo { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateAccountInfo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateAccountInfo(); while (reader.pos < end) { @@ -2937,63 +2443,39 @@ export const SubscribeUpdateAccountInfo = { fromJSON(object: any): SubscribeUpdateAccountInfo { return { - pubkey: isSet(object.pubkey) - ? bytesFromBase64(object.pubkey) - : new Uint8Array(0), + pubkey: isSet(object.pubkey) ? bytesFromBase64(object.pubkey) : new Uint8Array(0), lamports: isSet(object.lamports) ? String(object.lamports) : "0", - owner: isSet(object.owner) - ? bytesFromBase64(object.owner) - : new Uint8Array(0), + owner: isSet(object.owner) ? bytesFromBase64(object.owner) : new Uint8Array(0), executable: isSet(object.executable) ? Boolean(object.executable) : false, rentEpoch: isSet(object.rentEpoch) ? String(object.rentEpoch) : "0", - data: isSet(object.data) - ? bytesFromBase64(object.data) - : new Uint8Array(0), - writeVersion: isSet(object.writeVersion) - ? String(object.writeVersion) - : "0", - txnSignature: isSet(object.txnSignature) - ? bytesFromBase64(object.txnSignature) - : undefined, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0), + writeVersion: isSet(object.writeVersion) ? String(object.writeVersion) : "0", + txnSignature: isSet(object.txnSignature) ? bytesFromBase64(object.txnSignature) : undefined, }; }, toJSON(message: SubscribeUpdateAccountInfo): unknown { const obj: any = {}; message.pubkey !== undefined && - (obj.pubkey = base64FromBytes( - message.pubkey !== undefined ? message.pubkey : new Uint8Array(0) - )); + (obj.pubkey = base64FromBytes(message.pubkey !== undefined ? message.pubkey : new Uint8Array(0))); message.lamports !== undefined && (obj.lamports = message.lamports); message.owner !== undefined && - (obj.owner = base64FromBytes( - message.owner !== undefined ? message.owner : new Uint8Array(0) - )); + (obj.owner = base64FromBytes(message.owner !== undefined ? message.owner : new Uint8Array(0))); message.executable !== undefined && (obj.executable = message.executable); message.rentEpoch !== undefined && (obj.rentEpoch = message.rentEpoch); message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array(0) - )); - message.writeVersion !== undefined && - (obj.writeVersion = message.writeVersion); + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array(0))); + message.writeVersion !== undefined && (obj.writeVersion = message.writeVersion); message.txnSignature !== undefined && - (obj.txnSignature = - message.txnSignature !== undefined - ? base64FromBytes(message.txnSignature) - : undefined); + (obj.txnSignature = message.txnSignature !== undefined ? base64FromBytes(message.txnSignature) : undefined); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateAccountInfo { + create, I>>(base?: I): SubscribeUpdateAccountInfo { return SubscribeUpdateAccountInfo.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdateAccountInfo { + fromPartial, I>>(object: I): SubscribeUpdateAccountInfo { const message = createBaseSubscribeUpdateAccountInfo(); message.pubkey = object.pubkey ?? new Uint8Array(0); message.lamports = object.lamports ?? "0"; @@ -3012,10 +2494,7 @@ function createBaseSubscribeUpdateSlot(): SubscribeUpdateSlot { } export const SubscribeUpdateSlot = { - encode( - message: SubscribeUpdateSlot, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateSlot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -3029,8 +2508,7 @@ export const SubscribeUpdateSlot = { }, decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateSlot { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateSlot(); while (reader.pos < end) { @@ -3078,20 +2556,15 @@ export const SubscribeUpdateSlot = { const obj: any = {}; message.slot !== undefined && (obj.slot = message.slot); message.parent !== undefined && (obj.parent = message.parent); - message.status !== undefined && - (obj.status = commitmentLevelToJSON(message.status)); + message.status !== undefined && (obj.status = commitmentLevelToJSON(message.status)); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateSlot { + create, I>>(base?: I): SubscribeUpdateSlot { return SubscribeUpdateSlot.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdateSlot { + fromPartial, I>>(object: I): SubscribeUpdateSlot { const message = createBaseSubscribeUpdateSlot(); message.slot = object.slot ?? "0"; message.parent = object.parent ?? undefined; @@ -3105,15 +2578,9 @@ function createBaseSubscribeUpdateTransaction(): SubscribeUpdateTransaction { } export const SubscribeUpdateTransaction = { - encode( - message: SubscribeUpdateTransaction, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.transaction !== undefined) { - SubscribeUpdateTransactionInfo.encode( - message.transaction, - writer.uint32(10).fork() - ).ldelim(); + SubscribeUpdateTransactionInfo.encode(message.transaction, writer.uint32(10).fork()).ldelim(); } if (message.slot !== "0") { writer.uint32(16).uint64(message.slot); @@ -3121,12 +2588,8 @@ export const SubscribeUpdateTransaction = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateTransaction { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateTransaction { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateTransaction(); while (reader.pos < end) { @@ -3137,10 +2600,7 @@ export const SubscribeUpdateTransaction = { break; } - message.transaction = SubscribeUpdateTransactionInfo.decode( - reader, - reader.uint32() - ); + message.transaction = SubscribeUpdateTransactionInfo.decode(reader, reader.uint32()); continue; case 2: if (tag !== 16) { @@ -3160,9 +2620,7 @@ export const SubscribeUpdateTransaction = { fromJSON(object: any): SubscribeUpdateTransaction { return { - transaction: isSet(object.transaction) - ? SubscribeUpdateTransactionInfo.fromJSON(object.transaction) - : undefined, + transaction: isSet(object.transaction) ? SubscribeUpdateTransactionInfo.fromJSON(object.transaction) : undefined, slot: isSet(object.slot) ? String(object.slot) : "0", }; }, @@ -3170,47 +2628,31 @@ export const SubscribeUpdateTransaction = { toJSON(message: SubscribeUpdateTransaction): unknown { const obj: any = {}; message.transaction !== undefined && - (obj.transaction = message.transaction - ? SubscribeUpdateTransactionInfo.toJSON(message.transaction) - : undefined); + (obj.transaction = message.transaction ? SubscribeUpdateTransactionInfo.toJSON(message.transaction) : undefined); message.slot !== undefined && (obj.slot = message.slot); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateTransaction { + create, I>>(base?: I): SubscribeUpdateTransaction { return SubscribeUpdateTransaction.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdateTransaction { + fromPartial, I>>(object: I): SubscribeUpdateTransaction { const message = createBaseSubscribeUpdateTransaction(); - message.transaction = - object.transaction !== undefined && object.transaction !== null - ? SubscribeUpdateTransactionInfo.fromPartial(object.transaction) - : undefined; + message.transaction = (object.transaction !== undefined && object.transaction !== null) + ? SubscribeUpdateTransactionInfo.fromPartial(object.transaction) + : undefined; message.slot = object.slot ?? "0"; return message; }, }; function createBaseSubscribeUpdateTransactionInfo(): SubscribeUpdateTransactionInfo { - return { - signature: new Uint8Array(0), - isVote: false, - transaction: undefined, - meta: undefined, - index: "0", - }; + return { signature: new Uint8Array(0), isVote: false, transaction: undefined, meta: undefined, index: "0" }; } export const SubscribeUpdateTransactionInfo = { - encode( - message: SubscribeUpdateTransactionInfo, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateTransactionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.signature.length !== 0) { writer.uint32(10).bytes(message.signature); } @@ -3218,16 +2660,10 @@ export const SubscribeUpdateTransactionInfo = { writer.uint32(16).bool(message.isVote); } if (message.transaction !== undefined) { - Transaction.encode( - message.transaction, - writer.uint32(26).fork() - ).ldelim(); + Transaction.encode(message.transaction, writer.uint32(26).fork()).ldelim(); } if (message.meta !== undefined) { - TransactionStatusMeta.encode( - message.meta, - writer.uint32(34).fork() - ).ldelim(); + TransactionStatusMeta.encode(message.meta, writer.uint32(34).fork()).ldelim(); } if (message.index !== "0") { writer.uint32(40).uint64(message.index); @@ -3235,12 +2671,8 @@ export const SubscribeUpdateTransactionInfo = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateTransactionInfo { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateTransactionInfo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateTransactionInfo(); while (reader.pos < end) { @@ -3292,16 +2724,10 @@ export const SubscribeUpdateTransactionInfo = { fromJSON(object: any): SubscribeUpdateTransactionInfo { return { - signature: isSet(object.signature) - ? bytesFromBase64(object.signature) - : new Uint8Array(0), + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0), isVote: isSet(object.isVote) ? Boolean(object.isVote) : false, - transaction: isSet(object.transaction) - ? Transaction.fromJSON(object.transaction) - : undefined, - meta: isSet(object.meta) - ? TransactionStatusMeta.fromJSON(object.meta) - : undefined, + transaction: isSet(object.transaction) ? Transaction.fromJSON(object.transaction) : undefined, + meta: isSet(object.meta) ? TransactionStatusMeta.fromJSON(object.meta) : undefined, index: isSet(object.index) ? String(object.index) : "0", }; }, @@ -3309,62 +2735,42 @@ export const SubscribeUpdateTransactionInfo = { toJSON(message: SubscribeUpdateTransactionInfo): unknown { const obj: any = {}; message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array(0) - )); + (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array(0))); message.isVote !== undefined && (obj.isVote = message.isVote); message.transaction !== undefined && - (obj.transaction = message.transaction - ? Transaction.toJSON(message.transaction) - : undefined); - message.meta !== undefined && - (obj.meta = message.meta - ? TransactionStatusMeta.toJSON(message.meta) - : undefined); + (obj.transaction = message.transaction ? Transaction.toJSON(message.transaction) : undefined); + message.meta !== undefined && (obj.meta = message.meta ? TransactionStatusMeta.toJSON(message.meta) : undefined); message.index !== undefined && (obj.index = message.index); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateTransactionInfo { + create, I>>(base?: I): SubscribeUpdateTransactionInfo { return SubscribeUpdateTransactionInfo.fromPartial(base ?? {}); }, fromPartial, I>>( - object: I + object: I, ): SubscribeUpdateTransactionInfo { const message = createBaseSubscribeUpdateTransactionInfo(); message.signature = object.signature ?? new Uint8Array(0); message.isVote = object.isVote ?? false; - message.transaction = - object.transaction !== undefined && object.transaction !== null - ? Transaction.fromPartial(object.transaction) - : undefined; - message.meta = - object.meta !== undefined && object.meta !== null - ? TransactionStatusMeta.fromPartial(object.meta) - : undefined; + message.transaction = (object.transaction !== undefined && object.transaction !== null) + ? Transaction.fromPartial(object.transaction) + : undefined; + message.meta = (object.meta !== undefined && object.meta !== null) + ? TransactionStatusMeta.fromPartial(object.meta) + : undefined; message.index = object.index ?? "0"; return message; }, }; function createBaseSubscribeUpdateTransactionStatus(): SubscribeUpdateTransactionStatus { - return { - slot: "0", - signature: new Uint8Array(0), - isVote: false, - index: "0", - err: undefined, - }; + return { slot: "0", signature: new Uint8Array(0), isVote: false, index: "0", err: undefined }; } export const SubscribeUpdateTransactionStatus = { - encode( - message: SubscribeUpdateTransactionStatus, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateTransactionStatus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -3383,12 +2789,8 @@ export const SubscribeUpdateTransactionStatus = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateTransactionStatus { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateTransactionStatus { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateTransactionStatus(); while (reader.pos < end) { @@ -3441,14 +2843,10 @@ export const SubscribeUpdateTransactionStatus = { fromJSON(object: any): SubscribeUpdateTransactionStatus { return { slot: isSet(object.slot) ? String(object.slot) : "0", - signature: isSet(object.signature) - ? bytesFromBase64(object.signature) - : new Uint8Array(0), + signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0), isVote: isSet(object.isVote) ? Boolean(object.isVote) : false, index: isSet(object.index) ? String(object.index) : "0", - err: isSet(object.err) - ? TransactionError.fromJSON(object.err) - : undefined, + err: isSet(object.err) ? TransactionError.fromJSON(object.err) : undefined, }; }, @@ -3456,36 +2854,30 @@ export const SubscribeUpdateTransactionStatus = { const obj: any = {}; message.slot !== undefined && (obj.slot = message.slot); message.signature !== undefined && - (obj.signature = base64FromBytes( - message.signature !== undefined ? message.signature : new Uint8Array(0) - )); + (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array(0))); message.isVote !== undefined && (obj.isVote = message.isVote); message.index !== undefined && (obj.index = message.index); - message.err !== undefined && - (obj.err = message.err - ? TransactionError.toJSON(message.err) - : undefined); + message.err !== undefined && (obj.err = message.err ? TransactionError.toJSON(message.err) : undefined); return obj; }, create, I>>( - base?: I + base?: I, ): SubscribeUpdateTransactionStatus { return SubscribeUpdateTransactionStatus.fromPartial(base ?? {}); }, - fromPartial< - I extends Exact, I> - >(object: I): SubscribeUpdateTransactionStatus { + fromPartial, I>>( + object: I, + ): SubscribeUpdateTransactionStatus { const message = createBaseSubscribeUpdateTransactionStatus(); message.slot = object.slot ?? "0"; message.signature = object.signature ?? new Uint8Array(0); message.isVote = object.isVote ?? false; message.index = object.index ?? "0"; - message.err = - object.err !== undefined && object.err !== null - ? TransactionError.fromPartial(object.err) - : undefined; + message.err = (object.err !== undefined && object.err !== null) + ? TransactionError.fromPartial(object.err) + : undefined; return message; }, }; @@ -3509,10 +2901,7 @@ function createBaseSubscribeUpdateBlock(): SubscribeUpdateBlock { } export const SubscribeUpdateBlock = { - encode( - message: SubscribeUpdateBlock, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -3523,16 +2912,10 @@ export const SubscribeUpdateBlock = { Rewards.encode(message.rewards, writer.uint32(26).fork()).ldelim(); } if (message.blockTime !== undefined) { - UnixTimestamp.encode( - message.blockTime, - writer.uint32(34).fork() - ).ldelim(); + UnixTimestamp.encode(message.blockTime, writer.uint32(34).fork()).ldelim(); } if (message.blockHeight !== undefined) { - BlockHeight.encode( - message.blockHeight, - writer.uint32(42).fork() - ).ldelim(); + BlockHeight.encode(message.blockHeight, writer.uint32(42).fork()).ldelim(); } if (message.parentSlot !== "0") { writer.uint32(56).uint64(message.parentSlot); @@ -3544,10 +2927,7 @@ export const SubscribeUpdateBlock = { writer.uint32(72).uint64(message.executedTransactionCount); } for (const v of message.transactions) { - SubscribeUpdateTransactionInfo.encode( - v!, - writer.uint32(50).fork() - ).ldelim(); + SubscribeUpdateTransactionInfo.encode(v!, writer.uint32(50).fork()).ldelim(); } if (message.updatedAccountCount !== "0") { writer.uint32(80).uint64(message.updatedAccountCount); @@ -3564,12 +2944,8 @@ export const SubscribeUpdateBlock = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateBlock { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateBlock { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateBlock(); while (reader.pos < end) { @@ -3629,18 +3005,14 @@ export const SubscribeUpdateBlock = { break; } - message.executedTransactionCount = longToString( - reader.uint64() as Long - ); + message.executedTransactionCount = longToString(reader.uint64() as Long); continue; case 6: if (tag !== 50) { break; } - message.transactions.push( - SubscribeUpdateTransactionInfo.decode(reader, reader.uint32()) - ); + message.transactions.push(SubscribeUpdateTransactionInfo.decode(reader, reader.uint32())); continue; case 10: if (tag !== 80) { @@ -3654,9 +3026,7 @@ export const SubscribeUpdateBlock = { break; } - message.accounts.push( - SubscribeUpdateAccountInfo.decode(reader, reader.uint32()) - ); + message.accounts.push(SubscribeUpdateAccountInfo.decode(reader, reader.uint32())); continue; case 12: if (tag !== 96) { @@ -3670,9 +3040,7 @@ export const SubscribeUpdateBlock = { break; } - message.entries.push( - SubscribeUpdateEntry.decode(reader, reader.uint32()) - ); + message.entries.push(SubscribeUpdateEntry.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -3687,41 +3055,21 @@ export const SubscribeUpdateBlock = { return { slot: isSet(object.slot) ? String(object.slot) : "0", blockhash: isSet(object.blockhash) ? String(object.blockhash) : "", - rewards: isSet(object.rewards) - ? Rewards.fromJSON(object.rewards) - : undefined, - blockTime: isSet(object.blockTime) - ? UnixTimestamp.fromJSON(object.blockTime) - : undefined, - blockHeight: isSet(object.blockHeight) - ? BlockHeight.fromJSON(object.blockHeight) - : undefined, + rewards: isSet(object.rewards) ? Rewards.fromJSON(object.rewards) : undefined, + blockTime: isSet(object.blockTime) ? UnixTimestamp.fromJSON(object.blockTime) : undefined, + blockHeight: isSet(object.blockHeight) ? BlockHeight.fromJSON(object.blockHeight) : undefined, parentSlot: isSet(object.parentSlot) ? String(object.parentSlot) : "0", - parentBlockhash: isSet(object.parentBlockhash) - ? String(object.parentBlockhash) - : "", - executedTransactionCount: isSet(object.executedTransactionCount) - ? String(object.executedTransactionCount) - : "0", + parentBlockhash: isSet(object.parentBlockhash) ? String(object.parentBlockhash) : "", + executedTransactionCount: isSet(object.executedTransactionCount) ? String(object.executedTransactionCount) : "0", transactions: Array.isArray(object?.transactions) - ? object.transactions.map((e: any) => - SubscribeUpdateTransactionInfo.fromJSON(e) - ) + ? object.transactions.map((e: any) => SubscribeUpdateTransactionInfo.fromJSON(e)) : [], - updatedAccountCount: isSet(object.updatedAccountCount) - ? String(object.updatedAccountCount) - : "0", + updatedAccountCount: isSet(object.updatedAccountCount) ? String(object.updatedAccountCount) : "0", accounts: Array.isArray(object?.accounts) - ? object.accounts.map((e: any) => - SubscribeUpdateAccountInfo.fromJSON(e) - ) - : [], - entriesCount: isSet(object.entriesCount) - ? String(object.entriesCount) - : "0", - entries: Array.isArray(object?.entries) - ? object.entries.map((e: any) => SubscribeUpdateEntry.fromJSON(e)) + ? object.accounts.map((e: any) => SubscribeUpdateAccountInfo.fromJSON(e)) : [], + entriesCount: isSet(object.entriesCount) ? String(object.entriesCount) : "0", + entries: Array.isArray(object?.entries) ? object.entries.map((e: any) => SubscribeUpdateEntry.fromJSON(e)) : [], }; }, @@ -3729,89 +3077,59 @@ export const SubscribeUpdateBlock = { const obj: any = {}; message.slot !== undefined && (obj.slot = message.slot); message.blockhash !== undefined && (obj.blockhash = message.blockhash); - message.rewards !== undefined && - (obj.rewards = message.rewards - ? Rewards.toJSON(message.rewards) - : undefined); + message.rewards !== undefined && (obj.rewards = message.rewards ? Rewards.toJSON(message.rewards) : undefined); message.blockTime !== undefined && - (obj.blockTime = message.blockTime - ? UnixTimestamp.toJSON(message.blockTime) - : undefined); + (obj.blockTime = message.blockTime ? UnixTimestamp.toJSON(message.blockTime) : undefined); message.blockHeight !== undefined && - (obj.blockHeight = message.blockHeight - ? BlockHeight.toJSON(message.blockHeight) - : undefined); + (obj.blockHeight = message.blockHeight ? BlockHeight.toJSON(message.blockHeight) : undefined); message.parentSlot !== undefined && (obj.parentSlot = message.parentSlot); - message.parentBlockhash !== undefined && - (obj.parentBlockhash = message.parentBlockhash); - message.executedTransactionCount !== undefined && - (obj.executedTransactionCount = message.executedTransactionCount); + message.parentBlockhash !== undefined && (obj.parentBlockhash = message.parentBlockhash); + message.executedTransactionCount !== undefined && (obj.executedTransactionCount = message.executedTransactionCount); if (message.transactions) { - obj.transactions = message.transactions.map((e) => - e ? SubscribeUpdateTransactionInfo.toJSON(e) : undefined - ); + obj.transactions = message.transactions.map((e) => e ? SubscribeUpdateTransactionInfo.toJSON(e) : undefined); } else { obj.transactions = []; } - message.updatedAccountCount !== undefined && - (obj.updatedAccountCount = message.updatedAccountCount); + message.updatedAccountCount !== undefined && (obj.updatedAccountCount = message.updatedAccountCount); if (message.accounts) { - obj.accounts = message.accounts.map((e) => - e ? SubscribeUpdateAccountInfo.toJSON(e) : undefined - ); + obj.accounts = message.accounts.map((e) => e ? SubscribeUpdateAccountInfo.toJSON(e) : undefined); } else { obj.accounts = []; } - message.entriesCount !== undefined && - (obj.entriesCount = message.entriesCount); + message.entriesCount !== undefined && (obj.entriesCount = message.entriesCount); if (message.entries) { - obj.entries = message.entries.map((e) => - e ? SubscribeUpdateEntry.toJSON(e) : undefined - ); + obj.entries = message.entries.map((e) => e ? SubscribeUpdateEntry.toJSON(e) : undefined); } else { obj.entries = []; } return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateBlock { + create, I>>(base?: I): SubscribeUpdateBlock { return SubscribeUpdateBlock.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdateBlock { + fromPartial, I>>(object: I): SubscribeUpdateBlock { const message = createBaseSubscribeUpdateBlock(); message.slot = object.slot ?? "0"; message.blockhash = object.blockhash ?? ""; - message.rewards = - object.rewards !== undefined && object.rewards !== null - ? Rewards.fromPartial(object.rewards) - : undefined; - message.blockTime = - object.blockTime !== undefined && object.blockTime !== null - ? UnixTimestamp.fromPartial(object.blockTime) - : undefined; - message.blockHeight = - object.blockHeight !== undefined && object.blockHeight !== null - ? BlockHeight.fromPartial(object.blockHeight) - : undefined; + message.rewards = (object.rewards !== undefined && object.rewards !== null) + ? Rewards.fromPartial(object.rewards) + : undefined; + message.blockTime = (object.blockTime !== undefined && object.blockTime !== null) + ? UnixTimestamp.fromPartial(object.blockTime) + : undefined; + message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) + ? BlockHeight.fromPartial(object.blockHeight) + : undefined; message.parentSlot = object.parentSlot ?? "0"; message.parentBlockhash = object.parentBlockhash ?? ""; message.executedTransactionCount = object.executedTransactionCount ?? "0"; - message.transactions = - object.transactions?.map((e) => - SubscribeUpdateTransactionInfo.fromPartial(e) - ) || []; + message.transactions = object.transactions?.map((e) => SubscribeUpdateTransactionInfo.fromPartial(e)) || []; message.updatedAccountCount = object.updatedAccountCount ?? "0"; - message.accounts = - object.accounts?.map((e) => SubscribeUpdateAccountInfo.fromPartial(e)) || - []; + message.accounts = object.accounts?.map((e) => SubscribeUpdateAccountInfo.fromPartial(e)) || []; message.entriesCount = object.entriesCount ?? "0"; - message.entries = - object.entries?.map((e) => SubscribeUpdateEntry.fromPartial(e)) || []; + message.entries = object.entries?.map((e) => SubscribeUpdateEntry.fromPartial(e)) || []; return message; }, }; @@ -3831,10 +3149,7 @@ function createBaseSubscribeUpdateBlockMeta(): SubscribeUpdateBlockMeta { } export const SubscribeUpdateBlockMeta = { - encode( - message: SubscribeUpdateBlockMeta, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateBlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -3845,16 +3160,10 @@ export const SubscribeUpdateBlockMeta = { Rewards.encode(message.rewards, writer.uint32(26).fork()).ldelim(); } if (message.blockTime !== undefined) { - UnixTimestamp.encode( - message.blockTime, - writer.uint32(34).fork() - ).ldelim(); + UnixTimestamp.encode(message.blockTime, writer.uint32(34).fork()).ldelim(); } if (message.blockHeight !== undefined) { - BlockHeight.encode( - message.blockHeight, - writer.uint32(42).fork() - ).ldelim(); + BlockHeight.encode(message.blockHeight, writer.uint32(42).fork()).ldelim(); } if (message.parentSlot !== "0") { writer.uint32(48).uint64(message.parentSlot); @@ -3871,12 +3180,8 @@ export const SubscribeUpdateBlockMeta = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateBlockMeta { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateBlockMeta { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateBlockMeta(); while (reader.pos < end) { @@ -3936,9 +3241,7 @@ export const SubscribeUpdateBlockMeta = { break; } - message.executedTransactionCount = longToString( - reader.uint64() as Long - ); + message.executedTransactionCount = longToString(reader.uint64() as Long); continue; case 9: if (tag !== 72) { @@ -3960,25 +3263,13 @@ export const SubscribeUpdateBlockMeta = { return { slot: isSet(object.slot) ? String(object.slot) : "0", blockhash: isSet(object.blockhash) ? String(object.blockhash) : "", - rewards: isSet(object.rewards) - ? Rewards.fromJSON(object.rewards) - : undefined, - blockTime: isSet(object.blockTime) - ? UnixTimestamp.fromJSON(object.blockTime) - : undefined, - blockHeight: isSet(object.blockHeight) - ? BlockHeight.fromJSON(object.blockHeight) - : undefined, + rewards: isSet(object.rewards) ? Rewards.fromJSON(object.rewards) : undefined, + blockTime: isSet(object.blockTime) ? UnixTimestamp.fromJSON(object.blockTime) : undefined, + blockHeight: isSet(object.blockHeight) ? BlockHeight.fromJSON(object.blockHeight) : undefined, parentSlot: isSet(object.parentSlot) ? String(object.parentSlot) : "0", - parentBlockhash: isSet(object.parentBlockhash) - ? String(object.parentBlockhash) - : "", - executedTransactionCount: isSet(object.executedTransactionCount) - ? String(object.executedTransactionCount) - : "0", - entriesCount: isSet(object.entriesCount) - ? String(object.entriesCount) - : "0", + parentBlockhash: isSet(object.parentBlockhash) ? String(object.parentBlockhash) : "", + executedTransactionCount: isSet(object.executedTransactionCount) ? String(object.executedTransactionCount) : "0", + entriesCount: isSet(object.entriesCount) ? String(object.entriesCount) : "0", }; }, @@ -3986,52 +3277,35 @@ export const SubscribeUpdateBlockMeta = { const obj: any = {}; message.slot !== undefined && (obj.slot = message.slot); message.blockhash !== undefined && (obj.blockhash = message.blockhash); - message.rewards !== undefined && - (obj.rewards = message.rewards - ? Rewards.toJSON(message.rewards) - : undefined); + message.rewards !== undefined && (obj.rewards = message.rewards ? Rewards.toJSON(message.rewards) : undefined); message.blockTime !== undefined && - (obj.blockTime = message.blockTime - ? UnixTimestamp.toJSON(message.blockTime) - : undefined); + (obj.blockTime = message.blockTime ? UnixTimestamp.toJSON(message.blockTime) : undefined); message.blockHeight !== undefined && - (obj.blockHeight = message.blockHeight - ? BlockHeight.toJSON(message.blockHeight) - : undefined); + (obj.blockHeight = message.blockHeight ? BlockHeight.toJSON(message.blockHeight) : undefined); message.parentSlot !== undefined && (obj.parentSlot = message.parentSlot); - message.parentBlockhash !== undefined && - (obj.parentBlockhash = message.parentBlockhash); - message.executedTransactionCount !== undefined && - (obj.executedTransactionCount = message.executedTransactionCount); - message.entriesCount !== undefined && - (obj.entriesCount = message.entriesCount); + message.parentBlockhash !== undefined && (obj.parentBlockhash = message.parentBlockhash); + message.executedTransactionCount !== undefined && (obj.executedTransactionCount = message.executedTransactionCount); + message.entriesCount !== undefined && (obj.entriesCount = message.entriesCount); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateBlockMeta { + create, I>>(base?: I): SubscribeUpdateBlockMeta { return SubscribeUpdateBlockMeta.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdateBlockMeta { + fromPartial, I>>(object: I): SubscribeUpdateBlockMeta { const message = createBaseSubscribeUpdateBlockMeta(); message.slot = object.slot ?? "0"; message.blockhash = object.blockhash ?? ""; - message.rewards = - object.rewards !== undefined && object.rewards !== null - ? Rewards.fromPartial(object.rewards) - : undefined; - message.blockTime = - object.blockTime !== undefined && object.blockTime !== null - ? UnixTimestamp.fromPartial(object.blockTime) - : undefined; - message.blockHeight = - object.blockHeight !== undefined && object.blockHeight !== null - ? BlockHeight.fromPartial(object.blockHeight) - : undefined; + message.rewards = (object.rewards !== undefined && object.rewards !== null) + ? Rewards.fromPartial(object.rewards) + : undefined; + message.blockTime = (object.blockTime !== undefined && object.blockTime !== null) + ? UnixTimestamp.fromPartial(object.blockTime) + : undefined; + message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) + ? BlockHeight.fromPartial(object.blockHeight) + : undefined; message.parentSlot = object.parentSlot ?? "0"; message.parentBlockhash = object.parentBlockhash ?? ""; message.executedTransactionCount = object.executedTransactionCount ?? "0"; @@ -4052,10 +3326,7 @@ function createBaseSubscribeUpdateEntry(): SubscribeUpdateEntry { } export const SubscribeUpdateEntry = { - encode( - message: SubscribeUpdateEntry, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdateEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -4077,12 +3348,8 @@ export const SubscribeUpdateEntry = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SubscribeUpdateEntry { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdateEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdateEntry(); while (reader.pos < end) { @@ -4121,18 +3388,14 @@ export const SubscribeUpdateEntry = { break; } - message.executedTransactionCount = longToString( - reader.uint64() as Long - ); + message.executedTransactionCount = longToString(reader.uint64() as Long); continue; case 6: if (tag !== 48) { break; } - message.startingTransactionIndex = longToString( - reader.uint64() as Long - ); + message.startingTransactionIndex = longToString(reader.uint64() as Long); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -4148,15 +3411,9 @@ export const SubscribeUpdateEntry = { slot: isSet(object.slot) ? String(object.slot) : "0", index: isSet(object.index) ? String(object.index) : "0", numHashes: isSet(object.numHashes) ? String(object.numHashes) : "0", - hash: isSet(object.hash) - ? bytesFromBase64(object.hash) - : new Uint8Array(0), - executedTransactionCount: isSet(object.executedTransactionCount) - ? String(object.executedTransactionCount) - : "0", - startingTransactionIndex: isSet(object.startingTransactionIndex) - ? String(object.startingTransactionIndex) - : "0", + hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(0), + executedTransactionCount: isSet(object.executedTransactionCount) ? String(object.executedTransactionCount) : "0", + startingTransactionIndex: isSet(object.startingTransactionIndex) ? String(object.startingTransactionIndex) : "0", }; }, @@ -4166,25 +3423,17 @@ export const SubscribeUpdateEntry = { message.index !== undefined && (obj.index = message.index); message.numHashes !== undefined && (obj.numHashes = message.numHashes); message.hash !== undefined && - (obj.hash = base64FromBytes( - message.hash !== undefined ? message.hash : new Uint8Array(0) - )); - message.executedTransactionCount !== undefined && - (obj.executedTransactionCount = message.executedTransactionCount); - message.startingTransactionIndex !== undefined && - (obj.startingTransactionIndex = message.startingTransactionIndex); + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array(0))); + message.executedTransactionCount !== undefined && (obj.executedTransactionCount = message.executedTransactionCount); + message.startingTransactionIndex !== undefined && (obj.startingTransactionIndex = message.startingTransactionIndex); return obj; }, - create, I>>( - base?: I - ): SubscribeUpdateEntry { + create, I>>(base?: I): SubscribeUpdateEntry { return SubscribeUpdateEntry.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdateEntry { + fromPartial, I>>(object: I): SubscribeUpdateEntry { const message = createBaseSubscribeUpdateEntry(); message.slot = object.slot ?? "0"; message.index = object.index ?? "0"; @@ -4201,16 +3450,12 @@ function createBaseSubscribeUpdatePing(): SubscribeUpdatePing { } export const SubscribeUpdatePing = { - encode( - _: SubscribeUpdatePing, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(_: SubscribeUpdatePing, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdatePing { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdatePing(); while (reader.pos < end) { @@ -4234,15 +3479,11 @@ export const SubscribeUpdatePing = { return obj; }, - create, I>>( - base?: I - ): SubscribeUpdatePing { + create, I>>(base?: I): SubscribeUpdatePing { return SubscribeUpdatePing.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I - ): SubscribeUpdatePing { + fromPartial, I>>(_: I): SubscribeUpdatePing { const message = createBaseSubscribeUpdatePing(); return message; }, @@ -4253,10 +3494,7 @@ function createBaseSubscribeUpdatePong(): SubscribeUpdatePong { } export const SubscribeUpdatePong = { - encode( - message: SubscribeUpdatePong, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: SubscribeUpdatePong, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.id !== 0) { writer.uint32(8).int32(message.id); } @@ -4264,8 +3502,7 @@ export const SubscribeUpdatePong = { }, decode(input: _m0.Reader | Uint8Array, length?: number): SubscribeUpdatePong { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubscribeUpdatePong(); while (reader.pos < end) { @@ -4297,15 +3534,11 @@ export const SubscribeUpdatePong = { return obj; }, - create, I>>( - base?: I - ): SubscribeUpdatePong { + create, I>>(base?: I): SubscribeUpdatePong { return SubscribeUpdatePong.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): SubscribeUpdatePong { + fromPartial, I>>(object: I): SubscribeUpdatePong { const message = createBaseSubscribeUpdatePong(); message.id = object.id ?? 0; return message; @@ -4317,10 +3550,7 @@ function createBasePingRequest(): PingRequest { } export const PingRequest = { - encode( - message: PingRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: PingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.count !== 0) { writer.uint32(8).int32(message.count); } @@ -4328,8 +3558,7 @@ export const PingRequest = { }, decode(input: _m0.Reader | Uint8Array, length?: number): PingRequest { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePingRequest(); while (reader.pos < end) { @@ -4365,9 +3594,7 @@ export const PingRequest = { return PingRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): PingRequest { + fromPartial, I>>(object: I): PingRequest { const message = createBasePingRequest(); message.count = object.count ?? 0; return message; @@ -4379,10 +3606,7 @@ function createBasePongResponse(): PongResponse { } export const PongResponse = { - encode( - message: PongResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: PongResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.count !== 0) { writer.uint32(8).int32(message.count); } @@ -4390,8 +3614,7 @@ export const PongResponse = { }, decode(input: _m0.Reader | Uint8Array, length?: number): PongResponse { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePongResponse(); while (reader.pos < end) { @@ -4423,15 +3646,11 @@ export const PongResponse = { return obj; }, - create, I>>( - base?: I - ): PongResponse { + create, I>>(base?: I): PongResponse { return PongResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): PongResponse { + fromPartial, I>>(object: I): PongResponse { const message = createBasePongResponse(); message.count = object.count ?? 0; return message; @@ -4443,22 +3662,15 @@ function createBaseGetLatestBlockhashRequest(): GetLatestBlockhashRequest { } export const GetLatestBlockhashRequest = { - encode( - message: GetLatestBlockhashRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: GetLatestBlockhashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.commitment !== undefined) { writer.uint32(8).int32(message.commitment); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): GetLatestBlockhashRequest { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockhashRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockhashRequest(); while (reader.pos < end) { @@ -4481,32 +3693,21 @@ export const GetLatestBlockhashRequest = { }, fromJSON(object: any): GetLatestBlockhashRequest { - return { - commitment: isSet(object.commitment) - ? commitmentLevelFromJSON(object.commitment) - : undefined, - }; + return { commitment: isSet(object.commitment) ? commitmentLevelFromJSON(object.commitment) : undefined }; }, toJSON(message: GetLatestBlockhashRequest): unknown { const obj: any = {}; message.commitment !== undefined && - (obj.commitment = - message.commitment !== undefined - ? commitmentLevelToJSON(message.commitment) - : undefined); + (obj.commitment = message.commitment !== undefined ? commitmentLevelToJSON(message.commitment) : undefined); return obj; }, - create, I>>( - base?: I - ): GetLatestBlockhashRequest { + create, I>>(base?: I): GetLatestBlockhashRequest { return GetLatestBlockhashRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): GetLatestBlockhashRequest { + fromPartial, I>>(object: I): GetLatestBlockhashRequest { const message = createBaseGetLatestBlockhashRequest(); message.commitment = object.commitment ?? undefined; return message; @@ -4518,10 +3719,7 @@ function createBaseGetLatestBlockhashResponse(): GetLatestBlockhashResponse { } export const GetLatestBlockhashResponse = { - encode( - message: GetLatestBlockhashResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: GetLatestBlockhashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -4534,12 +3732,8 @@ export const GetLatestBlockhashResponse = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): GetLatestBlockhashResponse { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockhashResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockhashResponse(); while (reader.pos < end) { @@ -4579,9 +3773,7 @@ export const GetLatestBlockhashResponse = { return { slot: isSet(object.slot) ? String(object.slot) : "0", blockhash: isSet(object.blockhash) ? String(object.blockhash) : "", - lastValidBlockHeight: isSet(object.lastValidBlockHeight) - ? String(object.lastValidBlockHeight) - : "0", + lastValidBlockHeight: isSet(object.lastValidBlockHeight) ? String(object.lastValidBlockHeight) : "0", }; }, @@ -4589,20 +3781,15 @@ export const GetLatestBlockhashResponse = { const obj: any = {}; message.slot !== undefined && (obj.slot = message.slot); message.blockhash !== undefined && (obj.blockhash = message.blockhash); - message.lastValidBlockHeight !== undefined && - (obj.lastValidBlockHeight = message.lastValidBlockHeight); + message.lastValidBlockHeight !== undefined && (obj.lastValidBlockHeight = message.lastValidBlockHeight); return obj; }, - create, I>>( - base?: I - ): GetLatestBlockhashResponse { + create, I>>(base?: I): GetLatestBlockhashResponse { return GetLatestBlockhashResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): GetLatestBlockhashResponse { + fromPartial, I>>(object: I): GetLatestBlockhashResponse { const message = createBaseGetLatestBlockhashResponse(); message.slot = object.slot ?? "0"; message.blockhash = object.blockhash ?? ""; @@ -4616,22 +3803,15 @@ function createBaseGetBlockHeightRequest(): GetBlockHeightRequest { } export const GetBlockHeightRequest = { - encode( - message: GetBlockHeightRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: GetBlockHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.commitment !== undefined) { writer.uint32(8).int32(message.commitment); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): GetBlockHeightRequest { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockHeightRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockHeightRequest(); while (reader.pos < end) { @@ -4654,32 +3834,21 @@ export const GetBlockHeightRequest = { }, fromJSON(object: any): GetBlockHeightRequest { - return { - commitment: isSet(object.commitment) - ? commitmentLevelFromJSON(object.commitment) - : undefined, - }; + return { commitment: isSet(object.commitment) ? commitmentLevelFromJSON(object.commitment) : undefined }; }, toJSON(message: GetBlockHeightRequest): unknown { const obj: any = {}; message.commitment !== undefined && - (obj.commitment = - message.commitment !== undefined - ? commitmentLevelToJSON(message.commitment) - : undefined); + (obj.commitment = message.commitment !== undefined ? commitmentLevelToJSON(message.commitment) : undefined); return obj; }, - create, I>>( - base?: I - ): GetBlockHeightRequest { + create, I>>(base?: I): GetBlockHeightRequest { return GetBlockHeightRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): GetBlockHeightRequest { + fromPartial, I>>(object: I): GetBlockHeightRequest { const message = createBaseGetBlockHeightRequest(); message.commitment = object.commitment ?? undefined; return message; @@ -4691,22 +3860,15 @@ function createBaseGetBlockHeightResponse(): GetBlockHeightResponse { } export const GetBlockHeightResponse = { - encode( - message: GetBlockHeightResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: GetBlockHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.blockHeight !== "0") { writer.uint32(8).uint64(message.blockHeight); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): GetBlockHeightResponse { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockHeightResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockHeightResponse(); while (reader.pos < end) { @@ -4729,27 +3891,20 @@ export const GetBlockHeightResponse = { }, fromJSON(object: any): GetBlockHeightResponse { - return { - blockHeight: isSet(object.blockHeight) ? String(object.blockHeight) : "0", - }; + return { blockHeight: isSet(object.blockHeight) ? String(object.blockHeight) : "0" }; }, toJSON(message: GetBlockHeightResponse): unknown { const obj: any = {}; - message.blockHeight !== undefined && - (obj.blockHeight = message.blockHeight); + message.blockHeight !== undefined && (obj.blockHeight = message.blockHeight); return obj; }, - create, I>>( - base?: I - ): GetBlockHeightResponse { + create, I>>(base?: I): GetBlockHeightResponse { return GetBlockHeightResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): GetBlockHeightResponse { + fromPartial, I>>(object: I): GetBlockHeightResponse { const message = createBaseGetBlockHeightResponse(); message.blockHeight = object.blockHeight ?? "0"; return message; @@ -4761,10 +3916,7 @@ function createBaseGetSlotRequest(): GetSlotRequest { } export const GetSlotRequest = { - encode( - message: GetSlotRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: GetSlotRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.commitment !== undefined) { writer.uint32(8).int32(message.commitment); } @@ -4772,8 +3924,7 @@ export const GetSlotRequest = { }, decode(input: _m0.Reader | Uint8Array, length?: number): GetSlotRequest { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSlotRequest(); while (reader.pos < end) { @@ -4796,32 +3947,21 @@ export const GetSlotRequest = { }, fromJSON(object: any): GetSlotRequest { - return { - commitment: isSet(object.commitment) - ? commitmentLevelFromJSON(object.commitment) - : undefined, - }; + return { commitment: isSet(object.commitment) ? commitmentLevelFromJSON(object.commitment) : undefined }; }, toJSON(message: GetSlotRequest): unknown { const obj: any = {}; message.commitment !== undefined && - (obj.commitment = - message.commitment !== undefined - ? commitmentLevelToJSON(message.commitment) - : undefined); + (obj.commitment = message.commitment !== undefined ? commitmentLevelToJSON(message.commitment) : undefined); return obj; }, - create, I>>( - base?: I - ): GetSlotRequest { + create, I>>(base?: I): GetSlotRequest { return GetSlotRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): GetSlotRequest { + fromPartial, I>>(object: I): GetSlotRequest { const message = createBaseGetSlotRequest(); message.commitment = object.commitment ?? undefined; return message; @@ -4833,10 +3973,7 @@ function createBaseGetSlotResponse(): GetSlotResponse { } export const GetSlotResponse = { - encode( - message: GetSlotResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: GetSlotResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -4844,8 +3981,7 @@ export const GetSlotResponse = { }, decode(input: _m0.Reader | Uint8Array, length?: number): GetSlotResponse { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSlotResponse(); while (reader.pos < end) { @@ -4877,15 +4013,11 @@ export const GetSlotResponse = { return obj; }, - create, I>>( - base?: I - ): GetSlotResponse { + create, I>>(base?: I): GetSlotResponse { return GetSlotResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): GetSlotResponse { + fromPartial, I>>(object: I): GetSlotResponse { const message = createBaseGetSlotResponse(); message.slot = object.slot ?? "0"; return message; @@ -4897,16 +4029,12 @@ function createBaseGetVersionRequest(): GetVersionRequest { } export const GetVersionRequest = { - encode( - _: GetVersionRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(_: GetVersionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GetVersionRequest { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetVersionRequest(); while (reader.pos < end) { @@ -4930,15 +4058,11 @@ export const GetVersionRequest = { return obj; }, - create, I>>( - base?: I - ): GetVersionRequest { + create, I>>(base?: I): GetVersionRequest { return GetVersionRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - _: I - ): GetVersionRequest { + fromPartial, I>>(_: I): GetVersionRequest { const message = createBaseGetVersionRequest(); return message; }, @@ -4949,10 +4073,7 @@ function createBaseGetVersionResponse(): GetVersionResponse { } export const GetVersionResponse = { - encode( - message: GetVersionResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: GetVersionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.version !== "") { writer.uint32(10).string(message.version); } @@ -4960,8 +4081,7 @@ export const GetVersionResponse = { }, decode(input: _m0.Reader | Uint8Array, length?: number): GetVersionResponse { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetVersionResponse(); while (reader.pos < end) { @@ -4993,15 +4113,11 @@ export const GetVersionResponse = { return obj; }, - create, I>>( - base?: I - ): GetVersionResponse { + create, I>>(base?: I): GetVersionResponse { return GetVersionResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): GetVersionResponse { + fromPartial, I>>(object: I): GetVersionResponse { const message = createBaseGetVersionResponse(); message.version = object.version ?? ""; return message; @@ -5013,10 +4129,7 @@ function createBaseIsBlockhashValidRequest(): IsBlockhashValidRequest { } export const IsBlockhashValidRequest = { - encode( - message: IsBlockhashValidRequest, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: IsBlockhashValidRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.blockhash !== "") { writer.uint32(10).string(message.blockhash); } @@ -5026,12 +4139,8 @@ export const IsBlockhashValidRequest = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): IsBlockhashValidRequest { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): IsBlockhashValidRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIsBlockhashValidRequest(); while (reader.pos < end) { @@ -5063,9 +4172,7 @@ export const IsBlockhashValidRequest = { fromJSON(object: any): IsBlockhashValidRequest { return { blockhash: isSet(object.blockhash) ? String(object.blockhash) : "", - commitment: isSet(object.commitment) - ? commitmentLevelFromJSON(object.commitment) - : undefined, + commitment: isSet(object.commitment) ? commitmentLevelFromJSON(object.commitment) : undefined, }; }, @@ -5073,22 +4180,15 @@ export const IsBlockhashValidRequest = { const obj: any = {}; message.blockhash !== undefined && (obj.blockhash = message.blockhash); message.commitment !== undefined && - (obj.commitment = - message.commitment !== undefined - ? commitmentLevelToJSON(message.commitment) - : undefined); + (obj.commitment = message.commitment !== undefined ? commitmentLevelToJSON(message.commitment) : undefined); return obj; }, - create, I>>( - base?: I - ): IsBlockhashValidRequest { + create, I>>(base?: I): IsBlockhashValidRequest { return IsBlockhashValidRequest.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): IsBlockhashValidRequest { + fromPartial, I>>(object: I): IsBlockhashValidRequest { const message = createBaseIsBlockhashValidRequest(); message.blockhash = object.blockhash ?? ""; message.commitment = object.commitment ?? undefined; @@ -5101,10 +4201,7 @@ function createBaseIsBlockhashValidResponse(): IsBlockhashValidResponse { } export const IsBlockhashValidResponse = { - encode( - message: IsBlockhashValidResponse, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: IsBlockhashValidResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.slot !== "0") { writer.uint32(8).uint64(message.slot); } @@ -5114,12 +4211,8 @@ export const IsBlockhashValidResponse = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): IsBlockhashValidResponse { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): IsBlockhashValidResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIsBlockhashValidResponse(); while (reader.pos < end) { @@ -5162,15 +4255,11 @@ export const IsBlockhashValidResponse = { return obj; }, - create, I>>( - base?: I - ): IsBlockhashValidResponse { + create, I>>(base?: I): IsBlockhashValidResponse { return IsBlockhashValidResponse.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): IsBlockhashValidResponse { + fromPartial, I>>(object: I): IsBlockhashValidResponse { const message = createBaseIsBlockhashValidResponse(); message.slot = object.slot ?? "0"; message.valid = object.valid ?? false; @@ -5184,22 +4273,18 @@ export const GeyserService = { path: "/geyser.Geyser/Subscribe", requestStream: true, responseStream: true, - requestSerialize: (value: SubscribeRequest) => - Buffer.from(SubscribeRequest.encode(value).finish()), + requestSerialize: (value: SubscribeRequest) => Buffer.from(SubscribeRequest.encode(value).finish()), requestDeserialize: (value: Buffer) => SubscribeRequest.decode(value), - responseSerialize: (value: SubscribeUpdate) => - Buffer.from(SubscribeUpdate.encode(value).finish()), + responseSerialize: (value: SubscribeUpdate) => Buffer.from(SubscribeUpdate.encode(value).finish()), responseDeserialize: (value: Buffer) => SubscribeUpdate.decode(value), }, ping: { path: "/geyser.Geyser/Ping", requestStream: false, responseStream: false, - requestSerialize: (value: PingRequest) => - Buffer.from(PingRequest.encode(value).finish()), + requestSerialize: (value: PingRequest) => Buffer.from(PingRequest.encode(value).finish()), requestDeserialize: (value: Buffer) => PingRequest.decode(value), - responseSerialize: (value: PongResponse) => - Buffer.from(PongResponse.encode(value).finish()), + responseSerialize: (value: PongResponse) => Buffer.from(PongResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => PongResponse.decode(value), }, getLatestBlockhash: { @@ -5208,58 +4293,46 @@ export const GeyserService = { responseStream: false, requestSerialize: (value: GetLatestBlockhashRequest) => Buffer.from(GetLatestBlockhashRequest.encode(value).finish()), - requestDeserialize: (value: Buffer) => - GetLatestBlockhashRequest.decode(value), + requestDeserialize: (value: Buffer) => GetLatestBlockhashRequest.decode(value), responseSerialize: (value: GetLatestBlockhashResponse) => Buffer.from(GetLatestBlockhashResponse.encode(value).finish()), - responseDeserialize: (value: Buffer) => - GetLatestBlockhashResponse.decode(value), + responseDeserialize: (value: Buffer) => GetLatestBlockhashResponse.decode(value), }, getBlockHeight: { path: "/geyser.Geyser/GetBlockHeight", requestStream: false, responseStream: false, - requestSerialize: (value: GetBlockHeightRequest) => - Buffer.from(GetBlockHeightRequest.encode(value).finish()), + requestSerialize: (value: GetBlockHeightRequest) => Buffer.from(GetBlockHeightRequest.encode(value).finish()), requestDeserialize: (value: Buffer) => GetBlockHeightRequest.decode(value), - responseSerialize: (value: GetBlockHeightResponse) => - Buffer.from(GetBlockHeightResponse.encode(value).finish()), - responseDeserialize: (value: Buffer) => - GetBlockHeightResponse.decode(value), + responseSerialize: (value: GetBlockHeightResponse) => Buffer.from(GetBlockHeightResponse.encode(value).finish()), + responseDeserialize: (value: Buffer) => GetBlockHeightResponse.decode(value), }, getSlot: { path: "/geyser.Geyser/GetSlot", requestStream: false, responseStream: false, - requestSerialize: (value: GetSlotRequest) => - Buffer.from(GetSlotRequest.encode(value).finish()), + requestSerialize: (value: GetSlotRequest) => Buffer.from(GetSlotRequest.encode(value).finish()), requestDeserialize: (value: Buffer) => GetSlotRequest.decode(value), - responseSerialize: (value: GetSlotResponse) => - Buffer.from(GetSlotResponse.encode(value).finish()), + responseSerialize: (value: GetSlotResponse) => Buffer.from(GetSlotResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => GetSlotResponse.decode(value), }, isBlockhashValid: { path: "/geyser.Geyser/IsBlockhashValid", requestStream: false, responseStream: false, - requestSerialize: (value: IsBlockhashValidRequest) => - Buffer.from(IsBlockhashValidRequest.encode(value).finish()), - requestDeserialize: (value: Buffer) => - IsBlockhashValidRequest.decode(value), + requestSerialize: (value: IsBlockhashValidRequest) => Buffer.from(IsBlockhashValidRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => IsBlockhashValidRequest.decode(value), responseSerialize: (value: IsBlockhashValidResponse) => Buffer.from(IsBlockhashValidResponse.encode(value).finish()), - responseDeserialize: (value: Buffer) => - IsBlockhashValidResponse.decode(value), + responseDeserialize: (value: Buffer) => IsBlockhashValidResponse.decode(value), }, getVersion: { path: "/geyser.Geyser/GetVersion", requestStream: false, responseStream: false, - requestSerialize: (value: GetVersionRequest) => - Buffer.from(GetVersionRequest.encode(value).finish()), + requestSerialize: (value: GetVersionRequest) => Buffer.from(GetVersionRequest.encode(value).finish()), requestDeserialize: (value: Buffer) => GetVersionRequest.decode(value), - responseSerialize: (value: GetVersionResponse) => - Buffer.from(GetVersionResponse.encode(value).finish()), + responseSerialize: (value: GetVersionResponse) => Buffer.from(GetVersionResponse.encode(value).finish()), responseDeserialize: (value: Buffer) => GetVersionResponse.decode(value), }, } as const; @@ -5267,159 +4340,108 @@ export const GeyserService = { export interface GeyserServer extends UntypedServiceImplementation { subscribe: handleBidiStreamingCall; ping: handleUnaryCall; - getLatestBlockhash: handleUnaryCall< - GetLatestBlockhashRequest, - GetLatestBlockhashResponse - >; - getBlockHeight: handleUnaryCall< - GetBlockHeightRequest, - GetBlockHeightResponse - >; + getLatestBlockhash: handleUnaryCall; + getBlockHeight: handleUnaryCall; getSlot: handleUnaryCall; - isBlockhashValid: handleUnaryCall< - IsBlockhashValidRequest, - IsBlockhashValidResponse - >; + isBlockhashValid: handleUnaryCall; getVersion: handleUnaryCall; } export interface GeyserClient extends Client { subscribe(): ClientDuplexStream; - subscribe( - options: Partial - ): ClientDuplexStream; - subscribe( - metadata: Metadata, - options?: Partial - ): ClientDuplexStream; - ping( - request: PingRequest, - callback: (error: ServiceError | null, response: PongResponse) => void - ): ClientUnaryCall; + subscribe(options: Partial): ClientDuplexStream; + subscribe(metadata: Metadata, options?: Partial): ClientDuplexStream; + ping(request: PingRequest, callback: (error: ServiceError | null, response: PongResponse) => void): ClientUnaryCall; ping( request: PingRequest, metadata: Metadata, - callback: (error: ServiceError | null, response: PongResponse) => void + callback: (error: ServiceError | null, response: PongResponse) => void, ): ClientUnaryCall; ping( request: PingRequest, metadata: Metadata, options: Partial, - callback: (error: ServiceError | null, response: PongResponse) => void + callback: (error: ServiceError | null, response: PongResponse) => void, ): ClientUnaryCall; getLatestBlockhash( request: GetLatestBlockhashRequest, - callback: ( - error: ServiceError | null, - response: GetLatestBlockhashResponse - ) => void + callback: (error: ServiceError | null, response: GetLatestBlockhashResponse) => void, ): ClientUnaryCall; getLatestBlockhash( request: GetLatestBlockhashRequest, metadata: Metadata, - callback: ( - error: ServiceError | null, - response: GetLatestBlockhashResponse - ) => void + callback: (error: ServiceError | null, response: GetLatestBlockhashResponse) => void, ): ClientUnaryCall; getLatestBlockhash( request: GetLatestBlockhashRequest, metadata: Metadata, options: Partial, - callback: ( - error: ServiceError | null, - response: GetLatestBlockhashResponse - ) => void + callback: (error: ServiceError | null, response: GetLatestBlockhashResponse) => void, ): ClientUnaryCall; getBlockHeight( request: GetBlockHeightRequest, - callback: ( - error: ServiceError | null, - response: GetBlockHeightResponse - ) => void + callback: (error: ServiceError | null, response: GetBlockHeightResponse) => void, ): ClientUnaryCall; getBlockHeight( request: GetBlockHeightRequest, metadata: Metadata, - callback: ( - error: ServiceError | null, - response: GetBlockHeightResponse - ) => void + callback: (error: ServiceError | null, response: GetBlockHeightResponse) => void, ): ClientUnaryCall; getBlockHeight( request: GetBlockHeightRequest, metadata: Metadata, options: Partial, - callback: ( - error: ServiceError | null, - response: GetBlockHeightResponse - ) => void + callback: (error: ServiceError | null, response: GetBlockHeightResponse) => void, ): ClientUnaryCall; getSlot( request: GetSlotRequest, - callback: (error: ServiceError | null, response: GetSlotResponse) => void + callback: (error: ServiceError | null, response: GetSlotResponse) => void, ): ClientUnaryCall; getSlot( request: GetSlotRequest, metadata: Metadata, - callback: (error: ServiceError | null, response: GetSlotResponse) => void + callback: (error: ServiceError | null, response: GetSlotResponse) => void, ): ClientUnaryCall; getSlot( request: GetSlotRequest, metadata: Metadata, options: Partial, - callback: (error: ServiceError | null, response: GetSlotResponse) => void + callback: (error: ServiceError | null, response: GetSlotResponse) => void, ): ClientUnaryCall; isBlockhashValid( request: IsBlockhashValidRequest, - callback: ( - error: ServiceError | null, - response: IsBlockhashValidResponse - ) => void + callback: (error: ServiceError | null, response: IsBlockhashValidResponse) => void, ): ClientUnaryCall; isBlockhashValid( request: IsBlockhashValidRequest, metadata: Metadata, - callback: ( - error: ServiceError | null, - response: IsBlockhashValidResponse - ) => void + callback: (error: ServiceError | null, response: IsBlockhashValidResponse) => void, ): ClientUnaryCall; isBlockhashValid( request: IsBlockhashValidRequest, metadata: Metadata, options: Partial, - callback: ( - error: ServiceError | null, - response: IsBlockhashValidResponse - ) => void + callback: (error: ServiceError | null, response: IsBlockhashValidResponse) => void, ): ClientUnaryCall; getVersion( request: GetVersionRequest, - callback: (error: ServiceError | null, response: GetVersionResponse) => void + callback: (error: ServiceError | null, response: GetVersionResponse) => void, ): ClientUnaryCall; getVersion( request: GetVersionRequest, metadata: Metadata, - callback: (error: ServiceError | null, response: GetVersionResponse) => void + callback: (error: ServiceError | null, response: GetVersionResponse) => void, ): ClientUnaryCall; getVersion( request: GetVersionRequest, metadata: Metadata, options: Partial, - callback: (error: ServiceError | null, response: GetVersionResponse) => void + callback: (error: ServiceError | null, response: GetVersionResponse) => void, ): ClientUnaryCall; } -export const GeyserClient = makeGenericClientConstructor( - GeyserService, - "geyser.Geyser" -) as unknown as { - new ( - address: string, - credentials: ChannelCredentials, - options?: Partial - ): GeyserClient; +export const GeyserClient = makeGenericClientConstructor(GeyserService, "geyser.Geyser") as unknown as { + new (address: string, credentials: ChannelCredentials, options?: Partial): GeyserClient; service: typeof GeyserService; }; @@ -5467,31 +4489,16 @@ function base64FromBytes(arr: Uint8Array): string { } } -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function longToString(long: Long) { return long.toString(); diff --git a/yellowstone-grpc-client-nodejs/src/grpc/solana-storage.ts b/yellowstone-grpc-client-nodejs/src/grpc/solana-storage.ts index 1014cc69..0a089228 100644 --- a/yellowstone-grpc-client-nodejs/src/grpc/solana-storage.ts +++ b/yellowstone-grpc-client-nodejs/src/grpc/solana-storage.ts @@ -63,6 +63,7 @@ export interface ConfirmedBlock { rewards: Reward[]; blockTime: UnixTimestamp | undefined; blockHeight: BlockHeight | undefined; + numPartitions: NumPartitions | undefined; } export interface ConfirmedTransaction { @@ -177,6 +178,7 @@ export interface Reward { export interface Rewards { rewards: Reward[]; + numPartitions: NumPartitions | undefined; } export interface UnixTimestamp { @@ -187,6 +189,10 @@ export interface BlockHeight { blockHeight: string; } +export interface NumPartitions { + numPartitions: string; +} + function createBaseConfirmedBlock(): ConfirmedBlock { return { previousBlockhash: "", @@ -196,14 +202,12 @@ function createBaseConfirmedBlock(): ConfirmedBlock { rewards: [], blockTime: undefined, blockHeight: undefined, + numPartitions: undefined, }; } export const ConfirmedBlock = { - encode( - message: ConfirmedBlock, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: ConfirmedBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.previousBlockhash !== "") { writer.uint32(10).string(message.previousBlockhash); } @@ -220,23 +224,19 @@ export const ConfirmedBlock = { Reward.encode(v!, writer.uint32(42).fork()).ldelim(); } if (message.blockTime !== undefined) { - UnixTimestamp.encode( - message.blockTime, - writer.uint32(50).fork() - ).ldelim(); + UnixTimestamp.encode(message.blockTime, writer.uint32(50).fork()).ldelim(); } if (message.blockHeight !== undefined) { - BlockHeight.encode( - message.blockHeight, - writer.uint32(58).fork() - ).ldelim(); + BlockHeight.encode(message.blockHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.numPartitions !== undefined) { + NumPartitions.encode(message.numPartitions, writer.uint32(66).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ConfirmedBlock { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfirmedBlock(); while (reader.pos < end) { @@ -268,9 +268,7 @@ export const ConfirmedBlock = { break; } - message.transactions.push( - ConfirmedTransaction.decode(reader, reader.uint32()) - ); + message.transactions.push(ConfirmedTransaction.decode(reader, reader.uint32())); continue; case 5: if (tag !== 42) { @@ -293,6 +291,13 @@ export const ConfirmedBlock = { message.blockHeight = BlockHeight.decode(reader, reader.uint32()); continue; + case 8: + if (tag !== 66) { + break; + } + + message.numPartitions = NumPartitions.decode(reader, reader.uint32()); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -304,82 +309,63 @@ export const ConfirmedBlock = { fromJSON(object: any): ConfirmedBlock { return { - previousBlockhash: isSet(object.previousBlockhash) - ? String(object.previousBlockhash) - : "", + previousBlockhash: isSet(object.previousBlockhash) ? String(object.previousBlockhash) : "", blockhash: isSet(object.blockhash) ? String(object.blockhash) : "", parentSlot: isSet(object.parentSlot) ? String(object.parentSlot) : "0", transactions: Array.isArray(object?.transactions) ? object.transactions.map((e: any) => ConfirmedTransaction.fromJSON(e)) : [], - rewards: Array.isArray(object?.rewards) - ? object.rewards.map((e: any) => Reward.fromJSON(e)) - : [], - blockTime: isSet(object.blockTime) - ? UnixTimestamp.fromJSON(object.blockTime) - : undefined, - blockHeight: isSet(object.blockHeight) - ? BlockHeight.fromJSON(object.blockHeight) - : undefined, + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => Reward.fromJSON(e)) : [], + blockTime: isSet(object.blockTime) ? UnixTimestamp.fromJSON(object.blockTime) : undefined, + blockHeight: isSet(object.blockHeight) ? BlockHeight.fromJSON(object.blockHeight) : undefined, + numPartitions: isSet(object.numPartitions) ? NumPartitions.fromJSON(object.numPartitions) : undefined, }; }, toJSON(message: ConfirmedBlock): unknown { const obj: any = {}; - message.previousBlockhash !== undefined && - (obj.previousBlockhash = message.previousBlockhash); + message.previousBlockhash !== undefined && (obj.previousBlockhash = message.previousBlockhash); message.blockhash !== undefined && (obj.blockhash = message.blockhash); message.parentSlot !== undefined && (obj.parentSlot = message.parentSlot); if (message.transactions) { - obj.transactions = message.transactions.map((e) => - e ? ConfirmedTransaction.toJSON(e) : undefined - ); + obj.transactions = message.transactions.map((e) => e ? ConfirmedTransaction.toJSON(e) : undefined); } else { obj.transactions = []; } if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? Reward.toJSON(e) : undefined - ); + obj.rewards = message.rewards.map((e) => e ? Reward.toJSON(e) : undefined); } else { obj.rewards = []; } message.blockTime !== undefined && - (obj.blockTime = message.blockTime - ? UnixTimestamp.toJSON(message.blockTime) - : undefined); + (obj.blockTime = message.blockTime ? UnixTimestamp.toJSON(message.blockTime) : undefined); message.blockHeight !== undefined && - (obj.blockHeight = message.blockHeight - ? BlockHeight.toJSON(message.blockHeight) - : undefined); + (obj.blockHeight = message.blockHeight ? BlockHeight.toJSON(message.blockHeight) : undefined); + message.numPartitions !== undefined && + (obj.numPartitions = message.numPartitions ? NumPartitions.toJSON(message.numPartitions) : undefined); return obj; }, - create, I>>( - base?: I - ): ConfirmedBlock { + create, I>>(base?: I): ConfirmedBlock { return ConfirmedBlock.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): ConfirmedBlock { + fromPartial, I>>(object: I): ConfirmedBlock { const message = createBaseConfirmedBlock(); message.previousBlockhash = object.previousBlockhash ?? ""; message.blockhash = object.blockhash ?? ""; message.parentSlot = object.parentSlot ?? "0"; - message.transactions = - object.transactions?.map((e) => ConfirmedTransaction.fromPartial(e)) || - []; + message.transactions = object.transactions?.map((e) => ConfirmedTransaction.fromPartial(e)) || []; message.rewards = object.rewards?.map((e) => Reward.fromPartial(e)) || []; - message.blockTime = - object.blockTime !== undefined && object.blockTime !== null - ? UnixTimestamp.fromPartial(object.blockTime) - : undefined; - message.blockHeight = - object.blockHeight !== undefined && object.blockHeight !== null - ? BlockHeight.fromPartial(object.blockHeight) - : undefined; + message.blockTime = (object.blockTime !== undefined && object.blockTime !== null) + ? UnixTimestamp.fromPartial(object.blockTime) + : undefined; + message.blockHeight = (object.blockHeight !== undefined && object.blockHeight !== null) + ? BlockHeight.fromPartial(object.blockHeight) + : undefined; + message.numPartitions = (object.numPartitions !== undefined && object.numPartitions !== null) + ? NumPartitions.fromPartial(object.numPartitions) + : undefined; return message; }, }; @@ -389,31 +375,18 @@ function createBaseConfirmedTransaction(): ConfirmedTransaction { } export const ConfirmedTransaction = { - encode( - message: ConfirmedTransaction, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: ConfirmedTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.transaction !== undefined) { - Transaction.encode( - message.transaction, - writer.uint32(10).fork() - ).ldelim(); + Transaction.encode(message.transaction, writer.uint32(10).fork()).ldelim(); } if (message.meta !== undefined) { - TransactionStatusMeta.encode( - message.meta, - writer.uint32(18).fork() - ).ldelim(); + TransactionStatusMeta.encode(message.meta, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): ConfirmedTransaction { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): ConfirmedTransaction { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfirmedTransaction(); while (reader.pos < end) { @@ -444,46 +417,31 @@ export const ConfirmedTransaction = { fromJSON(object: any): ConfirmedTransaction { return { - transaction: isSet(object.transaction) - ? Transaction.fromJSON(object.transaction) - : undefined, - meta: isSet(object.meta) - ? TransactionStatusMeta.fromJSON(object.meta) - : undefined, + transaction: isSet(object.transaction) ? Transaction.fromJSON(object.transaction) : undefined, + meta: isSet(object.meta) ? TransactionStatusMeta.fromJSON(object.meta) : undefined, }; }, toJSON(message: ConfirmedTransaction): unknown { const obj: any = {}; message.transaction !== undefined && - (obj.transaction = message.transaction - ? Transaction.toJSON(message.transaction) - : undefined); - message.meta !== undefined && - (obj.meta = message.meta - ? TransactionStatusMeta.toJSON(message.meta) - : undefined); + (obj.transaction = message.transaction ? Transaction.toJSON(message.transaction) : undefined); + message.meta !== undefined && (obj.meta = message.meta ? TransactionStatusMeta.toJSON(message.meta) : undefined); return obj; }, - create, I>>( - base?: I - ): ConfirmedTransaction { + create, I>>(base?: I): ConfirmedTransaction { return ConfirmedTransaction.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): ConfirmedTransaction { + fromPartial, I>>(object: I): ConfirmedTransaction { const message = createBaseConfirmedTransaction(); - message.transaction = - object.transaction !== undefined && object.transaction !== null - ? Transaction.fromPartial(object.transaction) - : undefined; - message.meta = - object.meta !== undefined && object.meta !== null - ? TransactionStatusMeta.fromPartial(object.meta) - : undefined; + message.transaction = (object.transaction !== undefined && object.transaction !== null) + ? Transaction.fromPartial(object.transaction) + : undefined; + message.meta = (object.meta !== undefined && object.meta !== null) + ? TransactionStatusMeta.fromPartial(object.meta) + : undefined; return message; }, }; @@ -493,10 +451,7 @@ function createBaseTransaction(): Transaction { } export const Transaction = { - encode( - message: Transaction, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: Transaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.signatures) { writer.uint32(10).bytes(v!); } @@ -507,8 +462,7 @@ export const Transaction = { }, decode(input: _m0.Reader | Uint8Array, length?: number): Transaction { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTransaction(); while (reader.pos < end) { @@ -539,28 +493,19 @@ export const Transaction = { fromJSON(object: any): Transaction { return { - signatures: Array.isArray(object?.signatures) - ? object.signatures.map((e: any) => bytesFromBase64(e)) - : [], - message: isSet(object.message) - ? Message.fromJSON(object.message) - : undefined, + signatures: Array.isArray(object?.signatures) ? object.signatures.map((e: any) => bytesFromBase64(e)) : [], + message: isSet(object.message) ? Message.fromJSON(object.message) : undefined, }; }, toJSON(message: Transaction): unknown { const obj: any = {}; if (message.signatures) { - obj.signatures = message.signatures.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array(0)) - ); + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array(0))); } else { obj.signatures = []; } - message.message !== undefined && - (obj.message = message.message - ? Message.toJSON(message.message) - : undefined); + message.message !== undefined && (obj.message = message.message ? Message.toJSON(message.message) : undefined); return obj; }, @@ -568,15 +513,12 @@ export const Transaction = { return Transaction.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): Transaction { + fromPartial, I>>(object: I): Transaction { const message = createBaseTransaction(); message.signatures = object.signatures?.map((e) => e) || []; - message.message = - object.message !== undefined && object.message !== null - ? Message.fromPartial(object.message) - : undefined; + message.message = (object.message !== undefined && object.message !== null) + ? Message.fromPartial(object.message) + : undefined; return message; }, }; @@ -593,10 +535,7 @@ function createBaseMessage(): Message { } export const Message = { - encode( - message: Message, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: Message, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.header !== undefined) { MessageHeader.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -619,8 +558,7 @@ export const Message = { }, decode(input: _m0.Reader | Uint8Array, length?: number): Message { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMessage(); while (reader.pos < end) { @@ -652,9 +590,7 @@ export const Message = { break; } - message.instructions.push( - CompiledInstruction.decode(reader, reader.uint32()) - ); + message.instructions.push(CompiledInstruction.decode(reader, reader.uint32())); continue; case 5: if (tag !== 40) { @@ -668,9 +604,7 @@ export const Message = { break; } - message.addressTableLookups.push( - MessageAddressTableLookup.decode(reader, reader.uint32()) - ); + message.addressTableLookups.push(MessageAddressTableLookup.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -683,50 +617,33 @@ export const Message = { fromJSON(object: any): Message { return { - header: isSet(object.header) - ? MessageHeader.fromJSON(object.header) - : undefined, - accountKeys: Array.isArray(object?.accountKeys) - ? object.accountKeys.map((e: any) => bytesFromBase64(e)) - : [], - recentBlockhash: isSet(object.recentBlockhash) - ? bytesFromBase64(object.recentBlockhash) - : new Uint8Array(0), + header: isSet(object.header) ? MessageHeader.fromJSON(object.header) : undefined, + accountKeys: Array.isArray(object?.accountKeys) ? object.accountKeys.map((e: any) => bytesFromBase64(e)) : [], + recentBlockhash: isSet(object.recentBlockhash) ? bytesFromBase64(object.recentBlockhash) : new Uint8Array(0), instructions: Array.isArray(object?.instructions) ? object.instructions.map((e: any) => CompiledInstruction.fromJSON(e)) : [], versioned: isSet(object.versioned) ? Boolean(object.versioned) : false, addressTableLookups: Array.isArray(object?.addressTableLookups) - ? object.addressTableLookups.map((e: any) => - MessageAddressTableLookup.fromJSON(e) - ) + ? object.addressTableLookups.map((e: any) => MessageAddressTableLookup.fromJSON(e)) : [], }; }, toJSON(message: Message): unknown { const obj: any = {}; - message.header !== undefined && - (obj.header = message.header - ? MessageHeader.toJSON(message.header) - : undefined); + message.header !== undefined && (obj.header = message.header ? MessageHeader.toJSON(message.header) : undefined); if (message.accountKeys) { - obj.accountKeys = message.accountKeys.map((e) => - base64FromBytes(e !== undefined ? e : new Uint8Array(0)) - ); + obj.accountKeys = message.accountKeys.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array(0))); } else { obj.accountKeys = []; } message.recentBlockhash !== undefined && (obj.recentBlockhash = base64FromBytes( - message.recentBlockhash !== undefined - ? message.recentBlockhash - : new Uint8Array(0) + message.recentBlockhash !== undefined ? message.recentBlockhash : new Uint8Array(0), )); if (message.instructions) { - obj.instructions = message.instructions.map((e) => - e ? CompiledInstruction.toJSON(e) : undefined - ); + obj.instructions = message.instructions.map((e) => e ? CompiledInstruction.toJSON(e) : undefined); } else { obj.instructions = []; } @@ -747,36 +664,25 @@ export const Message = { fromPartial, I>>(object: I): Message { const message = createBaseMessage(); - message.header = - object.header !== undefined && object.header !== null - ? MessageHeader.fromPartial(object.header) - : undefined; + message.header = (object.header !== undefined && object.header !== null) + ? MessageHeader.fromPartial(object.header) + : undefined; message.accountKeys = object.accountKeys?.map((e) => e) || []; message.recentBlockhash = object.recentBlockhash ?? new Uint8Array(0); - message.instructions = - object.instructions?.map((e) => CompiledInstruction.fromPartial(e)) || []; + message.instructions = object.instructions?.map((e) => CompiledInstruction.fromPartial(e)) || []; message.versioned = object.versioned ?? false; - message.addressTableLookups = - object.addressTableLookups?.map((e) => - MessageAddressTableLookup.fromPartial(e) - ) || []; + message.addressTableLookups = object.addressTableLookups?.map((e) => MessageAddressTableLookup.fromPartial(e)) || + []; return message; }, }; function createBaseMessageHeader(): MessageHeader { - return { - numRequiredSignatures: 0, - numReadonlySignedAccounts: 0, - numReadonlyUnsignedAccounts: 0, - }; + return { numRequiredSignatures: 0, numReadonlySignedAccounts: 0, numReadonlyUnsignedAccounts: 0 }; } export const MessageHeader = { - encode( - message: MessageHeader, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: MessageHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.numRequiredSignatures !== 0) { writer.uint32(8).uint32(message.numRequiredSignatures); } @@ -790,8 +696,7 @@ export const MessageHeader = { }, decode(input: _m0.Reader | Uint8Array, length?: number): MessageHeader { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMessageHeader(); while (reader.pos < end) { @@ -829,12 +734,8 @@ export const MessageHeader = { fromJSON(object: any): MessageHeader { return { - numRequiredSignatures: isSet(object.numRequiredSignatures) - ? Number(object.numRequiredSignatures) - : 0, - numReadonlySignedAccounts: isSet(object.numReadonlySignedAccounts) - ? Number(object.numReadonlySignedAccounts) - : 0, + numRequiredSignatures: isSet(object.numRequiredSignatures) ? Number(object.numRequiredSignatures) : 0, + numReadonlySignedAccounts: isSet(object.numReadonlySignedAccounts) ? Number(object.numReadonlySignedAccounts) : 0, numReadonlyUnsignedAccounts: isSet(object.numReadonlyUnsignedAccounts) ? Number(object.numReadonlyUnsignedAccounts) : 0, @@ -846,47 +747,31 @@ export const MessageHeader = { message.numRequiredSignatures !== undefined && (obj.numRequiredSignatures = Math.round(message.numRequiredSignatures)); message.numReadonlySignedAccounts !== undefined && - (obj.numReadonlySignedAccounts = Math.round( - message.numReadonlySignedAccounts - )); + (obj.numReadonlySignedAccounts = Math.round(message.numReadonlySignedAccounts)); message.numReadonlyUnsignedAccounts !== undefined && - (obj.numReadonlyUnsignedAccounts = Math.round( - message.numReadonlyUnsignedAccounts - )); + (obj.numReadonlyUnsignedAccounts = Math.round(message.numReadonlyUnsignedAccounts)); return obj; }, - create, I>>( - base?: I - ): MessageHeader { + create, I>>(base?: I): MessageHeader { return MessageHeader.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): MessageHeader { + fromPartial, I>>(object: I): MessageHeader { const message = createBaseMessageHeader(); message.numRequiredSignatures = object.numRequiredSignatures ?? 0; message.numReadonlySignedAccounts = object.numReadonlySignedAccounts ?? 0; - message.numReadonlyUnsignedAccounts = - object.numReadonlyUnsignedAccounts ?? 0; + message.numReadonlyUnsignedAccounts = object.numReadonlyUnsignedAccounts ?? 0; return message; }, }; function createBaseMessageAddressTableLookup(): MessageAddressTableLookup { - return { - accountKey: new Uint8Array(0), - writableIndexes: new Uint8Array(0), - readonlyIndexes: new Uint8Array(0), - }; + return { accountKey: new Uint8Array(0), writableIndexes: new Uint8Array(0), readonlyIndexes: new Uint8Array(0) }; } export const MessageAddressTableLookup = { - encode( - message: MessageAddressTableLookup, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: MessageAddressTableLookup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.accountKey.length !== 0) { writer.uint32(10).bytes(message.accountKey); } @@ -899,12 +784,8 @@ export const MessageAddressTableLookup = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): MessageAddressTableLookup { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): MessageAddressTableLookup { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMessageAddressTableLookup(); while (reader.pos < end) { @@ -942,50 +823,32 @@ export const MessageAddressTableLookup = { fromJSON(object: any): MessageAddressTableLookup { return { - accountKey: isSet(object.accountKey) - ? bytesFromBase64(object.accountKey) - : new Uint8Array(0), - writableIndexes: isSet(object.writableIndexes) - ? bytesFromBase64(object.writableIndexes) - : new Uint8Array(0), - readonlyIndexes: isSet(object.readonlyIndexes) - ? bytesFromBase64(object.readonlyIndexes) - : new Uint8Array(0), + accountKey: isSet(object.accountKey) ? bytesFromBase64(object.accountKey) : new Uint8Array(0), + writableIndexes: isSet(object.writableIndexes) ? bytesFromBase64(object.writableIndexes) : new Uint8Array(0), + readonlyIndexes: isSet(object.readonlyIndexes) ? bytesFromBase64(object.readonlyIndexes) : new Uint8Array(0), }; }, toJSON(message: MessageAddressTableLookup): unknown { const obj: any = {}; message.accountKey !== undefined && - (obj.accountKey = base64FromBytes( - message.accountKey !== undefined - ? message.accountKey - : new Uint8Array(0) - )); + (obj.accountKey = base64FromBytes(message.accountKey !== undefined ? message.accountKey : new Uint8Array(0))); message.writableIndexes !== undefined && (obj.writableIndexes = base64FromBytes( - message.writableIndexes !== undefined - ? message.writableIndexes - : new Uint8Array(0) + message.writableIndexes !== undefined ? message.writableIndexes : new Uint8Array(0), )); message.readonlyIndexes !== undefined && (obj.readonlyIndexes = base64FromBytes( - message.readonlyIndexes !== undefined - ? message.readonlyIndexes - : new Uint8Array(0) + message.readonlyIndexes !== undefined ? message.readonlyIndexes : new Uint8Array(0), )); return obj; }, - create, I>>( - base?: I - ): MessageAddressTableLookup { + create, I>>(base?: I): MessageAddressTableLookup { return MessageAddressTableLookup.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): MessageAddressTableLookup { + fromPartial, I>>(object: I): MessageAddressTableLookup { const message = createBaseMessageAddressTableLookup(); message.accountKey = object.accountKey ?? new Uint8Array(0); message.writableIndexes = object.writableIndexes ?? new Uint8Array(0); @@ -1016,10 +879,7 @@ function createBaseTransactionStatusMeta(): TransactionStatusMeta { } export const TransactionStatusMeta = { - encode( - message: TransactionStatusMeta, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: TransactionStatusMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.err !== undefined) { TransactionError.encode(message.err, writer.uint32(10).fork()).ldelim(); } @@ -1075,12 +935,8 @@ export const TransactionStatusMeta = { return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): TransactionStatusMeta { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + decode(input: _m0.Reader | Uint8Array, length?: number): TransactionStatusMeta { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTransactionStatusMeta(); while (reader.pos < end) { @@ -1139,9 +995,7 @@ export const TransactionStatusMeta = { break; } - message.innerInstructions.push( - InnerInstructions.decode(reader, reader.uint32()) - ); + message.innerInstructions.push(InnerInstructions.decode(reader, reader.uint32())); continue; case 10: if (tag !== 80) { @@ -1169,18 +1023,14 @@ export const TransactionStatusMeta = { break; } - message.preTokenBalances.push( - TokenBalance.decode(reader, reader.uint32()) - ); + message.preTokenBalances.push(TokenBalance.decode(reader, reader.uint32())); continue; case 8: if (tag !== 66) { break; } - message.postTokenBalances.push( - TokenBalance.decode(reader, reader.uint32()) - ); + message.postTokenBalances.push(TokenBalance.decode(reader, reader.uint32())); continue; case 9: if (tag !== 74) { @@ -1235,63 +1085,38 @@ export const TransactionStatusMeta = { fromJSON(object: any): TransactionStatusMeta { return { - err: isSet(object.err) - ? TransactionError.fromJSON(object.err) - : undefined, + err: isSet(object.err) ? TransactionError.fromJSON(object.err) : undefined, fee: isSet(object.fee) ? String(object.fee) : "0", - preBalances: Array.isArray(object?.preBalances) - ? object.preBalances.map((e: any) => String(e)) - : [], - postBalances: Array.isArray(object?.postBalances) - ? object.postBalances.map((e: any) => String(e)) - : [], + preBalances: Array.isArray(object?.preBalances) ? object.preBalances.map((e: any) => String(e)) : [], + postBalances: Array.isArray(object?.postBalances) ? object.postBalances.map((e: any) => String(e)) : [], innerInstructions: Array.isArray(object?.innerInstructions) - ? object.innerInstructions.map((e: any) => - InnerInstructions.fromJSON(e) - ) - : [], - innerInstructionsNone: isSet(object.innerInstructionsNone) - ? Boolean(object.innerInstructionsNone) - : false, - logMessages: Array.isArray(object?.logMessages) - ? object.logMessages.map((e: any) => String(e)) + ? object.innerInstructions.map((e: any) => InnerInstructions.fromJSON(e)) : [], - logMessagesNone: isSet(object.logMessagesNone) - ? Boolean(object.logMessagesNone) - : false, + innerInstructionsNone: isSet(object.innerInstructionsNone) ? Boolean(object.innerInstructionsNone) : false, + logMessages: Array.isArray(object?.logMessages) ? object.logMessages.map((e: any) => String(e)) : [], + logMessagesNone: isSet(object.logMessagesNone) ? Boolean(object.logMessagesNone) : false, preTokenBalances: Array.isArray(object?.preTokenBalances) ? object.preTokenBalances.map((e: any) => TokenBalance.fromJSON(e)) : [], postTokenBalances: Array.isArray(object?.postTokenBalances) ? object.postTokenBalances.map((e: any) => TokenBalance.fromJSON(e)) : [], - rewards: Array.isArray(object?.rewards) - ? object.rewards.map((e: any) => Reward.fromJSON(e)) - : [], + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => Reward.fromJSON(e)) : [], loadedWritableAddresses: Array.isArray(object?.loadedWritableAddresses) ? object.loadedWritableAddresses.map((e: any) => bytesFromBase64(e)) : [], loadedReadonlyAddresses: Array.isArray(object?.loadedReadonlyAddresses) ? object.loadedReadonlyAddresses.map((e: any) => bytesFromBase64(e)) : [], - returnData: isSet(object.returnData) - ? ReturnData.fromJSON(object.returnData) - : undefined, - returnDataNone: isSet(object.returnDataNone) - ? Boolean(object.returnDataNone) - : false, - computeUnitsConsumed: isSet(object.computeUnitsConsumed) - ? String(object.computeUnitsConsumed) - : undefined, + returnData: isSet(object.returnData) ? ReturnData.fromJSON(object.returnData) : undefined, + returnDataNone: isSet(object.returnDataNone) ? Boolean(object.returnDataNone) : false, + computeUnitsConsumed: isSet(object.computeUnitsConsumed) ? String(object.computeUnitsConsumed) : undefined, }; }, toJSON(message: TransactionStatusMeta): unknown { const obj: any = {}; - message.err !== undefined && - (obj.err = message.err - ? TransactionError.toJSON(message.err) - : undefined); + message.err !== undefined && (obj.err = message.err ? TransactionError.toJSON(message.err) : undefined); message.fee !== undefined && (obj.fee = message.fee); if (message.preBalances) { obj.preBalances = message.preBalances.map((e) => e); @@ -1304,39 +1129,29 @@ export const TransactionStatusMeta = { obj.postBalances = []; } if (message.innerInstructions) { - obj.innerInstructions = message.innerInstructions.map((e) => - e ? InnerInstructions.toJSON(e) : undefined - ); + obj.innerInstructions = message.innerInstructions.map((e) => e ? InnerInstructions.toJSON(e) : undefined); } else { obj.innerInstructions = []; } - message.innerInstructionsNone !== undefined && - (obj.innerInstructionsNone = message.innerInstructionsNone); + message.innerInstructionsNone !== undefined && (obj.innerInstructionsNone = message.innerInstructionsNone); if (message.logMessages) { obj.logMessages = message.logMessages.map((e) => e); } else { obj.logMessages = []; } - message.logMessagesNone !== undefined && - (obj.logMessagesNone = message.logMessagesNone); + message.logMessagesNone !== undefined && (obj.logMessagesNone = message.logMessagesNone); if (message.preTokenBalances) { - obj.preTokenBalances = message.preTokenBalances.map((e) => - e ? TokenBalance.toJSON(e) : undefined - ); + obj.preTokenBalances = message.preTokenBalances.map((e) => e ? TokenBalance.toJSON(e) : undefined); } else { obj.preTokenBalances = []; } if (message.postTokenBalances) { - obj.postTokenBalances = message.postTokenBalances.map((e) => - e ? TokenBalance.toJSON(e) : undefined - ); + obj.postTokenBalances = message.postTokenBalances.map((e) => e ? TokenBalance.toJSON(e) : undefined); } else { obj.postTokenBalances = []; } if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? Reward.toJSON(e) : undefined - ); + obj.rewards = message.rewards.map((e) => e ? Reward.toJSON(e) : undefined); } else { obj.rewards = []; } @@ -1355,52 +1170,36 @@ export const TransactionStatusMeta = { obj.loadedReadonlyAddresses = []; } message.returnData !== undefined && - (obj.returnData = message.returnData - ? ReturnData.toJSON(message.returnData) - : undefined); - message.returnDataNone !== undefined && - (obj.returnDataNone = message.returnDataNone); - message.computeUnitsConsumed !== undefined && - (obj.computeUnitsConsumed = message.computeUnitsConsumed); + (obj.returnData = message.returnData ? ReturnData.toJSON(message.returnData) : undefined); + message.returnDataNone !== undefined && (obj.returnDataNone = message.returnDataNone); + message.computeUnitsConsumed !== undefined && (obj.computeUnitsConsumed = message.computeUnitsConsumed); return obj; }, - create, I>>( - base?: I - ): TransactionStatusMeta { + create, I>>(base?: I): TransactionStatusMeta { return TransactionStatusMeta.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): TransactionStatusMeta { + fromPartial, I>>(object: I): TransactionStatusMeta { const message = createBaseTransactionStatusMeta(); - message.err = - object.err !== undefined && object.err !== null - ? TransactionError.fromPartial(object.err) - : undefined; + message.err = (object.err !== undefined && object.err !== null) + ? TransactionError.fromPartial(object.err) + : undefined; message.fee = object.fee ?? "0"; message.preBalances = object.preBalances?.map((e) => e) || []; message.postBalances = object.postBalances?.map((e) => e) || []; - message.innerInstructions = - object.innerInstructions?.map((e) => InnerInstructions.fromPartial(e)) || - []; + message.innerInstructions = object.innerInstructions?.map((e) => InnerInstructions.fromPartial(e)) || []; message.innerInstructionsNone = object.innerInstructionsNone ?? false; message.logMessages = object.logMessages?.map((e) => e) || []; message.logMessagesNone = object.logMessagesNone ?? false; - message.preTokenBalances = - object.preTokenBalances?.map((e) => TokenBalance.fromPartial(e)) || []; - message.postTokenBalances = - object.postTokenBalances?.map((e) => TokenBalance.fromPartial(e)) || []; + message.preTokenBalances = object.preTokenBalances?.map((e) => TokenBalance.fromPartial(e)) || []; + message.postTokenBalances = object.postTokenBalances?.map((e) => TokenBalance.fromPartial(e)) || []; message.rewards = object.rewards?.map((e) => Reward.fromPartial(e)) || []; - message.loadedWritableAddresses = - object.loadedWritableAddresses?.map((e) => e) || []; - message.loadedReadonlyAddresses = - object.loadedReadonlyAddresses?.map((e) => e) || []; - message.returnData = - object.returnData !== undefined && object.returnData !== null - ? ReturnData.fromPartial(object.returnData) - : undefined; + message.loadedWritableAddresses = object.loadedWritableAddresses?.map((e) => e) || []; + message.loadedReadonlyAddresses = object.loadedReadonlyAddresses?.map((e) => e) || []; + message.returnData = (object.returnData !== undefined && object.returnData !== null) + ? ReturnData.fromPartial(object.returnData) + : undefined; message.returnDataNone = object.returnDataNone ?? false; message.computeUnitsConsumed = object.computeUnitsConsumed ?? undefined; return message; @@ -1412,10 +1211,7 @@ function createBaseTransactionError(): TransactionError { } export const TransactionError = { - encode( - message: TransactionError, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: TransactionError, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.err.length !== 0) { writer.uint32(10).bytes(message.err); } @@ -1423,8 +1219,7 @@ export const TransactionError = { }, decode(input: _m0.Reader | Uint8Array, length?: number): TransactionError { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTransactionError(); while (reader.pos < end) { @@ -1447,29 +1242,21 @@ export const TransactionError = { }, fromJSON(object: any): TransactionError { - return { - err: isSet(object.err) ? bytesFromBase64(object.err) : new Uint8Array(0), - }; + return { err: isSet(object.err) ? bytesFromBase64(object.err) : new Uint8Array(0) }; }, toJSON(message: TransactionError): unknown { const obj: any = {}; message.err !== undefined && - (obj.err = base64FromBytes( - message.err !== undefined ? message.err : new Uint8Array(0) - )); + (obj.err = base64FromBytes(message.err !== undefined ? message.err : new Uint8Array(0))); return obj; }, - create, I>>( - base?: I - ): TransactionError { + create, I>>(base?: I): TransactionError { return TransactionError.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): TransactionError { + fromPartial, I>>(object: I): TransactionError { const message = createBaseTransactionError(); message.err = object.err ?? new Uint8Array(0); return message; @@ -1481,10 +1268,7 @@ function createBaseInnerInstructions(): InnerInstructions { } export const InnerInstructions = { - encode( - message: InnerInstructions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: InnerInstructions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -1495,8 +1279,7 @@ export const InnerInstructions = { }, decode(input: _m0.Reader | Uint8Array, length?: number): InnerInstructions { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInnerInstructions(); while (reader.pos < end) { @@ -1514,9 +1297,7 @@ export const InnerInstructions = { break; } - message.instructions.push( - InnerInstruction.decode(reader, reader.uint32()) - ); + message.instructions.push(InnerInstruction.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -1540,46 +1321,31 @@ export const InnerInstructions = { const obj: any = {}; message.index !== undefined && (obj.index = Math.round(message.index)); if (message.instructions) { - obj.instructions = message.instructions.map((e) => - e ? InnerInstruction.toJSON(e) : undefined - ); + obj.instructions = message.instructions.map((e) => e ? InnerInstruction.toJSON(e) : undefined); } else { obj.instructions = []; } return obj; }, - create, I>>( - base?: I - ): InnerInstructions { + create, I>>(base?: I): InnerInstructions { return InnerInstructions.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): InnerInstructions { + fromPartial, I>>(object: I): InnerInstructions { const message = createBaseInnerInstructions(); message.index = object.index ?? 0; - message.instructions = - object.instructions?.map((e) => InnerInstruction.fromPartial(e)) || []; + message.instructions = object.instructions?.map((e) => InnerInstruction.fromPartial(e)) || []; return message; }, }; function createBaseInnerInstruction(): InnerInstruction { - return { - programIdIndex: 0, - accounts: new Uint8Array(0), - data: new Uint8Array(0), - stackHeight: undefined, - }; + return { programIdIndex: 0, accounts: new Uint8Array(0), data: new Uint8Array(0), stackHeight: undefined }; } export const InnerInstruction = { - encode( - message: InnerInstruction, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: InnerInstruction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.programIdIndex !== 0) { writer.uint32(8).uint32(message.programIdIndex); } @@ -1596,8 +1362,7 @@ export const InnerInstruction = { }, decode(input: _m0.Reader | Uint8Array, length?: number): InnerInstruction { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInnerInstruction(); while (reader.pos < end) { @@ -1642,47 +1407,29 @@ export const InnerInstruction = { fromJSON(object: any): InnerInstruction { return { - programIdIndex: isSet(object.programIdIndex) - ? Number(object.programIdIndex) - : 0, - accounts: isSet(object.accounts) - ? bytesFromBase64(object.accounts) - : new Uint8Array(0), - data: isSet(object.data) - ? bytesFromBase64(object.data) - : new Uint8Array(0), - stackHeight: isSet(object.stackHeight) - ? Number(object.stackHeight) - : undefined, + programIdIndex: isSet(object.programIdIndex) ? Number(object.programIdIndex) : 0, + accounts: isSet(object.accounts) ? bytesFromBase64(object.accounts) : new Uint8Array(0), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0), + stackHeight: isSet(object.stackHeight) ? Number(object.stackHeight) : undefined, }; }, toJSON(message: InnerInstruction): unknown { const obj: any = {}; - message.programIdIndex !== undefined && - (obj.programIdIndex = Math.round(message.programIdIndex)); + message.programIdIndex !== undefined && (obj.programIdIndex = Math.round(message.programIdIndex)); message.accounts !== undefined && - (obj.accounts = base64FromBytes( - message.accounts !== undefined ? message.accounts : new Uint8Array(0) - )); + (obj.accounts = base64FromBytes(message.accounts !== undefined ? message.accounts : new Uint8Array(0))); message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array(0) - )); - message.stackHeight !== undefined && - (obj.stackHeight = Math.round(message.stackHeight)); + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array(0))); + message.stackHeight !== undefined && (obj.stackHeight = Math.round(message.stackHeight)); return obj; }, - create, I>>( - base?: I - ): InnerInstruction { + create, I>>(base?: I): InnerInstruction { return InnerInstruction.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): InnerInstruction { + fromPartial, I>>(object: I): InnerInstruction { const message = createBaseInnerInstruction(); message.programIdIndex = object.programIdIndex ?? 0; message.accounts = object.accounts ?? new Uint8Array(0); @@ -1693,18 +1440,11 @@ export const InnerInstruction = { }; function createBaseCompiledInstruction(): CompiledInstruction { - return { - programIdIndex: 0, - accounts: new Uint8Array(0), - data: new Uint8Array(0), - }; + return { programIdIndex: 0, accounts: new Uint8Array(0), data: new Uint8Array(0) }; } export const CompiledInstruction = { - encode( - message: CompiledInstruction, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: CompiledInstruction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.programIdIndex !== 0) { writer.uint32(8).uint32(message.programIdIndex); } @@ -1718,8 +1458,7 @@ export const CompiledInstruction = { }, decode(input: _m0.Reader | Uint8Array, length?: number): CompiledInstruction { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompiledInstruction(); while (reader.pos < end) { @@ -1757,42 +1496,27 @@ export const CompiledInstruction = { fromJSON(object: any): CompiledInstruction { return { - programIdIndex: isSet(object.programIdIndex) - ? Number(object.programIdIndex) - : 0, - accounts: isSet(object.accounts) - ? bytesFromBase64(object.accounts) - : new Uint8Array(0), - data: isSet(object.data) - ? bytesFromBase64(object.data) - : new Uint8Array(0), + programIdIndex: isSet(object.programIdIndex) ? Number(object.programIdIndex) : 0, + accounts: isSet(object.accounts) ? bytesFromBase64(object.accounts) : new Uint8Array(0), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0), }; }, toJSON(message: CompiledInstruction): unknown { const obj: any = {}; - message.programIdIndex !== undefined && - (obj.programIdIndex = Math.round(message.programIdIndex)); + message.programIdIndex !== undefined && (obj.programIdIndex = Math.round(message.programIdIndex)); message.accounts !== undefined && - (obj.accounts = base64FromBytes( - message.accounts !== undefined ? message.accounts : new Uint8Array(0) - )); + (obj.accounts = base64FromBytes(message.accounts !== undefined ? message.accounts : new Uint8Array(0))); message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array(0) - )); + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array(0))); return obj; }, - create, I>>( - base?: I - ): CompiledInstruction { + create, I>>(base?: I): CompiledInstruction { return CompiledInstruction.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): CompiledInstruction { + fromPartial, I>>(object: I): CompiledInstruction { const message = createBaseCompiledInstruction(); message.programIdIndex = object.programIdIndex ?? 0; message.accounts = object.accounts ?? new Uint8Array(0); @@ -1802,20 +1526,11 @@ export const CompiledInstruction = { }; function createBaseTokenBalance(): TokenBalance { - return { - accountIndex: 0, - mint: "", - uiTokenAmount: undefined, - owner: "", - programId: "", - }; + return { accountIndex: 0, mint: "", uiTokenAmount: undefined, owner: "", programId: "" }; } export const TokenBalance = { - encode( - message: TokenBalance, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: TokenBalance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.accountIndex !== 0) { writer.uint32(8).uint32(message.accountIndex); } @@ -1823,10 +1538,7 @@ export const TokenBalance = { writer.uint32(18).string(message.mint); } if (message.uiTokenAmount !== undefined) { - UiTokenAmount.encode( - message.uiTokenAmount, - writer.uint32(26).fork() - ).ldelim(); + UiTokenAmount.encode(message.uiTokenAmount, writer.uint32(26).fork()).ldelim(); } if (message.owner !== "") { writer.uint32(34).string(message.owner); @@ -1838,8 +1550,7 @@ export const TokenBalance = { }, decode(input: _m0.Reader | Uint8Array, length?: number): TokenBalance { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTokenBalance(); while (reader.pos < end) { @@ -1891,13 +1602,9 @@ export const TokenBalance = { fromJSON(object: any): TokenBalance { return { - accountIndex: isSet(object.accountIndex) - ? Number(object.accountIndex) - : 0, + accountIndex: isSet(object.accountIndex) ? Number(object.accountIndex) : 0, mint: isSet(object.mint) ? String(object.mint) : "", - uiTokenAmount: isSet(object.uiTokenAmount) - ? UiTokenAmount.fromJSON(object.uiTokenAmount) - : undefined, + uiTokenAmount: isSet(object.uiTokenAmount) ? UiTokenAmount.fromJSON(object.uiTokenAmount) : undefined, owner: isSet(object.owner) ? String(object.owner) : "", programId: isSet(object.programId) ? String(object.programId) : "", }; @@ -1905,34 +1612,26 @@ export const TokenBalance = { toJSON(message: TokenBalance): unknown { const obj: any = {}; - message.accountIndex !== undefined && - (obj.accountIndex = Math.round(message.accountIndex)); + message.accountIndex !== undefined && (obj.accountIndex = Math.round(message.accountIndex)); message.mint !== undefined && (obj.mint = message.mint); message.uiTokenAmount !== undefined && - (obj.uiTokenAmount = message.uiTokenAmount - ? UiTokenAmount.toJSON(message.uiTokenAmount) - : undefined); + (obj.uiTokenAmount = message.uiTokenAmount ? UiTokenAmount.toJSON(message.uiTokenAmount) : undefined); message.owner !== undefined && (obj.owner = message.owner); message.programId !== undefined && (obj.programId = message.programId); return obj; }, - create, I>>( - base?: I - ): TokenBalance { + create, I>>(base?: I): TokenBalance { return TokenBalance.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): TokenBalance { + fromPartial, I>>(object: I): TokenBalance { const message = createBaseTokenBalance(); message.accountIndex = object.accountIndex ?? 0; message.mint = object.mint ?? ""; - message.uiTokenAmount = - object.uiTokenAmount !== undefined && object.uiTokenAmount !== null - ? UiTokenAmount.fromPartial(object.uiTokenAmount) - : undefined; + message.uiTokenAmount = (object.uiTokenAmount !== undefined && object.uiTokenAmount !== null) + ? UiTokenAmount.fromPartial(object.uiTokenAmount) + : undefined; message.owner = object.owner ?? ""; message.programId = object.programId ?? ""; return message; @@ -1944,10 +1643,7 @@ function createBaseUiTokenAmount(): UiTokenAmount { } export const UiTokenAmount = { - encode( - message: UiTokenAmount, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: UiTokenAmount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.uiAmount !== 0) { writer.uint32(9).double(message.uiAmount); } @@ -1964,8 +1660,7 @@ export const UiTokenAmount = { }, decode(input: _m0.Reader | Uint8Array, length?: number): UiTokenAmount { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUiTokenAmount(); while (reader.pos < end) { @@ -2013,32 +1708,24 @@ export const UiTokenAmount = { uiAmount: isSet(object.uiAmount) ? Number(object.uiAmount) : 0, decimals: isSet(object.decimals) ? Number(object.decimals) : 0, amount: isSet(object.amount) ? String(object.amount) : "", - uiAmountString: isSet(object.uiAmountString) - ? String(object.uiAmountString) - : "", + uiAmountString: isSet(object.uiAmountString) ? String(object.uiAmountString) : "", }; }, toJSON(message: UiTokenAmount): unknown { const obj: any = {}; message.uiAmount !== undefined && (obj.uiAmount = message.uiAmount); - message.decimals !== undefined && - (obj.decimals = Math.round(message.decimals)); + message.decimals !== undefined && (obj.decimals = Math.round(message.decimals)); message.amount !== undefined && (obj.amount = message.amount); - message.uiAmountString !== undefined && - (obj.uiAmountString = message.uiAmountString); + message.uiAmountString !== undefined && (obj.uiAmountString = message.uiAmountString); return obj; }, - create, I>>( - base?: I - ): UiTokenAmount { + create, I>>(base?: I): UiTokenAmount { return UiTokenAmount.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): UiTokenAmount { + fromPartial, I>>(object: I): UiTokenAmount { const message = createBaseUiTokenAmount(); message.uiAmount = object.uiAmount ?? 0; message.decimals = object.decimals ?? 0; @@ -2053,10 +1740,7 @@ function createBaseReturnData(): ReturnData { } export const ReturnData = { - encode( - message: ReturnData, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: ReturnData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.programId.length !== 0) { writer.uint32(10).bytes(message.programId); } @@ -2067,8 +1751,7 @@ export const ReturnData = { }, decode(input: _m0.Reader | Uint8Array, length?: number): ReturnData { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseReturnData(); while (reader.pos < end) { @@ -2099,25 +1782,17 @@ export const ReturnData = { fromJSON(object: any): ReturnData { return { - programId: isSet(object.programId) - ? bytesFromBase64(object.programId) - : new Uint8Array(0), - data: isSet(object.data) - ? bytesFromBase64(object.data) - : new Uint8Array(0), + programId: isSet(object.programId) ? bytesFromBase64(object.programId) : new Uint8Array(0), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0), }; }, toJSON(message: ReturnData): unknown { const obj: any = {}; message.programId !== undefined && - (obj.programId = base64FromBytes( - message.programId !== undefined ? message.programId : new Uint8Array(0) - )); + (obj.programId = base64FromBytes(message.programId !== undefined ? message.programId : new Uint8Array(0))); message.data !== undefined && - (obj.data = base64FromBytes( - message.data !== undefined ? message.data : new Uint8Array(0) - )); + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array(0))); return obj; }, @@ -2125,9 +1800,7 @@ export const ReturnData = { return ReturnData.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): ReturnData { + fromPartial, I>>(object: I): ReturnData { const message = createBaseReturnData(); message.programId = object.programId ?? new Uint8Array(0); message.data = object.data ?? new Uint8Array(0); @@ -2136,20 +1809,11 @@ export const ReturnData = { }; function createBaseReward(): Reward { - return { - pubkey: "", - lamports: "0", - postBalance: "0", - rewardType: 0, - commission: "", - }; + return { pubkey: "", lamports: "0", postBalance: "0", rewardType: 0, commission: "" }; } export const Reward = { - encode( - message: Reward, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: Reward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pubkey !== "") { writer.uint32(10).string(message.pubkey); } @@ -2169,8 +1833,7 @@ export const Reward = { }, decode(input: _m0.Reader | Uint8Array, length?: number): Reward { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseReward(); while (reader.pos < end) { @@ -2225,9 +1888,7 @@ export const Reward = { pubkey: isSet(object.pubkey) ? String(object.pubkey) : "", lamports: isSet(object.lamports) ? String(object.lamports) : "0", postBalance: isSet(object.postBalance) ? String(object.postBalance) : "0", - rewardType: isSet(object.rewardType) - ? rewardTypeFromJSON(object.rewardType) - : 0, + rewardType: isSet(object.rewardType) ? rewardTypeFromJSON(object.rewardType) : 0, commission: isSet(object.commission) ? String(object.commission) : "", }; }, @@ -2236,10 +1897,8 @@ export const Reward = { const obj: any = {}; message.pubkey !== undefined && (obj.pubkey = message.pubkey); message.lamports !== undefined && (obj.lamports = message.lamports); - message.postBalance !== undefined && - (obj.postBalance = message.postBalance); - message.rewardType !== undefined && - (obj.rewardType = rewardTypeToJSON(message.rewardType)); + message.postBalance !== undefined && (obj.postBalance = message.postBalance); + message.rewardType !== undefined && (obj.rewardType = rewardTypeToJSON(message.rewardType)); message.commission !== undefined && (obj.commission = message.commission); return obj; }, @@ -2260,23 +1919,22 @@ export const Reward = { }; function createBaseRewards(): Rewards { - return { rewards: [] }; + return { rewards: [], numPartitions: undefined }; } export const Rewards = { - encode( - message: Rewards, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: Rewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.rewards) { Reward.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.numPartitions !== undefined) { + NumPartitions.encode(message.numPartitions, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Rewards { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRewards(); while (reader.pos < end) { @@ -2289,6 +1947,13 @@ export const Rewards = { message.rewards.push(Reward.decode(reader, reader.uint32())); continue; + case 2: + if (tag !== 18) { + break; + } + + message.numPartitions = NumPartitions.decode(reader, reader.uint32()); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -2300,21 +1965,20 @@ export const Rewards = { fromJSON(object: any): Rewards { return { - rewards: Array.isArray(object?.rewards) - ? object.rewards.map((e: any) => Reward.fromJSON(e)) - : [], + rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => Reward.fromJSON(e)) : [], + numPartitions: isSet(object.numPartitions) ? NumPartitions.fromJSON(object.numPartitions) : undefined, }; }, toJSON(message: Rewards): unknown { const obj: any = {}; if (message.rewards) { - obj.rewards = message.rewards.map((e) => - e ? Reward.toJSON(e) : undefined - ); + obj.rewards = message.rewards.map((e) => e ? Reward.toJSON(e) : undefined); } else { obj.rewards = []; } + message.numPartitions !== undefined && + (obj.numPartitions = message.numPartitions ? NumPartitions.toJSON(message.numPartitions) : undefined); return obj; }, @@ -2325,6 +1989,9 @@ export const Rewards = { fromPartial, I>>(object: I): Rewards { const message = createBaseRewards(); message.rewards = object.rewards?.map((e) => Reward.fromPartial(e)) || []; + message.numPartitions = (object.numPartitions !== undefined && object.numPartitions !== null) + ? NumPartitions.fromPartial(object.numPartitions) + : undefined; return message; }, }; @@ -2334,10 +2001,7 @@ function createBaseUnixTimestamp(): UnixTimestamp { } export const UnixTimestamp = { - encode( - message: UnixTimestamp, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: UnixTimestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.timestamp !== "0") { writer.uint32(8).int64(message.timestamp); } @@ -2345,8 +2009,7 @@ export const UnixTimestamp = { }, decode(input: _m0.Reader | Uint8Array, length?: number): UnixTimestamp { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnixTimestamp(); while (reader.pos < end) { @@ -2369,9 +2032,7 @@ export const UnixTimestamp = { }, fromJSON(object: any): UnixTimestamp { - return { - timestamp: isSet(object.timestamp) ? String(object.timestamp) : "0", - }; + return { timestamp: isSet(object.timestamp) ? String(object.timestamp) : "0" }; }, toJSON(message: UnixTimestamp): unknown { @@ -2380,15 +2041,11 @@ export const UnixTimestamp = { return obj; }, - create, I>>( - base?: I - ): UnixTimestamp { + create, I>>(base?: I): UnixTimestamp { return UnixTimestamp.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): UnixTimestamp { + fromPartial, I>>(object: I): UnixTimestamp { const message = createBaseUnixTimestamp(); message.timestamp = object.timestamp ?? "0"; return message; @@ -2400,10 +2057,7 @@ function createBaseBlockHeight(): BlockHeight { } export const BlockHeight = { - encode( - message: BlockHeight, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { + encode(message: BlockHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.blockHeight !== "0") { writer.uint32(8).uint64(message.blockHeight); } @@ -2411,8 +2065,7 @@ export const BlockHeight = { }, decode(input: _m0.Reader | Uint8Array, length?: number): BlockHeight { - const reader = - input instanceof _m0.Reader ? input : _m0.Reader.create(input); + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockHeight(); while (reader.pos < end) { @@ -2435,15 +2088,12 @@ export const BlockHeight = { }, fromJSON(object: any): BlockHeight { - return { - blockHeight: isSet(object.blockHeight) ? String(object.blockHeight) : "0", - }; + return { blockHeight: isSet(object.blockHeight) ? String(object.blockHeight) : "0" }; }, toJSON(message: BlockHeight): unknown { const obj: any = {}; - message.blockHeight !== undefined && - (obj.blockHeight = message.blockHeight); + message.blockHeight !== undefined && (obj.blockHeight = message.blockHeight); return obj; }, @@ -2451,15 +2101,69 @@ export const BlockHeight = { return BlockHeight.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I - ): BlockHeight { + fromPartial, I>>(object: I): BlockHeight { const message = createBaseBlockHeight(); message.blockHeight = object.blockHeight ?? "0"; return message; }, }; +function createBaseNumPartitions(): NumPartitions { + return { numPartitions: "0" }; +} + +export const NumPartitions = { + encode(message: NumPartitions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.numPartitions !== "0") { + writer.uint32(8).uint64(message.numPartitions); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NumPartitions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNumPartitions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.numPartitions = longToString(reader.uint64() as Long); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): NumPartitions { + return { numPartitions: isSet(object.numPartitions) ? String(object.numPartitions) : "0" }; + }, + + toJSON(message: NumPartitions): unknown { + const obj: any = {}; + message.numPartitions !== undefined && (obj.numPartitions = message.numPartitions); + return obj; + }, + + create, I>>(base?: I): NumPartitions { + return NumPartitions.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): NumPartitions { + const message = createBaseNumPartitions(); + message.numPartitions = object.numPartitions ?? "0"; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; @@ -2504,31 +2208,16 @@ function base64FromBytes(arr: Uint8Array): string { } } -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function longToString(long: Long) { return long.toString();