From 0594440d40686de8281f63bd82cfcbe703b5f86c Mon Sep 17 00:00:00 2001 From: Fuyao Zhao Date: Fri, 30 Dec 2022 23:01:12 -0800 Subject: [PATCH] feat(all): further split packages (#269) --- .circleci/config.yml | 2 +- .github/workflows/publish-docs.yaml | 4 +- .ls-lint.yml | 6 + BUILD.bazel | 14 +- package.json | 3 + packages/base/package.json | 12 +- packages/base/src/index.ts | 3 +- packages/{sdk => base}/src/plugin.ts | 2 +- .../state => base/src}/state-storage.test.ts | 9 +- .../state-storage.ts => base/src/state.ts} | 14 +- packages/base/tsconfig.json | 3 - packages/protos/package.json | 22 + packages/protos/src/builtin.ts | 15 + .../src}/chainquery/protos/chainquery.ts | 1130 +++-- packages/protos/src/google/protobuf/empty.ts | 63 + .../src}/google/protobuf/struct.ts | 372 +- .../protos/src/google/protobuf/timestamp.ts | 90 + packages/{sdk/src/gen => protos/src}/index.ts | 2 + .../src}/processor/protos/processor.ts | 4283 +++++++++-------- .../src}/service/price/protos/price.ts | 300 +- packages/protos/tsconfig.json | 13 + packages/runtime/package.json | 9 +- packages/runtime/tsconfig.json | 3 - packages/sdk/package.json | 7 +- packages/sdk/src/aptos/api.ts | 2 +- packages/sdk/src/aptos/aptos-plugin.ts | 5 +- packages/sdk/src/aptos/aptos-processor.ts | 4 +- packages/sdk/src/aptos/context.ts | 2 +- packages/sdk/src/binds.ts | 2 +- packages/sdk/src/core/account-processor.ts | 2 +- packages/sdk/src/core/base-context.ts | 2 +- .../sdk/src/core/base-processor-template.ts | 4 +- packages/sdk/src/core/base-processor.ts | 2 +- packages/sdk/src/core/context.ts | 2 +- packages/sdk/src/core/eth-plugin.ts | 4 +- packages/sdk/src/core/event-tracker.ts | 4 +- packages/sdk/src/core/exporter.ts | 2 +- .../sdk/src/core/generic-processor.test.ts | 2 +- packages/sdk/src/core/logger.ts | 2 +- packages/sdk/src/core/meter.ts | 4 +- packages/sdk/src/core/numberish.test.ts | 2 +- packages/sdk/src/core/numberish.ts | 2 +- packages/sdk/src/core/solana-plugin.ts | 6 +- packages/sdk/src/core/solana-processor.ts | 4 +- packages/sdk/src/core/sui-plugin.ts | 11 +- packages/sdk/src/core/sui-processor.ts | 4 +- packages/sdk/src/gen/builtin.ts | 22 - packages/sdk/src/gen/google/protobuf/empty.ts | 58 - .../sdk/src/gen/google/protobuf/timestamp.ts | 85 - packages/sdk/src/index.ts | 5 +- packages/sdk/src/processor-runner.ts | 6 +- packages/sdk/src/service.ts | 7 +- packages/sdk/src/state/processor-state.ts | 3 - packages/sdk/src/testing/metric-utils.ts | 2 +- .../sdk/src/testing/test-processor-server.ts | 17 +- packages/sdk/src/tests/aptos.test.ts | 2 +- packages/sdk/src/tests/erc20-template.test.ts | 2 +- packages/sdk/src/tests/erc20.test.ts | 2 +- packages/sdk/src/types/global.d.ts | 4 +- packages/sdk/src/utils/conversion.ts | 2 +- packages/sdk/src/utils/dex-price.test.ts | 4 +- packages/sdk/src/utils/erc20.test.ts | 4 +- packages/sdk/src/utils/price.ts | 2 +- 63 files changed, 3370 insertions(+), 3312 deletions(-) rename packages/{sdk => base}/src/plugin.ts (97%) rename packages/{sdk/src/state => base/src}/state-storage.test.ts (65%) rename packages/{sdk/src/state/state-storage.ts => base/src/state.ts} (81%) create mode 100644 packages/protos/package.json create mode 100644 packages/protos/src/builtin.ts rename packages/{sdk/src/gen => protos/src}/chainquery/protos/chainquery.ts (53%) create mode 100644 packages/protos/src/google/protobuf/empty.ts rename packages/{sdk/src/gen => protos/src}/google/protobuf/struct.ts (56%) create mode 100644 packages/protos/src/google/protobuf/timestamp.ts rename packages/{sdk/src/gen => protos/src}/index.ts (56%) rename packages/{sdk/src/gen => protos/src}/processor/protos/processor.ts (57%) rename packages/{sdk/src/gen => protos/src}/service/price/protos/price.ts (55%) create mode 100644 packages/protos/tsconfig.json delete mode 100755 packages/sdk/src/gen/builtin.ts delete mode 100644 packages/sdk/src/gen/google/protobuf/empty.ts delete mode 100644 packages/sdk/src/gen/google/protobuf/timestamp.ts delete mode 100644 packages/sdk/src/state/processor-state.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index 4247bc1c7..737e800b6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ jobs: # command: yarn install # name: Yarn Install - run: - command: rm -rf lib && yarn gen && yarn test || yarn test # TODO remove this hack, understand why test will fail in first run + command: yarn build_all && yarn gen && yarn test || yarn test # TODO remove this hack, understand why test will fail in first run name: Test SDK working_directory: packages/sdk # - run: diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index e3fc1105b..64bd1300b 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -24,10 +24,10 @@ jobs: - name: Create the docs directory locally in CI run: yarn gen && yarn docs - working-directory: sdk + working-directory: packages/sdk - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4.4.1 with: branch: gh-pages - folder: sdk/docs \ No newline at end of file + folder: packages/sdk/docs \ No newline at end of file diff --git a/.ls-lint.yml b/.ls-lint.yml index 0c656757d..cc5468914 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -33,3 +33,9 @@ ignore: - examples - packages/sdk/src/tests/abis - packages/sdk/src/tests/types + - packages/base/lib + - packages/base/node_modules + - packages/protos/lib + - packages/protos/node_modules + - packages/runtime/lib + - packages/runtime/node_modules \ No newline at end of file diff --git a/BUILD.bazel b/BUILD.bazel index b0aae4a05..813d24610 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,13 +3,13 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") write_source_files( name = "write_gen", files = { - "packages/sdk/processor.proto": "//processor/protos:proto_file", - "packages/sdk/src/gen/chainquery/protos/chainquery.ts": "//chainquery/protos:chainquery_ts_proto", - "packages/sdk/src/gen/processor/protos/processor.ts": "//processor/protos:processor_ts_proto", - "packages/sdk/src/gen/service/price/protos/price.ts": "//service/price/protos:protos_ts_proto", - "packages/sdk/src/gen/google/protobuf/empty.ts": "//processor/protos:empty_ts_proto", - "packages/sdk/src/gen/google/protobuf/struct.ts": "//processor/protos:struct_ts_proto", - "packages/sdk/src/gen/google/protobuf/timestamp.ts": "//processor/protos:timestamp_ts_proto", + "packages/protos/processor.proto": "//processor/protos:proto_file", + "packages/protos/src/gen/chainquery/protos/chainquery.ts": "//chainquery/protos:chainquery_ts_proto", + "packages/protos/src/gen/processor/protos/processor.ts": "//processor/protos:processor_ts_proto", + "packages/protos/src/gen/service/price/protos/price.ts": "//service/price/protos:protos_ts_proto", + "packages/protos/src/gen/google/protobuf/empty.ts": "//processor/protos:empty_ts_proto", + "packages/protos/src/gen/google/protobuf/struct.ts": "//processor/protos:struct_ts_proto", + "packages/protos/src/gen/google/protobuf/timestamp.ts": "//processor/protos:timestamp_ts_proto", "packages/runtime/processor_full.proto": "//processor/protos:proto_full_file", "packages/runtime/src/gen/processor/protos/processor.ts": "//processor/protos:processor_ts_proto", diff --git a/package.json b/package.json index a2ef22e8a..fd804ae26 100644 --- a/package.json +++ b/package.json @@ -36,5 +36,8 @@ "format": "prettier --write .", "lint": "ls-lint && eslint .", "postinstall": "git config --local include.path ../.github/.gitconfig && git config core.hooksPath .github/.githooks" + }, + "engines": { + "node": ">=16" } } diff --git a/packages/base/package.json b/packages/base/package.json index f9b0d09e3..f24f52e9a 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -1,12 +1,16 @@ { "name": "@sentio/base", "license": "Apache-2.0", - "version": "1.0.0-rc.5", + "version": "1.0.0", "scripts": { "compile": "tsc -p .", "build": "yarn compile", + "build_all": "yarn lerna run --scope=@sentio/base build --include-dependencies", "test": "jest" }, + "dependencies": { + "@sentio/protos": "^1.0.0" + }, "main": "./lib/index.js", "types": "./lib/index.d.ts", "module": "./lib/index.js", @@ -14,9 +18,5 @@ "{lib,src}", "!{lib,src}/tests", "!**/*.test.{js,ts}" - ], - "engines": { - "node": ">=16" - }, - "gitHead": "8bec43cdc9e778d66a4154bc1be1f9276b680408" + ] } diff --git a/packages/base/src/index.ts b/packages/base/src/index.ts index 336ce12bb..ad2226a2b 100644 --- a/packages/base/src/index.ts +++ b/packages/base/src/index.ts @@ -1 +1,2 @@ -export {} +export * from './plugin' +export * from './state' diff --git a/packages/sdk/src/plugin.ts b/packages/base/src/plugin.ts similarity index 97% rename from packages/sdk/src/plugin.ts rename to packages/base/src/plugin.ts index 9f32555d7..c6651e300 100644 --- a/packages/sdk/src/plugin.ts +++ b/packages/base/src/plugin.ts @@ -1,4 +1,4 @@ -import { DataBinding, HandlerType, ProcessConfigResponse, ProcessResult } from './gen' +import { DataBinding, HandlerType, ProcessConfigResponse, ProcessResult } from '@sentio/protos' export interface Plugin { name: string diff --git a/packages/sdk/src/state/state-storage.test.ts b/packages/base/src/state-storage.test.ts similarity index 65% rename from packages/sdk/src/state/state-storage.test.ts rename to packages/base/src/state-storage.test.ts index 0f763c2a0..3b090b3aa 100644 --- a/packages/sdk/src/state/state-storage.test.ts +++ b/packages/base/src/state-storage.test.ts @@ -1,9 +1,8 @@ import { assert } from 'chai' -import { MapStateStorage } from './state-storage' -import { ProcessorState } from './processor-state' +import { State, MapStateStorage } from './state' describe('state storage tests', () => { - global.PROCESSOR_STATE = new ProcessorState() + State.reset() test('test labels', async () => { class TestState extends MapStateStorage { @@ -18,7 +17,7 @@ describe('state storage tests', () => { TestState.INSTANCE.getOrSetValue('k2', 'v2') assert(TestState.INSTANCE.getValues().length === 2) - assert(global.PROCESSOR_STATE.stateMap.size === 1) - assert(global.PROCESSOR_STATE.stateMap.keys().next().value === 'TestState') + assert(State.INSTANCE.stateMap.size === 1) + assert(State.INSTANCE.stateMap.keys().next().value === 'TestState') }) }) diff --git a/packages/sdk/src/state/state-storage.ts b/packages/base/src/state.ts similarity index 81% rename from packages/sdk/src/state/state-storage.ts rename to packages/base/src/state.ts index 99ddfebdb..3f1a5b84d 100644 --- a/packages/sdk/src/state/state-storage.ts +++ b/packages/base/src/state.ts @@ -1,3 +1,13 @@ +export class State { + stateMap = new Map() + + static INSTANCE = new State() + + static reset() { + State.INSTANCE = new State() + } +} + export abstract class StateStorage { // TODO learn how to define single instance for all subclasses @@ -12,10 +22,10 @@ export abstract class StateStorage { } getOrRegister(): T { - let metricState: T = global.PROCESSOR_STATE.stateMap.get(this.key()) + let metricState: T = State.INSTANCE.stateMap.get(this.key()) if (!metricState) { metricState = this.initValue() - global.PROCESSOR_STATE.stateMap.set(this.key(), metricState) + State.INSTANCE.stateMap.set(this.key(), metricState) } return metricState } diff --git a/packages/base/tsconfig.json b/packages/base/tsconfig.json index fccf5b99b..9817516bd 100644 --- a/packages/base/tsconfig.json +++ b/packages/base/tsconfig.json @@ -4,9 +4,6 @@ "inlineSources": true, "rootDir": "./src", "baseUrl": "./src", - "paths": { - "@sentio/sdk": ["."] - }, "outDir": "lib" }, "exclude": ["lib"] diff --git a/packages/protos/package.json b/packages/protos/package.json new file mode 100644 index 000000000..c3bd8d247 --- /dev/null +++ b/packages/protos/package.json @@ -0,0 +1,22 @@ +{ + "name": "@sentio/protos", + "license": "Apache-2.0", + "version": "1.0.0", + "scripts": { + "compile": "tsc -p .", + "clean": "tsc --build --clean", + "build": "yarn compile" + }, + "dependencies": { + "google-protobuf": "^3.15.8", + "nice-grpc": "^2.0.0" + }, + "main": "./lib/index.js", + "types": "./lib/index.d.ts", + "module": "./lib/index.js", + "files": [ + "{lib,src}", + "!{lib,src}/tests", + "!**/*.test.{js,ts}" + ] +} diff --git a/packages/protos/src/builtin.ts b/packages/protos/src/builtin.ts new file mode 100644 index 000000000..d74ec291c --- /dev/null +++ b/packages/protos/src/builtin.ts @@ -0,0 +1,15 @@ +import Long from 'long' + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial diff --git a/packages/sdk/src/gen/chainquery/protos/chainquery.ts b/packages/protos/src/chainquery/protos/chainquery.ts similarity index 53% rename from packages/sdk/src/gen/chainquery/protos/chainquery.ts rename to packages/protos/src/chainquery/protos/chainquery.ts index 397ab9f75..af2663b0e 100644 --- a/packages/sdk/src/gen/chainquery/protos/chainquery.ts +++ b/packages/protos/src/chainquery/protos/chainquery.ts @@ -1,509 +1,498 @@ /* eslint-disable */ -import Long from "long"; -import type { CallContext, CallOptions } from "nice-grpc-common"; -import _m0 from "protobufjs/minimal"; +import Long from 'long' +import type { CallContext, CallOptions } from 'nice-grpc-common' +import _m0 from 'protobufjs/minimal' export interface AptosGetTxnsByFunctionRequest { - network: string; - fromVersion: Long; - toVersion: Long; - function: string; - matchAll: boolean; - typedArguments: string[]; + network: string + fromVersion: Long + toVersion: Long + function: string + matchAll: boolean + typedArguments: string[] } export interface AptosGetTxnsByVersionRequest { - network: string; - fromVersion: Long; - toVersion: Long; - headerOnly?: boolean | undefined; + network: string + fromVersion: Long + toVersion: Long + headerOnly?: boolean | undefined } export interface AptosGetTxnsByEventRequest { - network: string; - fromVersion: Long; - toVersion: Long; - address: string; - type: string; + network: string + fromVersion: Long + toVersion: Long + address: string + type: string } export interface AptosSQLQueryRequest { - network: string; - fromVersion: Long; - toVersion: Long; - sql: string; - arbitraryRange: boolean; + network: string + fromVersion: Long + toVersion: Long + sql: string + arbitraryRange: boolean } export interface QueryPhaseSummary { - name: string; - timeTookMs: Long; + name: string + timeTookMs: Long } export interface QueryExecutionSummary { - timeTookMs: Long; - resultNumRows?: Long | undefined; - resultNumBytes?: Long | undefined; - numPartitionsWithMaterializedView?: Long | undefined; - numPartitionsWithoutMaterializedView?: Long | undefined; - numPartitions?: Long | undefined; - phases: QueryPhaseSummary[]; + timeTookMs: Long + resultNumRows?: Long | undefined + resultNumBytes?: Long | undefined + numPartitionsWithMaterializedView?: Long | undefined + numPartitionsWithoutMaterializedView?: Long | undefined + numPartitions?: Long | undefined + phases: QueryPhaseSummary[] } export interface AptosGetTxnsResponse { - documents: string[]; - executionSummary?: QueryExecutionSummary | undefined; + documents: string[] + executionSummary?: QueryExecutionSummary | undefined } -export interface AptosRefreshRequest { -} +export interface AptosRefreshRequest {} -export interface VoidResponse { -} +export interface VoidResponse {} export interface EvmSQLQueryRequest { - network: string; - sql: string; + network: string + sql: string } export interface EvmGetHeaderRequest { - network: string; - fromBlock?: Long | undefined; - toBlock?: Long | undefined; - blockNumbers: Long[]; + network: string + fromBlock?: Long | undefined + toBlock?: Long | undefined + blockNumbers: Long[] } export interface EvmQueryResponse { - rows: string[]; - executionSummary?: QueryExecutionSummary | undefined; + rows: string[] + executionSummary?: QueryExecutionSummary | undefined } function createBaseAptosGetTxnsByFunctionRequest(): AptosGetTxnsByFunctionRequest { return { - network: "", + network: '', fromVersion: Long.UZERO, toVersion: Long.UZERO, - function: "", + function: '', matchAll: false, typedArguments: [], - }; + } } export const AptosGetTxnsByFunctionRequest = { encode(message: AptosGetTxnsByFunctionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.network !== "") { - writer.uint32(10).string(message.network); + if (message.network !== '') { + writer.uint32(10).string(message.network) } if (!message.fromVersion.isZero()) { - writer.uint32(16).uint64(message.fromVersion); + writer.uint32(16).uint64(message.fromVersion) } if (!message.toVersion.isZero()) { - writer.uint32(24).uint64(message.toVersion); + writer.uint32(24).uint64(message.toVersion) } - if (message.function !== "") { - writer.uint32(34).string(message.function); + if (message.function !== '') { + writer.uint32(34).string(message.function) } if (message.matchAll === true) { - writer.uint32(40).bool(message.matchAll); + writer.uint32(40).bool(message.matchAll) } for (const v of message.typedArguments) { - writer.uint32(50).string(v!); + writer.uint32(50).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsByFunctionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosGetTxnsByFunctionRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosGetTxnsByFunctionRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.network = reader.string(); - break; + message.network = reader.string() + break case 2: - message.fromVersion = reader.uint64() as Long; - break; + message.fromVersion = reader.uint64() as Long + break case 3: - message.toVersion = reader.uint64() as Long; - break; + message.toVersion = reader.uint64() as Long + break case 4: - message.function = reader.string(); - break; + message.function = reader.string() + break case 5: - message.matchAll = reader.bool(); - break; + message.matchAll = reader.bool() + break case 6: - message.typedArguments.push(reader.string()); - break; + message.typedArguments.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosGetTxnsByFunctionRequest { return { - network: isSet(object.network) ? String(object.network) : "", + network: isSet(object.network) ? String(object.network) : '', fromVersion: isSet(object.fromVersion) ? Long.fromValue(object.fromVersion) : Long.UZERO, toVersion: isSet(object.toVersion) ? Long.fromValue(object.toVersion) : Long.UZERO, - function: isSet(object.function) ? String(object.function) : "", + function: isSet(object.function) ? String(object.function) : '', matchAll: isSet(object.matchAll) ? Boolean(object.matchAll) : false, typedArguments: Array.isArray(object?.typedArguments) ? object.typedArguments.map((e: any) => String(e)) : [], - }; + } }, toJSON(message: AptosGetTxnsByFunctionRequest): unknown { - const obj: any = {}; - message.network !== undefined && (obj.network = message.network); - message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()); - message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()); - message.function !== undefined && (obj.function = message.function); - message.matchAll !== undefined && (obj.matchAll = message.matchAll); + const obj: any = {} + message.network !== undefined && (obj.network = message.network) + message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()) + message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()) + message.function !== undefined && (obj.function = message.function) + message.matchAll !== undefined && (obj.matchAll = message.matchAll) if (message.typedArguments) { - obj.typedArguments = message.typedArguments.map((e) => e); + obj.typedArguments = message.typedArguments.map((e) => e) } else { - obj.typedArguments = []; + obj.typedArguments = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): AptosGetTxnsByFunctionRequest { - const message = createBaseAptosGetTxnsByFunctionRequest(); - message.network = object.network ?? ""; - message.fromVersion = (object.fromVersion !== undefined && object.fromVersion !== null) - ? Long.fromValue(object.fromVersion) - : Long.UZERO; - message.toVersion = (object.toVersion !== undefined && object.toVersion !== null) - ? Long.fromValue(object.toVersion) - : Long.UZERO; - message.function = object.function ?? ""; - message.matchAll = object.matchAll ?? false; - message.typedArguments = object.typedArguments?.map((e) => e) || []; - return message; + const message = createBaseAptosGetTxnsByFunctionRequest() + message.network = object.network ?? '' + message.fromVersion = + object.fromVersion !== undefined && object.fromVersion !== null ? Long.fromValue(object.fromVersion) : Long.UZERO + message.toVersion = + object.toVersion !== undefined && object.toVersion !== null ? Long.fromValue(object.toVersion) : Long.UZERO + message.function = object.function ?? '' + message.matchAll = object.matchAll ?? false + message.typedArguments = object.typedArguments?.map((e) => e) || [] + return message }, -}; +} function createBaseAptosGetTxnsByVersionRequest(): AptosGetTxnsByVersionRequest { - return { network: "", fromVersion: Long.UZERO, toVersion: Long.UZERO, headerOnly: undefined }; + return { network: '', fromVersion: Long.UZERO, toVersion: Long.UZERO, headerOnly: undefined } } export const AptosGetTxnsByVersionRequest = { encode(message: AptosGetTxnsByVersionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.network !== "") { - writer.uint32(10).string(message.network); + if (message.network !== '') { + writer.uint32(10).string(message.network) } if (!message.fromVersion.isZero()) { - writer.uint32(16).uint64(message.fromVersion); + writer.uint32(16).uint64(message.fromVersion) } if (!message.toVersion.isZero()) { - writer.uint32(24).uint64(message.toVersion); + writer.uint32(24).uint64(message.toVersion) } if (message.headerOnly !== undefined) { - writer.uint32(32).bool(message.headerOnly); + writer.uint32(32).bool(message.headerOnly) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsByVersionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosGetTxnsByVersionRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosGetTxnsByVersionRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.network = reader.string(); - break; + message.network = reader.string() + break case 2: - message.fromVersion = reader.uint64() as Long; - break; + message.fromVersion = reader.uint64() as Long + break case 3: - message.toVersion = reader.uint64() as Long; - break; + message.toVersion = reader.uint64() as Long + break case 4: - message.headerOnly = reader.bool(); - break; + message.headerOnly = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosGetTxnsByVersionRequest { return { - network: isSet(object.network) ? String(object.network) : "", + network: isSet(object.network) ? String(object.network) : '', fromVersion: isSet(object.fromVersion) ? Long.fromValue(object.fromVersion) : Long.UZERO, toVersion: isSet(object.toVersion) ? Long.fromValue(object.toVersion) : Long.UZERO, headerOnly: isSet(object.headerOnly) ? Boolean(object.headerOnly) : undefined, - }; + } }, toJSON(message: AptosGetTxnsByVersionRequest): unknown { - const obj: any = {}; - message.network !== undefined && (obj.network = message.network); - message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()); - message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()); - message.headerOnly !== undefined && (obj.headerOnly = message.headerOnly); - return obj; + const obj: any = {} + message.network !== undefined && (obj.network = message.network) + message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()) + message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()) + message.headerOnly !== undefined && (obj.headerOnly = message.headerOnly) + return obj }, fromPartial(object: DeepPartial): AptosGetTxnsByVersionRequest { - const message = createBaseAptosGetTxnsByVersionRequest(); - message.network = object.network ?? ""; - message.fromVersion = (object.fromVersion !== undefined && object.fromVersion !== null) - ? Long.fromValue(object.fromVersion) - : Long.UZERO; - message.toVersion = (object.toVersion !== undefined && object.toVersion !== null) - ? Long.fromValue(object.toVersion) - : Long.UZERO; - message.headerOnly = object.headerOnly ?? undefined; - return message; + const message = createBaseAptosGetTxnsByVersionRequest() + message.network = object.network ?? '' + message.fromVersion = + object.fromVersion !== undefined && object.fromVersion !== null ? Long.fromValue(object.fromVersion) : Long.UZERO + message.toVersion = + object.toVersion !== undefined && object.toVersion !== null ? Long.fromValue(object.toVersion) : Long.UZERO + message.headerOnly = object.headerOnly ?? undefined + return message }, -}; +} function createBaseAptosGetTxnsByEventRequest(): AptosGetTxnsByEventRequest { - return { network: "", fromVersion: Long.UZERO, toVersion: Long.UZERO, address: "", type: "" }; + return { network: '', fromVersion: Long.UZERO, toVersion: Long.UZERO, address: '', type: '' } } export const AptosGetTxnsByEventRequest = { encode(message: AptosGetTxnsByEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.network !== "") { - writer.uint32(10).string(message.network); + if (message.network !== '') { + writer.uint32(10).string(message.network) } if (!message.fromVersion.isZero()) { - writer.uint32(16).uint64(message.fromVersion); + writer.uint32(16).uint64(message.fromVersion) } if (!message.toVersion.isZero()) { - writer.uint32(24).uint64(message.toVersion); + writer.uint32(24).uint64(message.toVersion) } - if (message.address !== "") { - writer.uint32(34).string(message.address); + if (message.address !== '') { + writer.uint32(34).string(message.address) } - if (message.type !== "") { - writer.uint32(42).string(message.type); + if (message.type !== '') { + writer.uint32(42).string(message.type) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsByEventRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosGetTxnsByEventRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosGetTxnsByEventRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.network = reader.string(); - break; + message.network = reader.string() + break case 2: - message.fromVersion = reader.uint64() as Long; - break; + message.fromVersion = reader.uint64() as Long + break case 3: - message.toVersion = reader.uint64() as Long; - break; + message.toVersion = reader.uint64() as Long + break case 4: - message.address = reader.string(); - break; + message.address = reader.string() + break case 5: - message.type = reader.string(); - break; + message.type = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosGetTxnsByEventRequest { return { - network: isSet(object.network) ? String(object.network) : "", + network: isSet(object.network) ? String(object.network) : '', fromVersion: isSet(object.fromVersion) ? Long.fromValue(object.fromVersion) : Long.UZERO, toVersion: isSet(object.toVersion) ? Long.fromValue(object.toVersion) : Long.UZERO, - address: isSet(object.address) ? String(object.address) : "", - type: isSet(object.type) ? String(object.type) : "", - }; + address: isSet(object.address) ? String(object.address) : '', + type: isSet(object.type) ? String(object.type) : '', + } }, toJSON(message: AptosGetTxnsByEventRequest): unknown { - const obj: any = {}; - message.network !== undefined && (obj.network = message.network); - message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()); - message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()); - message.address !== undefined && (obj.address = message.address); - message.type !== undefined && (obj.type = message.type); - return obj; + const obj: any = {} + message.network !== undefined && (obj.network = message.network) + message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()) + message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()) + message.address !== undefined && (obj.address = message.address) + message.type !== undefined && (obj.type = message.type) + return obj }, fromPartial(object: DeepPartial): AptosGetTxnsByEventRequest { - const message = createBaseAptosGetTxnsByEventRequest(); - message.network = object.network ?? ""; - message.fromVersion = (object.fromVersion !== undefined && object.fromVersion !== null) - ? Long.fromValue(object.fromVersion) - : Long.UZERO; - message.toVersion = (object.toVersion !== undefined && object.toVersion !== null) - ? Long.fromValue(object.toVersion) - : Long.UZERO; - message.address = object.address ?? ""; - message.type = object.type ?? ""; - return message; + const message = createBaseAptosGetTxnsByEventRequest() + message.network = object.network ?? '' + message.fromVersion = + object.fromVersion !== undefined && object.fromVersion !== null ? Long.fromValue(object.fromVersion) : Long.UZERO + message.toVersion = + object.toVersion !== undefined && object.toVersion !== null ? Long.fromValue(object.toVersion) : Long.UZERO + message.address = object.address ?? '' + message.type = object.type ?? '' + return message }, -}; +} function createBaseAptosSQLQueryRequest(): AptosSQLQueryRequest { - return { network: "", fromVersion: Long.UZERO, toVersion: Long.UZERO, sql: "", arbitraryRange: false }; + return { network: '', fromVersion: Long.UZERO, toVersion: Long.UZERO, sql: '', arbitraryRange: false } } export const AptosSQLQueryRequest = { encode(message: AptosSQLQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.network !== "") { - writer.uint32(10).string(message.network); + if (message.network !== '') { + writer.uint32(10).string(message.network) } if (!message.fromVersion.isZero()) { - writer.uint32(16).uint64(message.fromVersion); + writer.uint32(16).uint64(message.fromVersion) } if (!message.toVersion.isZero()) { - writer.uint32(24).uint64(message.toVersion); + writer.uint32(24).uint64(message.toVersion) } - if (message.sql !== "") { - writer.uint32(34).string(message.sql); + if (message.sql !== '') { + writer.uint32(34).string(message.sql) } if (message.arbitraryRange === true) { - writer.uint32(40).bool(message.arbitraryRange); + writer.uint32(40).bool(message.arbitraryRange) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosSQLQueryRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosSQLQueryRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosSQLQueryRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.network = reader.string(); - break; + message.network = reader.string() + break case 2: - message.fromVersion = reader.uint64() as Long; - break; + message.fromVersion = reader.uint64() as Long + break case 3: - message.toVersion = reader.uint64() as Long; - break; + message.toVersion = reader.uint64() as Long + break case 4: - message.sql = reader.string(); - break; + message.sql = reader.string() + break case 5: - message.arbitraryRange = reader.bool(); - break; + message.arbitraryRange = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosSQLQueryRequest { return { - network: isSet(object.network) ? String(object.network) : "", + network: isSet(object.network) ? String(object.network) : '', fromVersion: isSet(object.fromVersion) ? Long.fromValue(object.fromVersion) : Long.UZERO, toVersion: isSet(object.toVersion) ? Long.fromValue(object.toVersion) : Long.UZERO, - sql: isSet(object.sql) ? String(object.sql) : "", + sql: isSet(object.sql) ? String(object.sql) : '', arbitraryRange: isSet(object.arbitraryRange) ? Boolean(object.arbitraryRange) : false, - }; + } }, toJSON(message: AptosSQLQueryRequest): unknown { - const obj: any = {}; - message.network !== undefined && (obj.network = message.network); - message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()); - message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()); - message.sql !== undefined && (obj.sql = message.sql); - message.arbitraryRange !== undefined && (obj.arbitraryRange = message.arbitraryRange); - return obj; + const obj: any = {} + message.network !== undefined && (obj.network = message.network) + message.fromVersion !== undefined && (obj.fromVersion = (message.fromVersion || Long.UZERO).toString()) + message.toVersion !== undefined && (obj.toVersion = (message.toVersion || Long.UZERO).toString()) + message.sql !== undefined && (obj.sql = message.sql) + message.arbitraryRange !== undefined && (obj.arbitraryRange = message.arbitraryRange) + return obj }, fromPartial(object: DeepPartial): AptosSQLQueryRequest { - const message = createBaseAptosSQLQueryRequest(); - message.network = object.network ?? ""; - message.fromVersion = (object.fromVersion !== undefined && object.fromVersion !== null) - ? Long.fromValue(object.fromVersion) - : Long.UZERO; - message.toVersion = (object.toVersion !== undefined && object.toVersion !== null) - ? Long.fromValue(object.toVersion) - : Long.UZERO; - message.sql = object.sql ?? ""; - message.arbitraryRange = object.arbitraryRange ?? false; - return message; + const message = createBaseAptosSQLQueryRequest() + message.network = object.network ?? '' + message.fromVersion = + object.fromVersion !== undefined && object.fromVersion !== null ? Long.fromValue(object.fromVersion) : Long.UZERO + message.toVersion = + object.toVersion !== undefined && object.toVersion !== null ? Long.fromValue(object.toVersion) : Long.UZERO + message.sql = object.sql ?? '' + message.arbitraryRange = object.arbitraryRange ?? false + return message }, -}; +} function createBaseQueryPhaseSummary(): QueryPhaseSummary { - return { name: "", timeTookMs: Long.UZERO }; + return { name: '', timeTookMs: Long.UZERO } } export const QueryPhaseSummary = { encode(message: QueryPhaseSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); + if (message.name !== '') { + writer.uint32(10).string(message.name) } if (!message.timeTookMs.isZero()) { - writer.uint32(16).uint64(message.timeTookMs); + writer.uint32(16).uint64(message.timeTookMs) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryPhaseSummary { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPhaseSummary(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryPhaseSummary() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.timeTookMs = reader.uint64() as Long; - break; + message.timeTookMs = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryPhaseSummary { return { - name: isSet(object.name) ? String(object.name) : "", + name: isSet(object.name) ? String(object.name) : '', timeTookMs: isSet(object.timeTookMs) ? Long.fromValue(object.timeTookMs) : Long.UZERO, - }; + } }, toJSON(message: QueryPhaseSummary): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.timeTookMs !== undefined && (obj.timeTookMs = (message.timeTookMs || Long.UZERO).toString()); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.timeTookMs !== undefined && (obj.timeTookMs = (message.timeTookMs || Long.UZERO).toString()) + return obj }, fromPartial(object: DeepPartial): QueryPhaseSummary { - const message = createBaseQueryPhaseSummary(); - message.name = object.name ?? ""; - message.timeTookMs = (object.timeTookMs !== undefined && object.timeTookMs !== null) - ? Long.fromValue(object.timeTookMs) - : Long.UZERO; - return message; + const message = createBaseQueryPhaseSummary() + message.name = object.name ?? '' + message.timeTookMs = + object.timeTookMs !== undefined && object.timeTookMs !== null ? Long.fromValue(object.timeTookMs) : Long.UZERO + return message }, -}; +} function createBaseQueryExecutionSummary(): QueryExecutionSummary { return { @@ -514,69 +503,69 @@ function createBaseQueryExecutionSummary(): QueryExecutionSummary { numPartitionsWithoutMaterializedView: undefined, numPartitions: undefined, phases: [], - }; + } } export const QueryExecutionSummary = { encode(message: QueryExecutionSummary, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.timeTookMs.isZero()) { - writer.uint32(8).uint64(message.timeTookMs); + writer.uint32(8).uint64(message.timeTookMs) } if (message.resultNumRows !== undefined) { - writer.uint32(16).uint64(message.resultNumRows); + writer.uint32(16).uint64(message.resultNumRows) } if (message.resultNumBytes !== undefined) { - writer.uint32(24).uint64(message.resultNumBytes); + writer.uint32(24).uint64(message.resultNumBytes) } if (message.numPartitionsWithMaterializedView !== undefined) { - writer.uint32(32).uint64(message.numPartitionsWithMaterializedView); + writer.uint32(32).uint64(message.numPartitionsWithMaterializedView) } if (message.numPartitionsWithoutMaterializedView !== undefined) { - writer.uint32(40).uint64(message.numPartitionsWithoutMaterializedView); + writer.uint32(40).uint64(message.numPartitionsWithoutMaterializedView) } if (message.numPartitions !== undefined) { - writer.uint32(48).uint64(message.numPartitions); + writer.uint32(48).uint64(message.numPartitions) } for (const v of message.phases) { - QueryPhaseSummary.encode(v!, writer.uint32(58).fork()).ldelim(); + QueryPhaseSummary.encode(v!, writer.uint32(58).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryExecutionSummary { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryExecutionSummary(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseQueryExecutionSummary() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.timeTookMs = reader.uint64() as Long; - break; + message.timeTookMs = reader.uint64() as Long + break case 2: - message.resultNumRows = reader.uint64() as Long; - break; + message.resultNumRows = reader.uint64() as Long + break case 3: - message.resultNumBytes = reader.uint64() as Long; - break; + message.resultNumBytes = reader.uint64() as Long + break case 4: - message.numPartitionsWithMaterializedView = reader.uint64() as Long; - break; + message.numPartitionsWithMaterializedView = reader.uint64() as Long + break case 5: - message.numPartitionsWithoutMaterializedView = reader.uint64() as Long; - break; + message.numPartitionsWithoutMaterializedView = reader.uint64() as Long + break case 6: - message.numPartitions = reader.uint64() as Long; - break; + message.numPartitions = reader.uint64() as Long + break case 7: - message.phases.push(QueryPhaseSummary.decode(reader, reader.uint32())); - break; + message.phases.push(QueryPhaseSummary.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): QueryExecutionSummary { @@ -592,90 +581,92 @@ export const QueryExecutionSummary = { : undefined, numPartitions: isSet(object.numPartitions) ? Long.fromValue(object.numPartitions) : undefined, phases: Array.isArray(object?.phases) ? object.phases.map((e: any) => QueryPhaseSummary.fromJSON(e)) : [], - }; + } }, toJSON(message: QueryExecutionSummary): unknown { - const obj: any = {}; - message.timeTookMs !== undefined && (obj.timeTookMs = (message.timeTookMs || Long.UZERO).toString()); - message.resultNumRows !== undefined && (obj.resultNumRows = (message.resultNumRows || undefined).toString()); - message.resultNumBytes !== undefined && (obj.resultNumBytes = (message.resultNumBytes || undefined).toString()); + const obj: any = {} + message.timeTookMs !== undefined && (obj.timeTookMs = (message.timeTookMs || Long.UZERO).toString()) + message.resultNumRows !== undefined && (obj.resultNumRows = (message.resultNumRows || undefined).toString()) + message.resultNumBytes !== undefined && (obj.resultNumBytes = (message.resultNumBytes || undefined).toString()) message.numPartitionsWithMaterializedView !== undefined && - (obj.numPartitionsWithMaterializedView = (message.numPartitionsWithMaterializedView || undefined).toString()); + (obj.numPartitionsWithMaterializedView = (message.numPartitionsWithMaterializedView || undefined).toString()) message.numPartitionsWithoutMaterializedView !== undefined && - (obj.numPartitionsWithoutMaterializedView = (message.numPartitionsWithoutMaterializedView || undefined) - .toString()); - message.numPartitions !== undefined && (obj.numPartitions = (message.numPartitions || undefined).toString()); + (obj.numPartitionsWithoutMaterializedView = ( + message.numPartitionsWithoutMaterializedView || undefined + ).toString()) + message.numPartitions !== undefined && (obj.numPartitions = (message.numPartitions || undefined).toString()) if (message.phases) { - obj.phases = message.phases.map((e) => e ? QueryPhaseSummary.toJSON(e) : undefined); + obj.phases = message.phases.map((e) => (e ? QueryPhaseSummary.toJSON(e) : undefined)) } else { - obj.phases = []; + obj.phases = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): QueryExecutionSummary { - const message = createBaseQueryExecutionSummary(); - message.timeTookMs = (object.timeTookMs !== undefined && object.timeTookMs !== null) - ? Long.fromValue(object.timeTookMs) - : Long.UZERO; - message.resultNumRows = (object.resultNumRows !== undefined && object.resultNumRows !== null) - ? Long.fromValue(object.resultNumRows) - : undefined; - message.resultNumBytes = (object.resultNumBytes !== undefined && object.resultNumBytes !== null) - ? Long.fromValue(object.resultNumBytes) - : undefined; + const message = createBaseQueryExecutionSummary() + message.timeTookMs = + object.timeTookMs !== undefined && object.timeTookMs !== null ? Long.fromValue(object.timeTookMs) : Long.UZERO + message.resultNumRows = + object.resultNumRows !== undefined && object.resultNumRows !== null + ? Long.fromValue(object.resultNumRows) + : undefined + message.resultNumBytes = + object.resultNumBytes !== undefined && object.resultNumBytes !== null + ? Long.fromValue(object.resultNumBytes) + : undefined message.numPartitionsWithMaterializedView = - (object.numPartitionsWithMaterializedView !== undefined && object.numPartitionsWithMaterializedView !== null) + object.numPartitionsWithMaterializedView !== undefined && object.numPartitionsWithMaterializedView !== null ? Long.fromValue(object.numPartitionsWithMaterializedView) - : undefined; + : undefined message.numPartitionsWithoutMaterializedView = - (object.numPartitionsWithoutMaterializedView !== undefined && - object.numPartitionsWithoutMaterializedView !== null) + object.numPartitionsWithoutMaterializedView !== undefined && object.numPartitionsWithoutMaterializedView !== null ? Long.fromValue(object.numPartitionsWithoutMaterializedView) - : undefined; - message.numPartitions = (object.numPartitions !== undefined && object.numPartitions !== null) - ? Long.fromValue(object.numPartitions) - : undefined; - message.phases = object.phases?.map((e) => QueryPhaseSummary.fromPartial(e)) || []; - return message; + : undefined + message.numPartitions = + object.numPartitions !== undefined && object.numPartitions !== null + ? Long.fromValue(object.numPartitions) + : undefined + message.phases = object.phases?.map((e) => QueryPhaseSummary.fromPartial(e)) || [] + return message }, -}; +} function createBaseAptosGetTxnsResponse(): AptosGetTxnsResponse { - return { documents: [], executionSummary: undefined }; + return { documents: [], executionSummary: undefined } } export const AptosGetTxnsResponse = { encode(message: AptosGetTxnsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.documents) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } if (message.executionSummary !== undefined) { - QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim(); + QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosGetTxnsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosGetTxnsResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosGetTxnsResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.documents.push(reader.string()); - break; + message.documents.push(reader.string()) + break case 2: - message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32()); - break; + message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosGetTxnsResponse { @@ -684,295 +675,295 @@ export const AptosGetTxnsResponse = { executionSummary: isSet(object.executionSummary) ? QueryExecutionSummary.fromJSON(object.executionSummary) : undefined, - }; + } }, toJSON(message: AptosGetTxnsResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.documents) { - obj.documents = message.documents.map((e) => e); + obj.documents = message.documents.map((e) => e) } else { - obj.documents = []; + obj.documents = [] } - message.executionSummary !== undefined && (obj.executionSummary = message.executionSummary - ? QueryExecutionSummary.toJSON(message.executionSummary) - : undefined); - return obj; + message.executionSummary !== undefined && + (obj.executionSummary = message.executionSummary + ? QueryExecutionSummary.toJSON(message.executionSummary) + : undefined) + return obj }, fromPartial(object: DeepPartial): AptosGetTxnsResponse { - const message = createBaseAptosGetTxnsResponse(); - message.documents = object.documents?.map((e) => e) || []; - message.executionSummary = (object.executionSummary !== undefined && object.executionSummary !== null) - ? QueryExecutionSummary.fromPartial(object.executionSummary) - : undefined; - return message; + const message = createBaseAptosGetTxnsResponse() + message.documents = object.documents?.map((e) => e) || [] + message.executionSummary = + object.executionSummary !== undefined && object.executionSummary !== null + ? QueryExecutionSummary.fromPartial(object.executionSummary) + : undefined + return message }, -}; +} function createBaseAptosRefreshRequest(): AptosRefreshRequest { - return {}; + return {} } export const AptosRefreshRequest = { encode(_: AptosRefreshRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosRefreshRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosRefreshRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosRefreshRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): AptosRefreshRequest { - return {}; + return {} }, toJSON(_: AptosRefreshRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial(_: DeepPartial): AptosRefreshRequest { - const message = createBaseAptosRefreshRequest(); - return message; + const message = createBaseAptosRefreshRequest() + return message }, -}; +} function createBaseVoidResponse(): VoidResponse { - return {}; + return {} } export const VoidResponse = { encode(_: VoidResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): VoidResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseVoidResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseVoidResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): VoidResponse { - return {}; + return {} }, toJSON(_: VoidResponse): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial(_: DeepPartial): VoidResponse { - const message = createBaseVoidResponse(); - return message; + const message = createBaseVoidResponse() + return message }, -}; +} function createBaseEvmSQLQueryRequest(): EvmSQLQueryRequest { - return { network: "", sql: "" }; + return { network: '', sql: '' } } export const EvmSQLQueryRequest = { encode(message: EvmSQLQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.network !== "") { - writer.uint32(10).string(message.network); + if (message.network !== '') { + writer.uint32(10).string(message.network) } - if (message.sql !== "") { - writer.uint32(18).string(message.sql); + if (message.sql !== '') { + writer.uint32(18).string(message.sql) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EvmSQLQueryRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvmSQLQueryRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvmSQLQueryRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.network = reader.string(); - break; + message.network = reader.string() + break case 2: - message.sql = reader.string(); - break; + message.sql = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EvmSQLQueryRequest { return { - network: isSet(object.network) ? String(object.network) : "", - sql: isSet(object.sql) ? String(object.sql) : "", - }; + network: isSet(object.network) ? String(object.network) : '', + sql: isSet(object.sql) ? String(object.sql) : '', + } }, toJSON(message: EvmSQLQueryRequest): unknown { - const obj: any = {}; - message.network !== undefined && (obj.network = message.network); - message.sql !== undefined && (obj.sql = message.sql); - return obj; + const obj: any = {} + message.network !== undefined && (obj.network = message.network) + message.sql !== undefined && (obj.sql = message.sql) + return obj }, fromPartial(object: DeepPartial): EvmSQLQueryRequest { - const message = createBaseEvmSQLQueryRequest(); - message.network = object.network ?? ""; - message.sql = object.sql ?? ""; - return message; + const message = createBaseEvmSQLQueryRequest() + message.network = object.network ?? '' + message.sql = object.sql ?? '' + return message }, -}; +} function createBaseEvmGetHeaderRequest(): EvmGetHeaderRequest { - return { network: "", fromBlock: undefined, toBlock: undefined, blockNumbers: [] }; + return { network: '', fromBlock: undefined, toBlock: undefined, blockNumbers: [] } } export const EvmGetHeaderRequest = { encode(message: EvmGetHeaderRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.network !== "") { - writer.uint32(10).string(message.network); + if (message.network !== '') { + writer.uint32(10).string(message.network) } if (message.fromBlock !== undefined) { - writer.uint32(16).uint64(message.fromBlock); + writer.uint32(16).uint64(message.fromBlock) } if (message.toBlock !== undefined) { - writer.uint32(24).uint64(message.toBlock); + writer.uint32(24).uint64(message.toBlock) } - writer.uint32(34).fork(); + writer.uint32(34).fork() for (const v of message.blockNumbers) { - writer.uint64(v); + writer.uint64(v) } - writer.ldelim(); - return writer; + writer.ldelim() + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EvmGetHeaderRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvmGetHeaderRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvmGetHeaderRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.network = reader.string(); - break; + message.network = reader.string() + break case 2: - message.fromBlock = reader.uint64() as Long; - break; + message.fromBlock = reader.uint64() as Long + break case 3: - message.toBlock = reader.uint64() as Long; - break; + message.toBlock = reader.uint64() as Long + break case 4: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.blockNumbers.push(reader.uint64() as Long); + message.blockNumbers.push(reader.uint64() as Long) } } else { - message.blockNumbers.push(reader.uint64() as Long); + message.blockNumbers.push(reader.uint64() as Long) } - break; + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EvmGetHeaderRequest { return { - network: isSet(object.network) ? String(object.network) : "", + network: isSet(object.network) ? String(object.network) : '', fromBlock: isSet(object.fromBlock) ? Long.fromValue(object.fromBlock) : undefined, toBlock: isSet(object.toBlock) ? Long.fromValue(object.toBlock) : undefined, blockNumbers: Array.isArray(object?.blockNumbers) ? object.blockNumbers.map((e: any) => Long.fromValue(e)) : [], - }; + } }, toJSON(message: EvmGetHeaderRequest): unknown { - const obj: any = {}; - message.network !== undefined && (obj.network = message.network); - message.fromBlock !== undefined && (obj.fromBlock = (message.fromBlock || undefined).toString()); - message.toBlock !== undefined && (obj.toBlock = (message.toBlock || undefined).toString()); + const obj: any = {} + message.network !== undefined && (obj.network = message.network) + message.fromBlock !== undefined && (obj.fromBlock = (message.fromBlock || undefined).toString()) + message.toBlock !== undefined && (obj.toBlock = (message.toBlock || undefined).toString()) if (message.blockNumbers) { - obj.blockNumbers = message.blockNumbers.map((e) => (e || Long.UZERO).toString()); + obj.blockNumbers = message.blockNumbers.map((e) => (e || Long.UZERO).toString()) } else { - obj.blockNumbers = []; + obj.blockNumbers = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): EvmGetHeaderRequest { - const message = createBaseEvmGetHeaderRequest(); - message.network = object.network ?? ""; - message.fromBlock = (object.fromBlock !== undefined && object.fromBlock !== null) - ? Long.fromValue(object.fromBlock) - : undefined; - message.toBlock = (object.toBlock !== undefined && object.toBlock !== null) - ? Long.fromValue(object.toBlock) - : undefined; - message.blockNumbers = object.blockNumbers?.map((e) => Long.fromValue(e)) || []; - return message; + const message = createBaseEvmGetHeaderRequest() + message.network = object.network ?? '' + message.fromBlock = + object.fromBlock !== undefined && object.fromBlock !== null ? Long.fromValue(object.fromBlock) : undefined + message.toBlock = + object.toBlock !== undefined && object.toBlock !== null ? Long.fromValue(object.toBlock) : undefined + message.blockNumbers = object.blockNumbers?.map((e) => Long.fromValue(e)) || [] + return message }, -}; +} function createBaseEvmQueryResponse(): EvmQueryResponse { - return { rows: [], executionSummary: undefined }; + return { rows: [], executionSummary: undefined } } export const EvmQueryResponse = { encode(message: EvmQueryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.rows) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } if (message.executionSummary !== undefined) { - QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim(); + QueryExecutionSummary.encode(message.executionSummary, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EvmQueryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvmQueryResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEvmQueryResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.rows.push(reader.string()); - break; + message.rows.push(reader.string()) + break case 2: - message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32()); - break; + message.executionSummary = QueryExecutionSummary.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EvmQueryResponse { @@ -981,39 +972,41 @@ export const EvmQueryResponse = { executionSummary: isSet(object.executionSummary) ? QueryExecutionSummary.fromJSON(object.executionSummary) : undefined, - }; + } }, toJSON(message: EvmQueryResponse): unknown { - const obj: any = {}; + const obj: any = {} if (message.rows) { - obj.rows = message.rows.map((e) => e); + obj.rows = message.rows.map((e) => e) } else { - obj.rows = []; + obj.rows = [] } - message.executionSummary !== undefined && (obj.executionSummary = message.executionSummary - ? QueryExecutionSummary.toJSON(message.executionSummary) - : undefined); - return obj; + message.executionSummary !== undefined && + (obj.executionSummary = message.executionSummary + ? QueryExecutionSummary.toJSON(message.executionSummary) + : undefined) + return obj }, fromPartial(object: DeepPartial): EvmQueryResponse { - const message = createBaseEvmQueryResponse(); - message.rows = object.rows?.map((e) => e) || []; - message.executionSummary = (object.executionSummary !== undefined && object.executionSummary !== null) - ? QueryExecutionSummary.fromPartial(object.executionSummary) - : undefined; - return message; + const message = createBaseEvmQueryResponse() + message.rows = object.rows?.map((e) => e) || [] + message.executionSummary = + object.executionSummary !== undefined && object.executionSummary !== null + ? QueryExecutionSummary.fromPartial(object.executionSummary) + : undefined + return message }, -}; +} -export type AptosQueryDefinition = typeof AptosQueryDefinition; +export type AptosQueryDefinition = typeof AptosQueryDefinition export const AptosQueryDefinition = { - name: "AptosQuery", - fullName: "chainquery.AptosQuery", + name: 'AptosQuery', + fullName: 'chainquery.AptosQuery', methods: { aptosGetTxnsByFunction: { - name: "AptosGetTxnsByFunction", + name: 'AptosGetTxnsByFunction', requestType: AptosGetTxnsByFunctionRequest, requestStream: false, responseType: AptosGetTxnsResponse, @@ -1021,7 +1014,7 @@ export const AptosQueryDefinition = { options: {}, }, aptosGetTxnsByFunctionStream: { - name: "AptosGetTxnsByFunctionStream", + name: 'AptosGetTxnsByFunctionStream', requestType: AptosGetTxnsByFunctionRequest, requestStream: false, responseType: AptosGetTxnsResponse, @@ -1029,7 +1022,7 @@ export const AptosQueryDefinition = { options: {}, }, aptosGetTxnsByVersion: { - name: "AptosGetTxnsByVersion", + name: 'AptosGetTxnsByVersion', requestType: AptosGetTxnsByVersionRequest, requestStream: false, responseType: AptosGetTxnsResponse, @@ -1037,7 +1030,7 @@ export const AptosQueryDefinition = { options: {}, }, aptosGetTxnsByEvent: { - name: "AptosGetTxnsByEvent", + name: 'AptosGetTxnsByEvent', requestType: AptosGetTxnsByEventRequest, requestStream: false, responseType: AptosGetTxnsResponse, @@ -1045,7 +1038,7 @@ export const AptosQueryDefinition = { options: {}, }, aptosGetTxnsByEventStream: { - name: "AptosGetTxnsByEventStream", + name: 'AptosGetTxnsByEventStream', requestType: AptosGetTxnsByEventRequest, requestStream: false, responseType: AptosGetTxnsResponse, @@ -1053,7 +1046,7 @@ export const AptosQueryDefinition = { options: {}, }, aptosRefresh: { - name: "AptosRefresh", + name: 'AptosRefresh', requestType: AptosRefreshRequest, requestStream: false, responseType: VoidResponse, @@ -1061,7 +1054,7 @@ export const AptosQueryDefinition = { options: {}, }, aptosSQLQuery: { - name: "AptosSQLQuery", + name: 'AptosSQLQuery', requestType: AptosSQLQueryRequest, requestStream: false, responseType: AptosGetTxnsResponse, @@ -1069,74 +1062,71 @@ export const AptosQueryDefinition = { options: {}, }, }, -} as const; +} as const export interface AptosQueryServiceImplementation { aptosGetTxnsByFunction( request: AptosGetTxnsByFunctionRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> aptosGetTxnsByFunctionStream( request: AptosGetTxnsByFunctionRequest, - context: CallContext & CallContextExt, - ): ServerStreamingMethodResult>; + context: CallContext & CallContextExt + ): ServerStreamingMethodResult> aptosGetTxnsByVersion( request: AptosGetTxnsByVersionRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> aptosGetTxnsByEvent( request: AptosGetTxnsByEventRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> aptosGetTxnsByEventStream( request: AptosGetTxnsByEventRequest, - context: CallContext & CallContextExt, - ): ServerStreamingMethodResult>; - aptosRefresh(request: AptosRefreshRequest, context: CallContext & CallContextExt): Promise>; + context: CallContext & CallContextExt + ): ServerStreamingMethodResult> + aptosRefresh(request: AptosRefreshRequest, context: CallContext & CallContextExt): Promise> aptosSQLQuery( request: AptosSQLQueryRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> } export interface AptosQueryClient { aptosGetTxnsByFunction( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise aptosGetTxnsByFunctionStream( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): AsyncIterable; + options?: CallOptions & CallOptionsExt + ): AsyncIterable aptosGetTxnsByVersion( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise aptosGetTxnsByEvent( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise aptosGetTxnsByEventStream( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): AsyncIterable; - aptosRefresh( - request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): AsyncIterable + aptosRefresh(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise aptosSQLQuery( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise } -export type EvmQueryDefinition = typeof EvmQueryDefinition; +export type EvmQueryDefinition = typeof EvmQueryDefinition export const EvmQueryDefinition = { - name: "EvmQuery", - fullName: "chainquery.EvmQuery", + name: 'EvmQuery', + fullName: 'chainquery.EvmQuery', methods: { evmSQLQuery: { - name: "EvmSQLQuery", + name: 'EvmSQLQuery', requestType: EvmSQLQueryRequest, requestStream: false, responseType: EvmQueryResponse, @@ -1144,7 +1134,7 @@ export const EvmQueryDefinition = { options: {}, }, evmGetHeader: { - name: "EvmGetHeader", + name: 'EvmGetHeader', requestType: EvmGetHeaderRequest, requestStream: false, responseType: EvmQueryResponse, @@ -1152,7 +1142,7 @@ export const EvmQueryDefinition = { options: {}, }, evmHintHeaderCache: { - name: "EvmHintHeaderCache", + name: 'EvmHintHeaderCache', requestType: EvmGetHeaderRequest, requestStream: false, responseType: VoidResponse, @@ -1160,53 +1150,59 @@ export const EvmQueryDefinition = { options: {}, }, }, -} as const; +} as const export interface EvmQueryServiceImplementation { evmSQLQuery( request: EvmSQLQueryRequest, - context: CallContext & CallContextExt, - ): ServerStreamingMethodResult>; + context: CallContext & CallContextExt + ): ServerStreamingMethodResult> evmGetHeader( request: EvmGetHeaderRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> evmHintHeaderCache( request: EvmGetHeaderRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> } export interface EvmQueryClient { evmSQLQuery( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): AsyncIterable; + options?: CallOptions & CallOptionsExt + ): AsyncIterable evmGetHeader( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise evmHintHeaderCache( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } -export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator }; +export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator } diff --git a/packages/protos/src/google/protobuf/empty.ts b/packages/protos/src/google/protobuf/empty.ts new file mode 100644 index 000000000..107ca2708 --- /dev/null +++ b/packages/protos/src/google/protobuf/empty.ts @@ -0,0 +1,63 @@ +/* eslint-disable */ +import Long from 'long' +import _m0 from 'protobufjs/minimal' + +export interface Empty {} + +function createBaseEmpty(): Empty { + return {} +} + +export const Empty = { + encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Empty { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEmpty() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + + fromJSON(_: any): Empty { + return {} + }, + + toJSON(_: Empty): unknown { + const obj: any = {} + return obj + }, + + fromPartial(_: DeepPartial): Empty { + const message = createBaseEmpty() + return message + }, +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any + _m0.configure() +} diff --git a/packages/sdk/src/gen/google/protobuf/struct.ts b/packages/protos/src/google/protobuf/struct.ts similarity index 56% rename from packages/sdk/src/gen/google/protobuf/struct.ts rename to packages/protos/src/google/protobuf/struct.ts index af763fe40..a06cf0bed 100644 --- a/packages/sdk/src/gen/google/protobuf/struct.ts +++ b/packages/protos/src/google/protobuf/struct.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; +import Long from 'long' +import _m0 from 'protobufjs/minimal' export enum NullValue { NULL_VALUE = 0, @@ -10,191 +10,191 @@ export enum NullValue { export function nullValueFromJSON(object: any): NullValue { switch (object) { case 0: - case "NULL_VALUE": - return NullValue.NULL_VALUE; + case 'NULL_VALUE': + return NullValue.NULL_VALUE case -1: - case "UNRECOGNIZED": + case 'UNRECOGNIZED': default: - return NullValue.UNRECOGNIZED; + return NullValue.UNRECOGNIZED } } export function nullValueToJSON(object: NullValue): string { switch (object) { case NullValue.NULL_VALUE: - return "NULL_VALUE"; + return 'NULL_VALUE' case NullValue.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return 'UNRECOGNIZED' } } export interface Struct { - fields: { [key: string]: any | undefined }; + fields: { [key: string]: any | undefined } } export interface Struct_FieldsEntry { - key: string; - value: any | undefined; + key: string + value: any | undefined } export interface Value { - nullValue?: NullValue | undefined; - numberValue?: number | undefined; - stringValue?: string | undefined; - boolValue?: boolean | undefined; - structValue?: { [key: string]: any } | undefined; - listValue?: Array | undefined; + nullValue?: NullValue | undefined + numberValue?: number | undefined + stringValue?: string | undefined + boolValue?: boolean | undefined + structValue?: { [key: string]: any } | undefined + listValue?: Array | undefined } export interface ListValue { - values: any[]; + values: any[] } function createBaseStruct(): Struct { - return { fields: {} }; + return { fields: {} } } export const Struct = { encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { Object.entries(message.fields).forEach(([key, value]) => { if (value !== undefined) { - Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim(); + Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim() } - }); - return writer; + }) + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Struct { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStruct(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStruct() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32()); + const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32()) if (entry1.value !== undefined) { - message.fields[entry1.key] = entry1.value; + message.fields[entry1.key] = entry1.value } - break; + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Struct { return { fields: isObject(object.fields) ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { - acc[key] = value as any | undefined; - return acc; - }, {}) + acc[key] = value as any | undefined + return acc + }, {}) : {}, - }; + } }, toJSON(message: Struct): unknown { - const obj: any = {}; - obj.fields = {}; + const obj: any = {} + obj.fields = {} if (message.fields) { Object.entries(message.fields).forEach(([k, v]) => { - obj.fields[k] = v; - }); + obj.fields[k] = v + }) } - return obj; + return obj }, fromPartial(object: DeepPartial): Struct { - const message = createBaseStruct(); + const message = createBaseStruct() message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>( (acc, [key, value]) => { if (value !== undefined) { - acc[key] = value; + acc[key] = value } - return acc; + return acc }, - {}, - ); - return message; + {} + ) + return message }, wrap(object: { [key: string]: any } | undefined): Struct { - const struct = createBaseStruct(); + const struct = createBaseStruct() if (object !== undefined) { Object.keys(object).forEach((key) => { - struct.fields[key] = object[key]; - }); + struct.fields[key] = object[key] + }) } - return struct; + return struct }, unwrap(message: Struct): { [key: string]: any } { - const object: { [key: string]: any } = {}; + const object: { [key: string]: any } = {} Object.keys(message.fields).forEach((key) => { - object[key] = message.fields[key]; - }); - return object; + object[key] = message.fields[key] + }) + return object }, -}; +} function createBaseStruct_FieldsEntry(): Struct_FieldsEntry { - return { key: "", value: undefined }; + return { key: '', value: undefined } } export const Struct_FieldsEntry = { encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); + if (message.key !== '') { + writer.uint32(10).string(message.key) } if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim(); + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStruct_FieldsEntry(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStruct_FieldsEntry() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.string(); - break; + message.key = reader.string() + break case 2: - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); - break; + message.value = Value.unwrap(Value.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Struct_FieldsEntry { - return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object?.value) ? object.value : undefined }; + return { key: isSet(object.key) ? String(object.key) : '', value: isSet(object?.value) ? object.value : undefined } }, toJSON(message: Struct_FieldsEntry): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; + const obj: any = {} + message.key !== undefined && (obj.key = message.key) + message.value !== undefined && (obj.value = message.value) + return obj }, fromPartial(object: DeepPartial): Struct_FieldsEntry { - const message = createBaseStruct_FieldsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? undefined; - return message; + const message = createBaseStruct_FieldsEntry() + message.key = object.key ?? '' + message.value = object.value ?? undefined + return message }, -}; +} function createBaseValue(): Value { return { @@ -204,63 +204,63 @@ function createBaseValue(): Value { boolValue: undefined, structValue: undefined, listValue: undefined, - }; + } } export const Value = { encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.nullValue !== undefined) { - writer.uint32(8).int32(message.nullValue); + writer.uint32(8).int32(message.nullValue) } if (message.numberValue !== undefined) { - writer.uint32(17).double(message.numberValue); + writer.uint32(17).double(message.numberValue) } if (message.stringValue !== undefined) { - writer.uint32(26).string(message.stringValue); + writer.uint32(26).string(message.stringValue) } if (message.boolValue !== undefined) { - writer.uint32(32).bool(message.boolValue); + writer.uint32(32).bool(message.boolValue) } if (message.structValue !== undefined) { - Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim(); + Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim() } if (message.listValue !== undefined) { - ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim(); + ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Value { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseValue(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseValue() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.nullValue = reader.int32() as any; - break; + message.nullValue = reader.int32() as any + break case 2: - message.numberValue = reader.double(); - break; + message.numberValue = reader.double() + break case 3: - message.stringValue = reader.string(); - break; + message.stringValue = reader.string() + break case 4: - message.boolValue = reader.bool(); - break; + message.boolValue = reader.bool() + break case 5: - message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break case 6: - message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32())); - break; + message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Value { @@ -271,152 +271,158 @@ export const Value = { boolValue: isSet(object.boolValue) ? Boolean(object.boolValue) : undefined, structValue: isObject(object.structValue) ? object.structValue : undefined, listValue: Array.isArray(object.listValue) ? [...object.listValue] : undefined, - }; + } }, toJSON(message: Value): unknown { - const obj: any = {}; + const obj: any = {} message.nullValue !== undefined && - (obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined); - message.numberValue !== undefined && (obj.numberValue = message.numberValue); - message.stringValue !== undefined && (obj.stringValue = message.stringValue); - message.boolValue !== undefined && (obj.boolValue = message.boolValue); - message.structValue !== undefined && (obj.structValue = message.structValue); - message.listValue !== undefined && (obj.listValue = message.listValue); - return obj; + (obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined) + message.numberValue !== undefined && (obj.numberValue = message.numberValue) + message.stringValue !== undefined && (obj.stringValue = message.stringValue) + message.boolValue !== undefined && (obj.boolValue = message.boolValue) + message.structValue !== undefined && (obj.structValue = message.structValue) + message.listValue !== undefined && (obj.listValue = message.listValue) + return obj }, fromPartial(object: DeepPartial): Value { - const message = createBaseValue(); - message.nullValue = object.nullValue ?? undefined; - message.numberValue = object.numberValue ?? undefined; - message.stringValue = object.stringValue ?? undefined; - message.boolValue = object.boolValue ?? undefined; - message.structValue = object.structValue ?? undefined; - message.listValue = object.listValue ?? undefined; - return message; + const message = createBaseValue() + message.nullValue = object.nullValue ?? undefined + message.numberValue = object.numberValue ?? undefined + message.stringValue = object.stringValue ?? undefined + message.boolValue = object.boolValue ?? undefined + message.structValue = object.structValue ?? undefined + message.listValue = object.listValue ?? undefined + return message }, wrap(value: any): Value { - const result = createBaseValue(); + const result = createBaseValue() if (value === null) { - result.nullValue = NullValue.NULL_VALUE; - } else if (typeof value === "boolean") { - result.boolValue = value; - } else if (typeof value === "number") { - result.numberValue = value; - } else if (typeof value === "string") { - result.stringValue = value; + result.nullValue = NullValue.NULL_VALUE + } else if (typeof value === 'boolean') { + result.boolValue = value + } else if (typeof value === 'number') { + result.numberValue = value + } else if (typeof value === 'string') { + result.stringValue = value } else if (Array.isArray(value)) { - result.listValue = value; - } else if (typeof value === "object") { - result.structValue = value; - } else if (typeof value !== "undefined") { - throw new Error("Unsupported any value type: " + typeof value); + result.listValue = value + } else if (typeof value === 'object') { + result.structValue = value + } else if (typeof value !== 'undefined') { + throw new Error('Unsupported any value type: ' + typeof value) } - return result; + return result }, unwrap(message: Value): string | number | boolean | Object | null | Array | undefined { if (message?.stringValue !== undefined) { - return message.stringValue; + return message.stringValue } else if (message?.numberValue !== undefined) { - return message.numberValue; + return message.numberValue } else if (message?.boolValue !== undefined) { - return message.boolValue; + return message.boolValue } else if (message?.structValue !== undefined) { - return message.structValue; + return message.structValue } else if (message?.listValue !== undefined) { - return message.listValue; + return message.listValue } else if (message?.nullValue !== undefined) { - return null; + return null } - return undefined; + return undefined }, -}; +} function createBaseListValue(): ListValue { - return { values: [] }; + return { values: [] } } export const ListValue = { encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.values) { - Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim(); + Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ListValue { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListValue(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseListValue() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.values.push(Value.unwrap(Value.decode(reader, reader.uint32()))); - break; + message.values.push(Value.unwrap(Value.decode(reader, reader.uint32()))) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ListValue { - return { values: Array.isArray(object?.values) ? [...object.values] : [] }; + return { values: Array.isArray(object?.values) ? [...object.values] : [] } }, toJSON(message: ListValue): unknown { - const obj: any = {}; + const obj: any = {} if (message.values) { - obj.values = message.values.map((e) => e); + obj.values = message.values.map((e) => e) } else { - obj.values = []; + obj.values = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): ListValue { - const message = createBaseListValue(); - message.values = object.values?.map((e) => e) || []; - return message; + const message = createBaseListValue() + message.values = object.values?.map((e) => e) || [] + return message }, wrap(value: Array | undefined): ListValue { - const result = createBaseListValue(); + const result = createBaseListValue() - result.values = value ?? []; + result.values = value ?? [] - return result; + return result }, unwrap(message: ListValue): Array { - return message.values; + return message.values }, -}; +} -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isObject(value: any): boolean { - return typeof value === "object" && value !== null; + return typeof value === 'object' && value !== null } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protos/src/google/protobuf/timestamp.ts b/packages/protos/src/google/protobuf/timestamp.ts new file mode 100644 index 000000000..f346b10c8 --- /dev/null +++ b/packages/protos/src/google/protobuf/timestamp.ts @@ -0,0 +1,90 @@ +/* eslint-disable */ +import Long from 'long' +import _m0 from 'protobufjs/minimal' + +export interface Timestamp { + seconds: Long + nanos: number +} + +function createBaseTimestamp(): Timestamp { + return { seconds: Long.ZERO, nanos: 0 } +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.seconds.isZero()) { + writer.uint32(8).int64(message.seconds) + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos) + } + return writer + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTimestamp() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64() as Long + break + case 2: + message.nanos = reader.int32() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + + fromJSON(object: any): Timestamp { + return { + seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, + nanos: isSet(object.nanos) ? Number(object.nanos) : 0, + } + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {} + message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()) + message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)) + return obj + }, + + fromPartial(object: DeepPartial): Timestamp { + const message = createBaseTimestamp() + message.seconds = + object.seconds !== undefined && object.seconds !== null ? Long.fromValue(object.seconds) : Long.ZERO + message.nanos = object.nanos ?? 0 + return message + }, +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined + +type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any + _m0.configure() +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined +} diff --git a/packages/sdk/src/gen/index.ts b/packages/protos/src/index.ts similarity index 56% rename from packages/sdk/src/gen/index.ts rename to packages/protos/src/index.ts index 826f29818..63f0e23bd 100644 --- a/packages/sdk/src/gen/index.ts +++ b/packages/protos/src/index.ts @@ -1,3 +1,5 @@ export * from './builtin' export * from './processor/protos/processor' + +// export * from './src/chainquery/protos/chainquery' diff --git a/packages/sdk/src/gen/processor/protos/processor.ts b/packages/protos/src/processor/protos/processor.ts similarity index 57% rename from packages/sdk/src/gen/processor/protos/processor.ts rename to packages/protos/src/processor/protos/processor.ts index d00e7be7d..c011606d1 100644 --- a/packages/sdk/src/gen/processor/protos/processor.ts +++ b/packages/protos/src/processor/protos/processor.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import Long from "long"; -import type { CallContext, CallOptions } from "nice-grpc-common"; -import _m0 from "protobufjs/minimal"; -import { Empty } from "../../google/protobuf/empty"; -import { Struct } from "../../google/protobuf/struct"; +import Long from 'long' +import type { CallContext, CallOptions } from 'nice-grpc-common' +import _m0 from 'protobufjs/minimal' +import { Empty } from '../../google/protobuf/empty' +import { Struct } from '../../google/protobuf/struct' export enum MetricType { UNKNOWN_TYPE = 0, @@ -16,37 +16,37 @@ export enum MetricType { export function metricTypeFromJSON(object: any): MetricType { switch (object) { case 0: - case "UNKNOWN_TYPE": - return MetricType.UNKNOWN_TYPE; + case 'UNKNOWN_TYPE': + return MetricType.UNKNOWN_TYPE case 1: - case "COUNTER": - return MetricType.COUNTER; + case 'COUNTER': + return MetricType.COUNTER case 2: - case "GAUGE": - return MetricType.GAUGE; + case 'GAUGE': + return MetricType.GAUGE case 3: - case "HISTOGRAM": - return MetricType.HISTOGRAM; + case 'HISTOGRAM': + return MetricType.HISTOGRAM case -1: - case "UNRECOGNIZED": + case 'UNRECOGNIZED': default: - return MetricType.UNRECOGNIZED; + return MetricType.UNRECOGNIZED } } export function metricTypeToJSON(object: MetricType): string { switch (object) { case MetricType.UNKNOWN_TYPE: - return "UNKNOWN_TYPE"; + return 'UNKNOWN_TYPE' case MetricType.COUNTER: - return "COUNTER"; + return 'COUNTER' case MetricType.GAUGE: - return "GAUGE"; + return 'GAUGE' case MetricType.HISTOGRAM: - return "HISTOGRAM"; + return 'HISTOGRAM' case MetricType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return 'UNRECOGNIZED' } } @@ -59,27 +59,27 @@ export enum AggregationType { export function aggregationTypeFromJSON(object: any): AggregationType { switch (object) { case 0: - case "COUNT": - return AggregationType.COUNT; + case 'COUNT': + return AggregationType.COUNT case 1: - case "SUM": - return AggregationType.SUM; + case 'SUM': + return AggregationType.SUM case -1: - case "UNRECOGNIZED": + case 'UNRECOGNIZED': default: - return AggregationType.UNRECOGNIZED; + return AggregationType.UNRECOGNIZED } } export function aggregationTypeToJSON(object: AggregationType): string { switch (object) { case AggregationType.COUNT: - return "COUNT"; + return 'COUNT' case AggregationType.SUM: - return "SUM"; + return 'SUM' case AggregationType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return 'UNRECOGNIZED' } } @@ -93,32 +93,32 @@ export enum AddressType { export function addressTypeFromJSON(object: any): AddressType { switch (object) { case 0: - case "ERC20": - return AddressType.ERC20; + case 'ERC20': + return AddressType.ERC20 case 1: - case "ERC721": - return AddressType.ERC721; + case 'ERC721': + return AddressType.ERC721 case 2: - case "ERC1155": - return AddressType.ERC1155; + case 'ERC1155': + return AddressType.ERC1155 case -1: - case "UNRECOGNIZED": + case 'UNRECOGNIZED': default: - return AddressType.UNRECOGNIZED; + return AddressType.UNRECOGNIZED } } export function addressTypeToJSON(object: AddressType): string { switch (object) { case AddressType.ERC20: - return "ERC20"; + return 'ERC20' case AddressType.ERC721: - return "ERC721"; + return 'ERC721' case AddressType.ERC1155: - return "ERC1155"; + return 'ERC1155' case AddressType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return 'UNRECOGNIZED' } } @@ -138,62 +138,62 @@ export enum HandlerType { export function handlerTypeFromJSON(object: any): HandlerType { switch (object) { case 0: - case "UNKNOWN": - return HandlerType.UNKNOWN; + case 'UNKNOWN': + return HandlerType.UNKNOWN case 1: - case "ETH_LOG": - return HandlerType.ETH_LOG; + case 'ETH_LOG': + return HandlerType.ETH_LOG case 2: - case "ETH_BLOCK": - return HandlerType.ETH_BLOCK; + case 'ETH_BLOCK': + return HandlerType.ETH_BLOCK case 5: - case "ETH_TRACE": - return HandlerType.ETH_TRACE; + case 'ETH_TRACE': + return HandlerType.ETH_TRACE case 4: - case "SOL_INSTRUCTION": - return HandlerType.SOL_INSTRUCTION; + case 'SOL_INSTRUCTION': + return HandlerType.SOL_INSTRUCTION case 6: - case "APT_EVENT": - return HandlerType.APT_EVENT; + case 'APT_EVENT': + return HandlerType.APT_EVENT case 7: - case "APT_CALL": - return HandlerType.APT_CALL; + case 'APT_CALL': + return HandlerType.APT_CALL case 8: - case "APT_RESOURCE": - return HandlerType.APT_RESOURCE; + case 'APT_RESOURCE': + return HandlerType.APT_RESOURCE case 3: - case "SUI_TRANSACTION": - return HandlerType.SUI_TRANSACTION; + case 'SUI_TRANSACTION': + return HandlerType.SUI_TRANSACTION case -1: - case "UNRECOGNIZED": + case 'UNRECOGNIZED': default: - return HandlerType.UNRECOGNIZED; + return HandlerType.UNRECOGNIZED } } export function handlerTypeToJSON(object: HandlerType): string { switch (object) { case HandlerType.UNKNOWN: - return "UNKNOWN"; + return 'UNKNOWN' case HandlerType.ETH_LOG: - return "ETH_LOG"; + return 'ETH_LOG' case HandlerType.ETH_BLOCK: - return "ETH_BLOCK"; + return 'ETH_BLOCK' case HandlerType.ETH_TRACE: - return "ETH_TRACE"; + return 'ETH_TRACE' case HandlerType.SOL_INSTRUCTION: - return "SOL_INSTRUCTION"; + return 'SOL_INSTRUCTION' case HandlerType.APT_EVENT: - return "APT_EVENT"; + return 'APT_EVENT' case HandlerType.APT_CALL: - return "APT_CALL"; + return 'APT_CALL' case HandlerType.APT_RESOURCE: - return "APT_RESOURCE"; + return 'APT_RESOURCE' case HandlerType.SUI_TRANSACTION: - return "SUI_TRANSACTION"; + return 'SUI_TRANSACTION' case HandlerType.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return 'UNRECOGNIZED' } } @@ -209,78 +209,76 @@ export enum LogLevel { export function logLevelFromJSON(object: any): LogLevel { switch (object) { case 0: - case "DEBUG": - return LogLevel.DEBUG; + case 'DEBUG': + return LogLevel.DEBUG case 1: - case "INFO": - return LogLevel.INFO; + case 'INFO': + return LogLevel.INFO case 2: - case "WARNING": - return LogLevel.WARNING; + case 'WARNING': + return LogLevel.WARNING case 3: - case "ERROR": - return LogLevel.ERROR; + case 'ERROR': + return LogLevel.ERROR case 4: - case "CRITICAL": - return LogLevel.CRITICAL; + case 'CRITICAL': + return LogLevel.CRITICAL case -1: - case "UNRECOGNIZED": + case 'UNRECOGNIZED': default: - return LogLevel.UNRECOGNIZED; + return LogLevel.UNRECOGNIZED } } export function logLevelToJSON(object: LogLevel): string { switch (object) { case LogLevel.DEBUG: - return "DEBUG"; + return 'DEBUG' case LogLevel.INFO: - return "INFO"; + return 'INFO' case LogLevel.WARNING: - return "WARNING"; + return 'WARNING' case LogLevel.ERROR: - return "ERROR"; + return 'ERROR' case LogLevel.CRITICAL: - return "CRITICAL"; + return 'CRITICAL' case LogLevel.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return 'UNRECOGNIZED' } } export interface ProjectConfig { - name: string; - version: string; + name: string + version: string } -export interface ProcessConfigRequest { -} +export interface ProcessConfigRequest {} export interface ProcessConfigResponse { - config: ProjectConfig | undefined; - contractConfigs: ContractConfig[]; - templateInstances: TemplateInstance[]; - accountConfigs: AccountConfig[]; - metricConfigs: MetricConfig[]; - eventTrackingConfigs: EventTrackingConfig[]; - exportConfigs: ExportConfig[]; + config: ProjectConfig | undefined + contractConfigs: ContractConfig[] + templateInstances: TemplateInstance[] + accountConfigs: AccountConfig[] + metricConfigs: MetricConfig[] + eventTrackingConfigs: EventTrackingConfig[] + exportConfigs: ExportConfig[] } export interface ContractConfig { - contract: ContractInfo | undefined; - intervalConfigs: OnIntervalConfig[]; - logConfigs: LogHandlerConfig[]; - traceConfigs: TraceHandlerConfig[]; - aptosEventConfigs: AptosEventHandlerConfig[]; - aptosCallConfigs: AptosCallHandlerConfig[]; - instructionConfig: InstructionHandlerConfig | undefined; - startBlock: Long; - endBlock: Long; - processorType: string; + contract: ContractInfo | undefined + intervalConfigs: OnIntervalConfig[] + logConfigs: LogHandlerConfig[] + traceConfigs: TraceHandlerConfig[] + aptosEventConfigs: AptosEventHandlerConfig[] + aptosCallConfigs: AptosCallHandlerConfig[] + instructionConfig: InstructionHandlerConfig | undefined + startBlock: Long + endBlock: Long + processorType: string } -export interface TotalPerEntityAggregation { -} +export interface TotalPerEntityAggregation {} export enum TotalPerEntityAggregation_Type { AVG = 0, @@ -291,406 +289,406 @@ export enum TotalPerEntityAggregation_Type { export function totalPerEntityAggregation_TypeFromJSON(object: any): TotalPerEntityAggregation_Type { switch (object) { case 0: - case "AVG": - return TotalPerEntityAggregation_Type.AVG; + case 'AVG': + return TotalPerEntityAggregation_Type.AVG case 1: - case "MEDIAN": - return TotalPerEntityAggregation_Type.MEDIAN; + case 'MEDIAN': + return TotalPerEntityAggregation_Type.MEDIAN case -1: - case "UNRECOGNIZED": + case 'UNRECOGNIZED': default: - return TotalPerEntityAggregation_Type.UNRECOGNIZED; + return TotalPerEntityAggregation_Type.UNRECOGNIZED } } export function totalPerEntityAggregation_TypeToJSON(object: TotalPerEntityAggregation_Type): string { switch (object) { case TotalPerEntityAggregation_Type.AVG: - return "AVG"; + return 'AVG' case TotalPerEntityAggregation_Type.MEDIAN: - return "MEDIAN"; + return 'MEDIAN' case TotalPerEntityAggregation_Type.UNRECOGNIZED: default: - return "UNRECOGNIZED"; + return 'UNRECOGNIZED' } } export interface RetentionConfig { - retentionEventName: string; - days: number; + retentionEventName: string + days: number } export interface EventTrackingConfig { - eventName: string; - totalByDay: boolean; - unique: boolean; - totalPerEntity: TotalPerEntityAggregation | undefined; - distinctAggregationByDays: number[]; - retentionConfig: RetentionConfig | undefined; + eventName: string + totalByDay: boolean + unique: boolean + totalPerEntity: TotalPerEntityAggregation | undefined + distinctAggregationByDays: number[] + retentionConfig: RetentionConfig | undefined } export interface ExportConfig { - name: string; - channel: string; + name: string + channel: string } export interface MetricConfig { - name: string; - description: string; - unit: string; - sparse: boolean; - type: MetricType; - aggregationConfig: AggregationConfig | undefined; + name: string + description: string + unit: string + sparse: boolean + type: MetricType + aggregationConfig: AggregationConfig | undefined } export interface AggregationConfig { - intervalInMinutes: number[]; - types: AggregationType[]; - discardOrigin: boolean; + intervalInMinutes: number[] + types: AggregationType[] + discardOrigin: boolean } export interface AccountConfig { - chainId: string; - address: string; - startBlock: Long; - intervalConfigs: OnIntervalConfig[]; - aptosIntervalConfigs: AptosOnIntervalConfig[]; - logConfigs: LogHandlerConfig[]; + chainId: string + address: string + startBlock: Long + intervalConfigs: OnIntervalConfig[] + aptosIntervalConfigs: AptosOnIntervalConfig[] + logConfigs: LogHandlerConfig[] } export interface HandleInterval { - recentInterval: number; - backfillInterval: number; + recentInterval: number + backfillInterval: number } export interface OnIntervalConfig { - handlerId: number; - minutes: number; - minutesInterval?: HandleInterval | undefined; - slot: number; - slotInterval?: HandleInterval | undefined; + handlerId: number + minutes: number + minutesInterval?: HandleInterval | undefined + slot: number + slotInterval?: HandleInterval | undefined } export interface AptosOnIntervalConfig { - intervalConfig: OnIntervalConfig | undefined; - type: string; + intervalConfig: OnIntervalConfig | undefined + type: string } export interface ContractInfo { - name: string; - chainId: string; - address: string; - abi: string; + name: string + chainId: string + address: string + abi: string } export interface TemplateInstance { - contract: ContractInfo | undefined; - startBlock: Long; - endBlock: Long; - templateId: number; + contract: ContractInfo | undefined + startBlock: Long + endBlock: Long + templateId: number } export interface StartRequest { - templateInstances: TemplateInstance[]; + templateInstances: TemplateInstance[] } export interface BlockHandlerConfig { - handlerId: number; + handlerId: number } export interface TraceHandlerConfig { - signature: string; - handlerId: number; + signature: string + handlerId: number } export interface LogHandlerConfig { - filters: LogFilter[]; - handlerId: number; + filters: LogFilter[] + handlerId: number } export interface LogFilter { - topics: Topic[]; - address?: string | undefined; - addressType?: AddressType | undefined; + topics: Topic[] + address?: string | undefined + addressType?: AddressType | undefined } export interface InstructionHandlerConfig { - innerInstruction: boolean; - parsedInstruction: boolean; - rawDataInstruction: boolean; + innerInstruction: boolean + parsedInstruction: boolean + rawDataInstruction: boolean } export interface AptosEventHandlerConfig { - filters: AptosEventFilter[]; - handlerId: number; + filters: AptosEventFilter[] + handlerId: number } export interface AptosEventFilter { - type: string; - account: string; + type: string + account: string } export interface AptosCallHandlerConfig { - filters: AptosCallFilter[]; - handlerId: number; + filters: AptosCallFilter[] + handlerId: number } export interface AptosCallFilter { - function: string; - typeArguments: string[]; - withTypeArguments: boolean; - includeFailed: boolean; + function: string + typeArguments: string[] + withTypeArguments: boolean + includeFailed: boolean } export interface Topic { - hashes: string[]; + hashes: string[] } export interface ProcessBindingsRequest { - bindings: DataBinding[]; + bindings: DataBinding[] } export interface ProcessBindingResponse { - result: ProcessResult | undefined; - configUpdated: boolean; + result: ProcessResult | undefined + configUpdated: boolean } export interface RawTransaction { - raw: Uint8Array; - programAccountId?: string | undefined; - slot?: Long | undefined; + raw: Uint8Array + programAccountId?: string | undefined + slot?: Long | undefined } export interface Data { - raw: Uint8Array; - ethLog?: Data_EthLog | undefined; - ethBlock?: Data_EthBlock | undefined; - ethTransaction?: Data_EthTransaction | undefined; - ethTrace?: Data_EthTrace | undefined; - solInstruction?: Data_SolInstruction | undefined; - aptEvent?: Data_AptEvent | undefined; - aptCall?: Data_AptCall | undefined; - aptResource?: Data_AptResource | undefined; + raw: Uint8Array + ethLog?: Data_EthLog | undefined + ethBlock?: Data_EthBlock | undefined + ethTransaction?: Data_EthTransaction | undefined + ethTrace?: Data_EthTrace | undefined + solInstruction?: Data_SolInstruction | undefined + aptEvent?: Data_AptEvent | undefined + aptCall?: Data_AptCall | undefined + aptResource?: Data_AptResource | undefined } export interface Data_EthLog { - log: { [key: string]: any } | undefined; - transaction?: Uint8Array | undefined; + log: { [key: string]: any } | undefined + transaction?: Uint8Array | undefined } export interface Data_EthBlock { - block: { [key: string]: any } | undefined; + block: { [key: string]: any } | undefined } export interface Data_EthTransaction { - transaction: { [key: string]: any } | undefined; - transactionReceipt?: Uint8Array | undefined; + transaction: { [key: string]: any } | undefined + transactionReceipt?: Uint8Array | undefined } export interface Data_EthTrace { - trace: { [key: string]: any } | undefined; - transaction?: Uint8Array | undefined; - transactionReceipt?: Uint8Array | undefined; + trace: { [key: string]: any } | undefined + transaction?: Uint8Array | undefined + transactionReceipt?: Uint8Array | undefined } export interface Data_SolInstruction { - instructionData: string; - slot: Long; - programAccountId: string; - accounts: string[]; - parsed?: { [key: string]: any } | undefined; + instructionData: string + slot: Long + programAccountId: string + accounts: string[] + parsed?: { [key: string]: any } | undefined } export interface Data_AptEvent { - event: { [key: string]: any } | undefined; + event: { [key: string]: any } | undefined } export interface Data_AptCall { - call: { [key: string]: any } | undefined; + call: { [key: string]: any } | undefined } export interface Data_AptResource { - resources: { [key: string]: any }[]; - version: Long; - timestampMicros: Long; + resources: { [key: string]: any }[] + version: Long + timestampMicros: Long } export interface DataBinding { - data: Data | undefined; - handlerType: HandlerType; - handlerIds: number[]; + data: Data | undefined + handlerType: HandlerType + handlerIds: number[] } export interface ProcessResult { - gauges: GaugeResult[]; - counters: CounterResult[]; - logs: LogResult[]; - events: EventTrackingResult[]; - exports: ExportResult[]; + gauges: GaugeResult[] + counters: CounterResult[] + logs: LogResult[] + events: EventTrackingResult[] + exports: ExportResult[] } export interface RecordMetaData { - address: string; - contractName: string; - blockNumber: Long; - transactionHash: string; - chainId: string; - transactionIndex: number; - logIndex: number; - name: string; - labels: { [key: string]: string }; + address: string + contractName: string + blockNumber: Long + transactionHash: string + chainId: string + transactionIndex: number + logIndex: number + name: string + labels: { [key: string]: string } } export interface RecordMetaData_LabelsEntry { - key: string; - value: string; + key: string + value: string } export interface MetricValue { - bigDecimal?: string | undefined; - doubleValue?: number | undefined; - bigInteger?: BigInteger | undefined; + bigDecimal?: string | undefined + doubleValue?: number | undefined + bigInteger?: BigInteger | undefined } export interface BigInteger { - negative: boolean; - data: Uint8Array; + negative: boolean + data: Uint8Array } export interface RuntimeInfo { - from: HandlerType; + from: HandlerType } export interface GaugeResult { - metadata: RecordMetaData | undefined; - metricValue: MetricValue | undefined; - runtimeInfo: RuntimeInfo | undefined; + metadata: RecordMetaData | undefined + metricValue: MetricValue | undefined + runtimeInfo: RuntimeInfo | undefined } export interface CounterResult { - metadata: RecordMetaData | undefined; - metricValue: MetricValue | undefined; - add: boolean; - runtimeInfo: RuntimeInfo | undefined; + metadata: RecordMetaData | undefined + metricValue: MetricValue | undefined + add: boolean + runtimeInfo: RuntimeInfo | undefined } export interface LogResult { - metadata: RecordMetaData | undefined; - level: LogLevel; - message: string; - attributes: string; - runtimeInfo: RuntimeInfo | undefined; + metadata: RecordMetaData | undefined + level: LogLevel + message: string + attributes: string + runtimeInfo: RuntimeInfo | undefined } export interface EventTrackingResult { - metadata: RecordMetaData | undefined; - distinctEntityId: string; - attributes: string; - runtimeInfo: RuntimeInfo | undefined; + metadata: RecordMetaData | undefined + distinctEntityId: string + attributes: string + runtimeInfo: RuntimeInfo | undefined } export interface ExportResult { - metadata: RecordMetaData | undefined; - payload: string; - runtimeInfo: RuntimeInfo | undefined; + metadata: RecordMetaData | undefined + payload: string + runtimeInfo: RuntimeInfo | undefined } function createBaseProjectConfig(): ProjectConfig { - return { name: "", version: "" }; + return { name: '', version: '' } } export const ProjectConfig = { encode(message: ProjectConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); + if (message.name !== '') { + writer.uint32(10).string(message.name) } - if (message.version !== "") { - writer.uint32(26).string(message.version); + if (message.version !== '') { + writer.uint32(26).string(message.version) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProjectConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProjectConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProjectConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 3: - message.version = reader.string(); - break; + message.version = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProjectConfig { return { - name: isSet(object.name) ? String(object.name) : "", - version: isSet(object.version) ? String(object.version) : "", - }; + name: isSet(object.name) ? String(object.name) : '', + version: isSet(object.version) ? String(object.version) : '', + } }, toJSON(message: ProjectConfig): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.version !== undefined && (obj.version = message.version); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.version !== undefined && (obj.version = message.version) + return obj }, fromPartial(object: DeepPartial): ProjectConfig { - const message = createBaseProjectConfig(); - message.name = object.name ?? ""; - message.version = object.version ?? ""; - return message; + const message = createBaseProjectConfig() + message.name = object.name ?? '' + message.version = object.version ?? '' + return message }, -}; +} function createBaseProcessConfigRequest(): ProcessConfigRequest { - return {}; + return {} } export const ProcessConfigRequest = { encode(_: ProcessConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProcessConfigRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessConfigRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProcessConfigRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): ProcessConfigRequest { - return {}; + return {} }, toJSON(_: ProcessConfigRequest): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial(_: DeepPartial): ProcessConfigRequest { - const message = createBaseProcessConfigRequest(); - return message; + const message = createBaseProcessConfigRequest() + return message }, -}; +} function createBaseProcessConfigResponse(): ProcessConfigResponse { return { @@ -701,69 +699,69 @@ function createBaseProcessConfigResponse(): ProcessConfigResponse { metricConfigs: [], eventTrackingConfigs: [], exportConfigs: [], - }; + } } export const ProcessConfigResponse = { encode(message: ProcessConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.config !== undefined) { - ProjectConfig.encode(message.config, writer.uint32(10).fork()).ldelim(); + ProjectConfig.encode(message.config, writer.uint32(10).fork()).ldelim() } for (const v of message.contractConfigs) { - ContractConfig.encode(v!, writer.uint32(18).fork()).ldelim(); + ContractConfig.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.templateInstances) { - TemplateInstance.encode(v!, writer.uint32(26).fork()).ldelim(); + TemplateInstance.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.accountConfigs) { - AccountConfig.encode(v!, writer.uint32(34).fork()).ldelim(); + AccountConfig.encode(v!, writer.uint32(34).fork()).ldelim() } for (const v of message.metricConfigs) { - MetricConfig.encode(v!, writer.uint32(42).fork()).ldelim(); + MetricConfig.encode(v!, writer.uint32(42).fork()).ldelim() } for (const v of message.eventTrackingConfigs) { - EventTrackingConfig.encode(v!, writer.uint32(50).fork()).ldelim(); + EventTrackingConfig.encode(v!, writer.uint32(50).fork()).ldelim() } for (const v of message.exportConfigs) { - ExportConfig.encode(v!, writer.uint32(58).fork()).ldelim(); + ExportConfig.encode(v!, writer.uint32(58).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProcessConfigResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessConfigResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProcessConfigResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.config = ProjectConfig.decode(reader, reader.uint32()); - break; + message.config = ProjectConfig.decode(reader, reader.uint32()) + break case 2: - message.contractConfigs.push(ContractConfig.decode(reader, reader.uint32())); - break; + message.contractConfigs.push(ContractConfig.decode(reader, reader.uint32())) + break case 3: - message.templateInstances.push(TemplateInstance.decode(reader, reader.uint32())); - break; + message.templateInstances.push(TemplateInstance.decode(reader, reader.uint32())) + break case 4: - message.accountConfigs.push(AccountConfig.decode(reader, reader.uint32())); - break; + message.accountConfigs.push(AccountConfig.decode(reader, reader.uint32())) + break case 5: - message.metricConfigs.push(MetricConfig.decode(reader, reader.uint32())); - break; + message.metricConfigs.push(MetricConfig.decode(reader, reader.uint32())) + break case 6: - message.eventTrackingConfigs.push(EventTrackingConfig.decode(reader, reader.uint32())); - break; + message.eventTrackingConfigs.push(EventTrackingConfig.decode(reader, reader.uint32())) + break case 7: - message.exportConfigs.push(ExportConfig.decode(reader, reader.uint32())); - break; + message.exportConfigs.push(ExportConfig.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProcessConfigResponse { @@ -787,59 +785,60 @@ export const ProcessConfigResponse = { exportConfigs: Array.isArray(object?.exportConfigs) ? object.exportConfigs.map((e: any) => ExportConfig.fromJSON(e)) : [], - }; + } }, toJSON(message: ProcessConfigResponse): unknown { - const obj: any = {}; - message.config !== undefined && (obj.config = message.config ? ProjectConfig.toJSON(message.config) : undefined); + const obj: any = {} + message.config !== undefined && (obj.config = message.config ? ProjectConfig.toJSON(message.config) : undefined) if (message.contractConfigs) { - obj.contractConfigs = message.contractConfigs.map((e) => e ? ContractConfig.toJSON(e) : undefined); + obj.contractConfigs = message.contractConfigs.map((e) => (e ? ContractConfig.toJSON(e) : undefined)) } else { - obj.contractConfigs = []; + obj.contractConfigs = [] } if (message.templateInstances) { - obj.templateInstances = message.templateInstances.map((e) => e ? TemplateInstance.toJSON(e) : undefined); + obj.templateInstances = message.templateInstances.map((e) => (e ? TemplateInstance.toJSON(e) : undefined)) } else { - obj.templateInstances = []; + obj.templateInstances = [] } if (message.accountConfigs) { - obj.accountConfigs = message.accountConfigs.map((e) => e ? AccountConfig.toJSON(e) : undefined); + obj.accountConfigs = message.accountConfigs.map((e) => (e ? AccountConfig.toJSON(e) : undefined)) } else { - obj.accountConfigs = []; + obj.accountConfigs = [] } if (message.metricConfigs) { - obj.metricConfigs = message.metricConfigs.map((e) => e ? MetricConfig.toJSON(e) : undefined); + obj.metricConfigs = message.metricConfigs.map((e) => (e ? MetricConfig.toJSON(e) : undefined)) } else { - obj.metricConfigs = []; + obj.metricConfigs = [] } if (message.eventTrackingConfigs) { - obj.eventTrackingConfigs = message.eventTrackingConfigs.map((e) => e ? EventTrackingConfig.toJSON(e) : undefined); + obj.eventTrackingConfigs = message.eventTrackingConfigs.map((e) => + e ? EventTrackingConfig.toJSON(e) : undefined + ) } else { - obj.eventTrackingConfigs = []; + obj.eventTrackingConfigs = [] } if (message.exportConfigs) { - obj.exportConfigs = message.exportConfigs.map((e) => e ? ExportConfig.toJSON(e) : undefined); + obj.exportConfigs = message.exportConfigs.map((e) => (e ? ExportConfig.toJSON(e) : undefined)) } else { - obj.exportConfigs = []; + obj.exportConfigs = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): ProcessConfigResponse { - const message = createBaseProcessConfigResponse(); - message.config = (object.config !== undefined && object.config !== null) - ? ProjectConfig.fromPartial(object.config) - : undefined; - message.contractConfigs = object.contractConfigs?.map((e) => ContractConfig.fromPartial(e)) || []; - message.templateInstances = object.templateInstances?.map((e) => TemplateInstance.fromPartial(e)) || []; - message.accountConfigs = object.accountConfigs?.map((e) => AccountConfig.fromPartial(e)) || []; - message.metricConfigs = object.metricConfigs?.map((e) => MetricConfig.fromPartial(e)) || []; - message.eventTrackingConfigs = object.eventTrackingConfigs?.map((e) => EventTrackingConfig.fromPartial(e)) || []; - message.exportConfigs = object.exportConfigs?.map((e) => ExportConfig.fromPartial(e)) || []; - return message; - }, -}; + const message = createBaseProcessConfigResponse() + message.config = + object.config !== undefined && object.config !== null ? ProjectConfig.fromPartial(object.config) : undefined + message.contractConfigs = object.contractConfigs?.map((e) => ContractConfig.fromPartial(e)) || [] + message.templateInstances = object.templateInstances?.map((e) => TemplateInstance.fromPartial(e)) || [] + message.accountConfigs = object.accountConfigs?.map((e) => AccountConfig.fromPartial(e)) || [] + message.metricConfigs = object.metricConfigs?.map((e) => MetricConfig.fromPartial(e)) || [] + message.eventTrackingConfigs = object.eventTrackingConfigs?.map((e) => EventTrackingConfig.fromPartial(e)) || [] + message.exportConfigs = object.exportConfigs?.map((e) => ExportConfig.fromPartial(e)) || [] + return message + }, +} function createBaseContractConfig(): ContractConfig { return { @@ -852,88 +851,88 @@ function createBaseContractConfig(): ContractConfig { instructionConfig: undefined, startBlock: Long.UZERO, endBlock: Long.UZERO, - processorType: "", - }; + processorType: '', + } } export const ContractConfig = { encode(message: ContractConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.contract !== undefined) { - ContractInfo.encode(message.contract, writer.uint32(10).fork()).ldelim(); + ContractInfo.encode(message.contract, writer.uint32(10).fork()).ldelim() } for (const v of message.intervalConfigs) { - OnIntervalConfig.encode(v!, writer.uint32(90).fork()).ldelim(); + OnIntervalConfig.encode(v!, writer.uint32(90).fork()).ldelim() } for (const v of message.logConfigs) { - LogHandlerConfig.encode(v!, writer.uint32(26).fork()).ldelim(); + LogHandlerConfig.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.traceConfigs) { - TraceHandlerConfig.encode(v!, writer.uint32(18).fork()).ldelim(); + TraceHandlerConfig.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.aptosEventConfigs) { - AptosEventHandlerConfig.encode(v!, writer.uint32(74).fork()).ldelim(); + AptosEventHandlerConfig.encode(v!, writer.uint32(74).fork()).ldelim() } for (const v of message.aptosCallConfigs) { - AptosCallHandlerConfig.encode(v!, writer.uint32(82).fork()).ldelim(); + AptosCallHandlerConfig.encode(v!, writer.uint32(82).fork()).ldelim() } if (message.instructionConfig !== undefined) { - InstructionHandlerConfig.encode(message.instructionConfig, writer.uint32(50).fork()).ldelim(); + InstructionHandlerConfig.encode(message.instructionConfig, writer.uint32(50).fork()).ldelim() } if (!message.startBlock.isZero()) { - writer.uint32(32).uint64(message.startBlock); + writer.uint32(32).uint64(message.startBlock) } if (!message.endBlock.isZero()) { - writer.uint32(40).uint64(message.endBlock); + writer.uint32(40).uint64(message.endBlock) } - if (message.processorType !== "") { - writer.uint32(66).string(message.processorType); + if (message.processorType !== '') { + writer.uint32(66).string(message.processorType) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ContractConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContractConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContractConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.contract = ContractInfo.decode(reader, reader.uint32()); - break; + message.contract = ContractInfo.decode(reader, reader.uint32()) + break case 11: - message.intervalConfigs.push(OnIntervalConfig.decode(reader, reader.uint32())); - break; + message.intervalConfigs.push(OnIntervalConfig.decode(reader, reader.uint32())) + break case 3: - message.logConfigs.push(LogHandlerConfig.decode(reader, reader.uint32())); - break; + message.logConfigs.push(LogHandlerConfig.decode(reader, reader.uint32())) + break case 2: - message.traceConfigs.push(TraceHandlerConfig.decode(reader, reader.uint32())); - break; + message.traceConfigs.push(TraceHandlerConfig.decode(reader, reader.uint32())) + break case 9: - message.aptosEventConfigs.push(AptosEventHandlerConfig.decode(reader, reader.uint32())); - break; + message.aptosEventConfigs.push(AptosEventHandlerConfig.decode(reader, reader.uint32())) + break case 10: - message.aptosCallConfigs.push(AptosCallHandlerConfig.decode(reader, reader.uint32())); - break; + message.aptosCallConfigs.push(AptosCallHandlerConfig.decode(reader, reader.uint32())) + break case 6: - message.instructionConfig = InstructionHandlerConfig.decode(reader, reader.uint32()); - break; + message.instructionConfig = InstructionHandlerConfig.decode(reader, reader.uint32()) + break case 4: - message.startBlock = reader.uint64() as Long; - break; + message.startBlock = reader.uint64() as Long + break case 5: - message.endBlock = reader.uint64() as Long; - break; + message.endBlock = reader.uint64() as Long + break case 8: - message.processorType = reader.string(); - break; + message.processorType = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ContractConfig { @@ -959,248 +958,247 @@ export const ContractConfig = { : undefined, startBlock: isSet(object.startBlock) ? Long.fromValue(object.startBlock) : Long.UZERO, endBlock: isSet(object.endBlock) ? Long.fromValue(object.endBlock) : Long.UZERO, - processorType: isSet(object.processorType) ? String(object.processorType) : "", - }; + processorType: isSet(object.processorType) ? String(object.processorType) : '', + } }, toJSON(message: ContractConfig): unknown { - const obj: any = {}; + const obj: any = {} message.contract !== undefined && - (obj.contract = message.contract ? ContractInfo.toJSON(message.contract) : undefined); + (obj.contract = message.contract ? ContractInfo.toJSON(message.contract) : undefined) if (message.intervalConfigs) { - obj.intervalConfigs = message.intervalConfigs.map((e) => e ? OnIntervalConfig.toJSON(e) : undefined); + obj.intervalConfigs = message.intervalConfigs.map((e) => (e ? OnIntervalConfig.toJSON(e) : undefined)) } else { - obj.intervalConfigs = []; + obj.intervalConfigs = [] } if (message.logConfigs) { - obj.logConfigs = message.logConfigs.map((e) => e ? LogHandlerConfig.toJSON(e) : undefined); + obj.logConfigs = message.logConfigs.map((e) => (e ? LogHandlerConfig.toJSON(e) : undefined)) } else { - obj.logConfigs = []; + obj.logConfigs = [] } if (message.traceConfigs) { - obj.traceConfigs = message.traceConfigs.map((e) => e ? TraceHandlerConfig.toJSON(e) : undefined); + obj.traceConfigs = message.traceConfigs.map((e) => (e ? TraceHandlerConfig.toJSON(e) : undefined)) } else { - obj.traceConfigs = []; + obj.traceConfigs = [] } if (message.aptosEventConfigs) { - obj.aptosEventConfigs = message.aptosEventConfigs.map((e) => e ? AptosEventHandlerConfig.toJSON(e) : undefined); + obj.aptosEventConfigs = message.aptosEventConfigs.map((e) => (e ? AptosEventHandlerConfig.toJSON(e) : undefined)) } else { - obj.aptosEventConfigs = []; + obj.aptosEventConfigs = [] } if (message.aptosCallConfigs) { - obj.aptosCallConfigs = message.aptosCallConfigs.map((e) => e ? AptosCallHandlerConfig.toJSON(e) : undefined); + obj.aptosCallConfigs = message.aptosCallConfigs.map((e) => (e ? AptosCallHandlerConfig.toJSON(e) : undefined)) } else { - obj.aptosCallConfigs = []; + obj.aptosCallConfigs = [] } - message.instructionConfig !== undefined && (obj.instructionConfig = message.instructionConfig - ? InstructionHandlerConfig.toJSON(message.instructionConfig) - : undefined); - message.startBlock !== undefined && (obj.startBlock = (message.startBlock || Long.UZERO).toString()); - message.endBlock !== undefined && (obj.endBlock = (message.endBlock || Long.UZERO).toString()); - message.processorType !== undefined && (obj.processorType = message.processorType); - return obj; + message.instructionConfig !== undefined && + (obj.instructionConfig = message.instructionConfig + ? InstructionHandlerConfig.toJSON(message.instructionConfig) + : undefined) + message.startBlock !== undefined && (obj.startBlock = (message.startBlock || Long.UZERO).toString()) + message.endBlock !== undefined && (obj.endBlock = (message.endBlock || Long.UZERO).toString()) + message.processorType !== undefined && (obj.processorType = message.processorType) + return obj }, fromPartial(object: DeepPartial): ContractConfig { - const message = createBaseContractConfig(); - message.contract = (object.contract !== undefined && object.contract !== null) - ? ContractInfo.fromPartial(object.contract) - : undefined; - message.intervalConfigs = object.intervalConfigs?.map((e) => OnIntervalConfig.fromPartial(e)) || []; - message.logConfigs = object.logConfigs?.map((e) => LogHandlerConfig.fromPartial(e)) || []; - message.traceConfigs = object.traceConfigs?.map((e) => TraceHandlerConfig.fromPartial(e)) || []; - message.aptosEventConfigs = object.aptosEventConfigs?.map((e) => AptosEventHandlerConfig.fromPartial(e)) || []; - message.aptosCallConfigs = object.aptosCallConfigs?.map((e) => AptosCallHandlerConfig.fromPartial(e)) || []; - message.instructionConfig = (object.instructionConfig !== undefined && object.instructionConfig !== null) - ? InstructionHandlerConfig.fromPartial(object.instructionConfig) - : undefined; - message.startBlock = (object.startBlock !== undefined && object.startBlock !== null) - ? Long.fromValue(object.startBlock) - : Long.UZERO; - message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) - ? Long.fromValue(object.endBlock) - : Long.UZERO; - message.processorType = object.processorType ?? ""; - return message; - }, -}; + const message = createBaseContractConfig() + message.contract = + object.contract !== undefined && object.contract !== null ? ContractInfo.fromPartial(object.contract) : undefined + message.intervalConfigs = object.intervalConfigs?.map((e) => OnIntervalConfig.fromPartial(e)) || [] + message.logConfigs = object.logConfigs?.map((e) => LogHandlerConfig.fromPartial(e)) || [] + message.traceConfigs = object.traceConfigs?.map((e) => TraceHandlerConfig.fromPartial(e)) || [] + message.aptosEventConfigs = object.aptosEventConfigs?.map((e) => AptosEventHandlerConfig.fromPartial(e)) || [] + message.aptosCallConfigs = object.aptosCallConfigs?.map((e) => AptosCallHandlerConfig.fromPartial(e)) || [] + message.instructionConfig = + object.instructionConfig !== undefined && object.instructionConfig !== null + ? InstructionHandlerConfig.fromPartial(object.instructionConfig) + : undefined + message.startBlock = + object.startBlock !== undefined && object.startBlock !== null ? Long.fromValue(object.startBlock) : Long.UZERO + message.endBlock = + object.endBlock !== undefined && object.endBlock !== null ? Long.fromValue(object.endBlock) : Long.UZERO + message.processorType = object.processorType ?? '' + return message + }, +} function createBaseTotalPerEntityAggregation(): TotalPerEntityAggregation { - return {}; + return {} } export const TotalPerEntityAggregation = { encode(_: TotalPerEntityAggregation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TotalPerEntityAggregation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTotalPerEntityAggregation(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTotalPerEntityAggregation() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(_: any): TotalPerEntityAggregation { - return {}; + return {} }, toJSON(_: TotalPerEntityAggregation): unknown { - const obj: any = {}; - return obj; + const obj: any = {} + return obj }, fromPartial(_: DeepPartial): TotalPerEntityAggregation { - const message = createBaseTotalPerEntityAggregation(); - return message; + const message = createBaseTotalPerEntityAggregation() + return message }, -}; +} function createBaseRetentionConfig(): RetentionConfig { - return { retentionEventName: "", days: 0 }; + return { retentionEventName: '', days: 0 } } export const RetentionConfig = { encode(message: RetentionConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.retentionEventName !== "") { - writer.uint32(18).string(message.retentionEventName); + if (message.retentionEventName !== '') { + writer.uint32(18).string(message.retentionEventName) } if (message.days !== 0) { - writer.uint32(24).int32(message.days); + writer.uint32(24).int32(message.days) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RetentionConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRetentionConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRetentionConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.retentionEventName = reader.string(); - break; + message.retentionEventName = reader.string() + break case 3: - message.days = reader.int32(); - break; + message.days = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RetentionConfig { return { - retentionEventName: isSet(object.retentionEventName) ? String(object.retentionEventName) : "", + retentionEventName: isSet(object.retentionEventName) ? String(object.retentionEventName) : '', days: isSet(object.days) ? Number(object.days) : 0, - }; + } }, toJSON(message: RetentionConfig): unknown { - const obj: any = {}; - message.retentionEventName !== undefined && (obj.retentionEventName = message.retentionEventName); - message.days !== undefined && (obj.days = Math.round(message.days)); - return obj; + const obj: any = {} + message.retentionEventName !== undefined && (obj.retentionEventName = message.retentionEventName) + message.days !== undefined && (obj.days = Math.round(message.days)) + return obj }, fromPartial(object: DeepPartial): RetentionConfig { - const message = createBaseRetentionConfig(); - message.retentionEventName = object.retentionEventName ?? ""; - message.days = object.days ?? 0; - return message; + const message = createBaseRetentionConfig() + message.retentionEventName = object.retentionEventName ?? '' + message.days = object.days ?? 0 + return message }, -}; +} function createBaseEventTrackingConfig(): EventTrackingConfig { return { - eventName: "", + eventName: '', totalByDay: false, unique: false, totalPerEntity: undefined, distinctAggregationByDays: [], retentionConfig: undefined, - }; + } } export const EventTrackingConfig = { encode(message: EventTrackingConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.eventName !== "") { - writer.uint32(10).string(message.eventName); + if (message.eventName !== '') { + writer.uint32(10).string(message.eventName) } if (message.totalByDay === true) { - writer.uint32(16).bool(message.totalByDay); + writer.uint32(16).bool(message.totalByDay) } if (message.unique === true) { - writer.uint32(24).bool(message.unique); + writer.uint32(24).bool(message.unique) } if (message.totalPerEntity !== undefined) { - TotalPerEntityAggregation.encode(message.totalPerEntity, writer.uint32(34).fork()).ldelim(); + TotalPerEntityAggregation.encode(message.totalPerEntity, writer.uint32(34).fork()).ldelim() } - writer.uint32(42).fork(); + writer.uint32(42).fork() for (const v of message.distinctAggregationByDays) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); + writer.ldelim() if (message.retentionConfig !== undefined) { - RetentionConfig.encode(message.retentionConfig, writer.uint32(50).fork()).ldelim(); + RetentionConfig.encode(message.retentionConfig, writer.uint32(50).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventTrackingConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventTrackingConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventTrackingConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.eventName = reader.string(); - break; + message.eventName = reader.string() + break case 2: - message.totalByDay = reader.bool(); - break; + message.totalByDay = reader.bool() + break case 3: - message.unique = reader.bool(); - break; + message.unique = reader.bool() + break case 4: - message.totalPerEntity = TotalPerEntityAggregation.decode(reader, reader.uint32()); - break; + message.totalPerEntity = TotalPerEntityAggregation.decode(reader, reader.uint32()) + break case 5: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.distinctAggregationByDays.push(reader.int32()); + message.distinctAggregationByDays.push(reader.int32()) } } else { - message.distinctAggregationByDays.push(reader.int32()); + message.distinctAggregationByDays.push(reader.int32()) } - break; + break case 6: - message.retentionConfig = RetentionConfig.decode(reader, reader.uint32()); - break; + message.retentionConfig = RetentionConfig.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventTrackingConfig { return { - eventName: isSet(object.eventName) ? String(object.eventName) : "", + eventName: isSet(object.eventName) ? String(object.eventName) : '', totalByDay: isSet(object.totalByDay) ? Boolean(object.totalByDay) : false, unique: isSet(object.unique) ? Boolean(object.unique) : false, totalPerEntity: isSet(object.totalPerEntity) @@ -1210,259 +1208,264 @@ export const EventTrackingConfig = { ? object.distinctAggregationByDays.map((e: any) => Number(e)) : [], retentionConfig: isSet(object.retentionConfig) ? RetentionConfig.fromJSON(object.retentionConfig) : undefined, - }; + } }, toJSON(message: EventTrackingConfig): unknown { - const obj: any = {}; - message.eventName !== undefined && (obj.eventName = message.eventName); - message.totalByDay !== undefined && (obj.totalByDay = message.totalByDay); - message.unique !== undefined && (obj.unique = message.unique); - message.totalPerEntity !== undefined && (obj.totalPerEntity = message.totalPerEntity - ? TotalPerEntityAggregation.toJSON(message.totalPerEntity) - : undefined); + const obj: any = {} + message.eventName !== undefined && (obj.eventName = message.eventName) + message.totalByDay !== undefined && (obj.totalByDay = message.totalByDay) + message.unique !== undefined && (obj.unique = message.unique) + message.totalPerEntity !== undefined && + (obj.totalPerEntity = message.totalPerEntity + ? TotalPerEntityAggregation.toJSON(message.totalPerEntity) + : undefined) if (message.distinctAggregationByDays) { - obj.distinctAggregationByDays = message.distinctAggregationByDays.map((e) => Math.round(e)); + obj.distinctAggregationByDays = message.distinctAggregationByDays.map((e) => Math.round(e)) } else { - obj.distinctAggregationByDays = []; + obj.distinctAggregationByDays = [] } message.retentionConfig !== undefined && - (obj.retentionConfig = message.retentionConfig ? RetentionConfig.toJSON(message.retentionConfig) : undefined); - return obj; + (obj.retentionConfig = message.retentionConfig ? RetentionConfig.toJSON(message.retentionConfig) : undefined) + return obj }, fromPartial(object: DeepPartial): EventTrackingConfig { - const message = createBaseEventTrackingConfig(); - message.eventName = object.eventName ?? ""; - message.totalByDay = object.totalByDay ?? false; - message.unique = object.unique ?? false; - message.totalPerEntity = (object.totalPerEntity !== undefined && object.totalPerEntity !== null) - ? TotalPerEntityAggregation.fromPartial(object.totalPerEntity) - : undefined; - message.distinctAggregationByDays = object.distinctAggregationByDays?.map((e) => e) || []; - message.retentionConfig = (object.retentionConfig !== undefined && object.retentionConfig !== null) - ? RetentionConfig.fromPartial(object.retentionConfig) - : undefined; - return message; - }, -}; + const message = createBaseEventTrackingConfig() + message.eventName = object.eventName ?? '' + message.totalByDay = object.totalByDay ?? false + message.unique = object.unique ?? false + message.totalPerEntity = + object.totalPerEntity !== undefined && object.totalPerEntity !== null + ? TotalPerEntityAggregation.fromPartial(object.totalPerEntity) + : undefined + message.distinctAggregationByDays = object.distinctAggregationByDays?.map((e) => e) || [] + message.retentionConfig = + object.retentionConfig !== undefined && object.retentionConfig !== null + ? RetentionConfig.fromPartial(object.retentionConfig) + : undefined + return message + }, +} function createBaseExportConfig(): ExportConfig { - return { name: "", channel: "" }; + return { name: '', channel: '' } } export const ExportConfig = { encode(message: ExportConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); + if (message.name !== '') { + writer.uint32(10).string(message.name) } - if (message.channel !== "") { - writer.uint32(18).string(message.channel); + if (message.channel !== '') { + writer.uint32(18).string(message.channel) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ExportConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExportConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.channel = reader.string(); - break; + message.channel = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ExportConfig { return { - name: isSet(object.name) ? String(object.name) : "", - channel: isSet(object.channel) ? String(object.channel) : "", - }; + name: isSet(object.name) ? String(object.name) : '', + channel: isSet(object.channel) ? String(object.channel) : '', + } }, toJSON(message: ExportConfig): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.channel !== undefined && (obj.channel = message.channel); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.channel !== undefined && (obj.channel = message.channel) + return obj }, fromPartial(object: DeepPartial): ExportConfig { - const message = createBaseExportConfig(); - message.name = object.name ?? ""; - message.channel = object.channel ?? ""; - return message; + const message = createBaseExportConfig() + message.name = object.name ?? '' + message.channel = object.channel ?? '' + return message }, -}; +} function createBaseMetricConfig(): MetricConfig { - return { name: "", description: "", unit: "", sparse: false, type: 0, aggregationConfig: undefined }; + return { name: '', description: '', unit: '', sparse: false, type: 0, aggregationConfig: undefined } } export const MetricConfig = { encode(message: MetricConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); + if (message.name !== '') { + writer.uint32(10).string(message.name) } - if (message.description !== "") { - writer.uint32(26).string(message.description); + if (message.description !== '') { + writer.uint32(26).string(message.description) } - if (message.unit !== "") { - writer.uint32(18).string(message.unit); + if (message.unit !== '') { + writer.uint32(18).string(message.unit) } if (message.sparse === true) { - writer.uint32(32).bool(message.sparse); + writer.uint32(32).bool(message.sparse) } if (message.type !== 0) { - writer.uint32(56).int32(message.type); + writer.uint32(56).int32(message.type) } if (message.aggregationConfig !== undefined) { - AggregationConfig.encode(message.aggregationConfig, writer.uint32(50).fork()).ldelim(); + AggregationConfig.encode(message.aggregationConfig, writer.uint32(50).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MetricConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetricConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMetricConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 3: - message.description = reader.string(); - break; + message.description = reader.string() + break case 2: - message.unit = reader.string(); - break; + message.unit = reader.string() + break case 4: - message.sparse = reader.bool(); - break; + message.sparse = reader.bool() + break case 7: - message.type = reader.int32() as any; - break; + message.type = reader.int32() as any + break case 6: - message.aggregationConfig = AggregationConfig.decode(reader, reader.uint32()); - break; + message.aggregationConfig = AggregationConfig.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MetricConfig { return { - name: isSet(object.name) ? String(object.name) : "", - description: isSet(object.description) ? String(object.description) : "", - unit: isSet(object.unit) ? String(object.unit) : "", + name: isSet(object.name) ? String(object.name) : '', + description: isSet(object.description) ? String(object.description) : '', + unit: isSet(object.unit) ? String(object.unit) : '', sparse: isSet(object.sparse) ? Boolean(object.sparse) : false, type: isSet(object.type) ? metricTypeFromJSON(object.type) : 0, aggregationConfig: isSet(object.aggregationConfig) ? AggregationConfig.fromJSON(object.aggregationConfig) : undefined, - }; + } }, toJSON(message: MetricConfig): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.description !== undefined && (obj.description = message.description); - message.unit !== undefined && (obj.unit = message.unit); - message.sparse !== undefined && (obj.sparse = message.sparse); - message.type !== undefined && (obj.type = metricTypeToJSON(message.type)); - message.aggregationConfig !== undefined && (obj.aggregationConfig = message.aggregationConfig - ? AggregationConfig.toJSON(message.aggregationConfig) - : undefined); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.description !== undefined && (obj.description = message.description) + message.unit !== undefined && (obj.unit = message.unit) + message.sparse !== undefined && (obj.sparse = message.sparse) + message.type !== undefined && (obj.type = metricTypeToJSON(message.type)) + message.aggregationConfig !== undefined && + (obj.aggregationConfig = message.aggregationConfig + ? AggregationConfig.toJSON(message.aggregationConfig) + : undefined) + return obj }, fromPartial(object: DeepPartial): MetricConfig { - const message = createBaseMetricConfig(); - message.name = object.name ?? ""; - message.description = object.description ?? ""; - message.unit = object.unit ?? ""; - message.sparse = object.sparse ?? false; - message.type = object.type ?? 0; - message.aggregationConfig = (object.aggregationConfig !== undefined && object.aggregationConfig !== null) - ? AggregationConfig.fromPartial(object.aggregationConfig) - : undefined; - return message; - }, -}; + const message = createBaseMetricConfig() + message.name = object.name ?? '' + message.description = object.description ?? '' + message.unit = object.unit ?? '' + message.sparse = object.sparse ?? false + message.type = object.type ?? 0 + message.aggregationConfig = + object.aggregationConfig !== undefined && object.aggregationConfig !== null + ? AggregationConfig.fromPartial(object.aggregationConfig) + : undefined + return message + }, +} function createBaseAggregationConfig(): AggregationConfig { - return { intervalInMinutes: [], types: [], discardOrigin: false }; + return { intervalInMinutes: [], types: [], discardOrigin: false } } export const AggregationConfig = { encode(message: AggregationConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).fork(); + writer.uint32(10).fork() for (const v of message.intervalInMinutes) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); - writer.uint32(18).fork(); + writer.ldelim() + writer.uint32(18).fork() for (const v of message.types) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); + writer.ldelim() if (message.discardOrigin === true) { - writer.uint32(24).bool(message.discardOrigin); + writer.uint32(24).bool(message.discardOrigin) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AggregationConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAggregationConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAggregationConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.intervalInMinutes.push(reader.int32()); + message.intervalInMinutes.push(reader.int32()) } } else { - message.intervalInMinutes.push(reader.int32()); + message.intervalInMinutes.push(reader.int32()) } - break; + break case 2: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.types.push(reader.int32() as any); + message.types.push(reader.int32() as any) } } else { - message.types.push(reader.int32() as any); + message.types.push(reader.int32() as any) } - break; + break case 3: - message.discardOrigin = reader.bool(); - break; + message.discardOrigin = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AggregationConfig { @@ -1472,105 +1475,105 @@ export const AggregationConfig = { : [], types: Array.isArray(object?.types) ? object.types.map((e: any) => aggregationTypeFromJSON(e)) : [], discardOrigin: isSet(object.discardOrigin) ? Boolean(object.discardOrigin) : false, - }; + } }, toJSON(message: AggregationConfig): unknown { - const obj: any = {}; + const obj: any = {} if (message.intervalInMinutes) { - obj.intervalInMinutes = message.intervalInMinutes.map((e) => Math.round(e)); + obj.intervalInMinutes = message.intervalInMinutes.map((e) => Math.round(e)) } else { - obj.intervalInMinutes = []; + obj.intervalInMinutes = [] } if (message.types) { - obj.types = message.types.map((e) => aggregationTypeToJSON(e)); + obj.types = message.types.map((e) => aggregationTypeToJSON(e)) } else { - obj.types = []; + obj.types = [] } - message.discardOrigin !== undefined && (obj.discardOrigin = message.discardOrigin); - return obj; + message.discardOrigin !== undefined && (obj.discardOrigin = message.discardOrigin) + return obj }, fromPartial(object: DeepPartial): AggregationConfig { - const message = createBaseAggregationConfig(); - message.intervalInMinutes = object.intervalInMinutes?.map((e) => e) || []; - message.types = object.types?.map((e) => e) || []; - message.discardOrigin = object.discardOrigin ?? false; - return message; + const message = createBaseAggregationConfig() + message.intervalInMinutes = object.intervalInMinutes?.map((e) => e) || [] + message.types = object.types?.map((e) => e) || [] + message.discardOrigin = object.discardOrigin ?? false + return message }, -}; +} function createBaseAccountConfig(): AccountConfig { return { - chainId: "", - address: "", + chainId: '', + address: '', startBlock: Long.UZERO, intervalConfigs: [], aptosIntervalConfigs: [], logConfigs: [], - }; + } } export const AccountConfig = { encode(message: AccountConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.chainId !== "") { - writer.uint32(10).string(message.chainId); + if (message.chainId !== '') { + writer.uint32(10).string(message.chainId) } - if (message.address !== "") { - writer.uint32(18).string(message.address); + if (message.address !== '') { + writer.uint32(18).string(message.address) } if (!message.startBlock.isZero()) { - writer.uint32(24).uint64(message.startBlock); + writer.uint32(24).uint64(message.startBlock) } for (const v of message.intervalConfigs) { - OnIntervalConfig.encode(v!, writer.uint32(34).fork()).ldelim(); + OnIntervalConfig.encode(v!, writer.uint32(34).fork()).ldelim() } for (const v of message.aptosIntervalConfigs) { - AptosOnIntervalConfig.encode(v!, writer.uint32(42).fork()).ldelim(); + AptosOnIntervalConfig.encode(v!, writer.uint32(42).fork()).ldelim() } for (const v of message.logConfigs) { - LogHandlerConfig.encode(v!, writer.uint32(50).fork()).ldelim(); + LogHandlerConfig.encode(v!, writer.uint32(50).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AccountConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAccountConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAccountConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.chainId = reader.string(); - break; + message.chainId = reader.string() + break case 2: - message.address = reader.string(); - break; + message.address = reader.string() + break case 3: - message.startBlock = reader.uint64() as Long; - break; + message.startBlock = reader.uint64() as Long + break case 4: - message.intervalConfigs.push(OnIntervalConfig.decode(reader, reader.uint32())); - break; + message.intervalConfigs.push(OnIntervalConfig.decode(reader, reader.uint32())) + break case 5: - message.aptosIntervalConfigs.push(AptosOnIntervalConfig.decode(reader, reader.uint32())); - break; + message.aptosIntervalConfigs.push(AptosOnIntervalConfig.decode(reader, reader.uint32())) + break case 6: - message.logConfigs.push(LogHandlerConfig.decode(reader, reader.uint32())); - break; + message.logConfigs.push(LogHandlerConfig.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AccountConfig { return { - chainId: isSet(object.chainId) ? String(object.chainId) : "", - address: isSet(object.address) ? String(object.address) : "", + chainId: isSet(object.chainId) ? String(object.chainId) : '', + address: isSet(object.address) ? String(object.address) : '', startBlock: isSet(object.startBlock) ? Long.fromValue(object.startBlock) : Long.UZERO, intervalConfigs: Array.isArray(object?.intervalConfigs) ? object.intervalConfigs.map((e: any) => OnIntervalConfig.fromJSON(e)) @@ -1581,158 +1584,157 @@ export const AccountConfig = { logConfigs: Array.isArray(object?.logConfigs) ? object.logConfigs.map((e: any) => LogHandlerConfig.fromJSON(e)) : [], - }; + } }, toJSON(message: AccountConfig): unknown { - const obj: any = {}; - message.chainId !== undefined && (obj.chainId = message.chainId); - message.address !== undefined && (obj.address = message.address); - message.startBlock !== undefined && (obj.startBlock = (message.startBlock || Long.UZERO).toString()); + const obj: any = {} + message.chainId !== undefined && (obj.chainId = message.chainId) + message.address !== undefined && (obj.address = message.address) + message.startBlock !== undefined && (obj.startBlock = (message.startBlock || Long.UZERO).toString()) if (message.intervalConfigs) { - obj.intervalConfigs = message.intervalConfigs.map((e) => e ? OnIntervalConfig.toJSON(e) : undefined); + obj.intervalConfigs = message.intervalConfigs.map((e) => (e ? OnIntervalConfig.toJSON(e) : undefined)) } else { - obj.intervalConfigs = []; + obj.intervalConfigs = [] } if (message.aptosIntervalConfigs) { obj.aptosIntervalConfigs = message.aptosIntervalConfigs.map((e) => e ? AptosOnIntervalConfig.toJSON(e) : undefined - ); + ) } else { - obj.aptosIntervalConfigs = []; + obj.aptosIntervalConfigs = [] } if (message.logConfigs) { - obj.logConfigs = message.logConfigs.map((e) => e ? LogHandlerConfig.toJSON(e) : undefined); + obj.logConfigs = message.logConfigs.map((e) => (e ? LogHandlerConfig.toJSON(e) : undefined)) } else { - obj.logConfigs = []; + obj.logConfigs = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): AccountConfig { - const message = createBaseAccountConfig(); - message.chainId = object.chainId ?? ""; - message.address = object.address ?? ""; - message.startBlock = (object.startBlock !== undefined && object.startBlock !== null) - ? Long.fromValue(object.startBlock) - : Long.UZERO; - message.intervalConfigs = object.intervalConfigs?.map((e) => OnIntervalConfig.fromPartial(e)) || []; - message.aptosIntervalConfigs = object.aptosIntervalConfigs?.map((e) => AptosOnIntervalConfig.fromPartial(e)) || []; - message.logConfigs = object.logConfigs?.map((e) => LogHandlerConfig.fromPartial(e)) || []; - return message; - }, -}; + const message = createBaseAccountConfig() + message.chainId = object.chainId ?? '' + message.address = object.address ?? '' + message.startBlock = + object.startBlock !== undefined && object.startBlock !== null ? Long.fromValue(object.startBlock) : Long.UZERO + message.intervalConfigs = object.intervalConfigs?.map((e) => OnIntervalConfig.fromPartial(e)) || [] + message.aptosIntervalConfigs = object.aptosIntervalConfigs?.map((e) => AptosOnIntervalConfig.fromPartial(e)) || [] + message.logConfigs = object.logConfigs?.map((e) => LogHandlerConfig.fromPartial(e)) || [] + return message + }, +} function createBaseHandleInterval(): HandleInterval { - return { recentInterval: 0, backfillInterval: 0 }; + return { recentInterval: 0, backfillInterval: 0 } } export const HandleInterval = { encode(message: HandleInterval, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.recentInterval !== 0) { - writer.uint32(8).int32(message.recentInterval); + writer.uint32(8).int32(message.recentInterval) } if (message.backfillInterval !== 0) { - writer.uint32(16).int32(message.backfillInterval); + writer.uint32(16).int32(message.backfillInterval) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): HandleInterval { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHandleInterval(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseHandleInterval() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.recentInterval = reader.int32(); - break; + message.recentInterval = reader.int32() + break case 2: - message.backfillInterval = reader.int32(); - break; + message.backfillInterval = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): HandleInterval { return { recentInterval: isSet(object.recentInterval) ? Number(object.recentInterval) : 0, backfillInterval: isSet(object.backfillInterval) ? Number(object.backfillInterval) : 0, - }; + } }, toJSON(message: HandleInterval): unknown { - const obj: any = {}; - message.recentInterval !== undefined && (obj.recentInterval = Math.round(message.recentInterval)); - message.backfillInterval !== undefined && (obj.backfillInterval = Math.round(message.backfillInterval)); - return obj; + const obj: any = {} + message.recentInterval !== undefined && (obj.recentInterval = Math.round(message.recentInterval)) + message.backfillInterval !== undefined && (obj.backfillInterval = Math.round(message.backfillInterval)) + return obj }, fromPartial(object: DeepPartial): HandleInterval { - const message = createBaseHandleInterval(); - message.recentInterval = object.recentInterval ?? 0; - message.backfillInterval = object.backfillInterval ?? 0; - return message; + const message = createBaseHandleInterval() + message.recentInterval = object.recentInterval ?? 0 + message.backfillInterval = object.backfillInterval ?? 0 + return message }, -}; +} function createBaseOnIntervalConfig(): OnIntervalConfig { - return { handlerId: 0, minutes: 0, minutesInterval: undefined, slot: 0, slotInterval: undefined }; + return { handlerId: 0, minutes: 0, minutesInterval: undefined, slot: 0, slotInterval: undefined } } export const OnIntervalConfig = { encode(message: OnIntervalConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.handlerId !== 0) { - writer.uint32(8).int32(message.handlerId); + writer.uint32(8).int32(message.handlerId) } if (message.minutes !== 0) { - writer.uint32(16).int32(message.minutes); + writer.uint32(16).int32(message.minutes) } if (message.minutesInterval !== undefined) { - HandleInterval.encode(message.minutesInterval, writer.uint32(34).fork()).ldelim(); + HandleInterval.encode(message.minutesInterval, writer.uint32(34).fork()).ldelim() } if (message.slot !== 0) { - writer.uint32(24).int32(message.slot); + writer.uint32(24).int32(message.slot) } if (message.slotInterval !== undefined) { - HandleInterval.encode(message.slotInterval, writer.uint32(42).fork()).ldelim(); + HandleInterval.encode(message.slotInterval, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): OnIntervalConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOnIntervalConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseOnIntervalConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.handlerId = reader.int32(); - break; + message.handlerId = reader.int32() + break case 2: - message.minutes = reader.int32(); - break; + message.minutes = reader.int32() + break case 4: - message.minutesInterval = HandleInterval.decode(reader, reader.uint32()); - break; + message.minutesInterval = HandleInterval.decode(reader, reader.uint32()) + break case 3: - message.slot = reader.int32(); - break; + message.slot = reader.int32() + break case 5: - message.slotInterval = HandleInterval.decode(reader, reader.uint32()); - break; + message.slotInterval = HandleInterval.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): OnIntervalConfig { @@ -1742,219 +1744,222 @@ export const OnIntervalConfig = { minutesInterval: isSet(object.minutesInterval) ? HandleInterval.fromJSON(object.minutesInterval) : undefined, slot: isSet(object.slot) ? Number(object.slot) : 0, slotInterval: isSet(object.slotInterval) ? HandleInterval.fromJSON(object.slotInterval) : undefined, - }; + } }, toJSON(message: OnIntervalConfig): unknown { - const obj: any = {}; - message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)); - message.minutes !== undefined && (obj.minutes = Math.round(message.minutes)); + const obj: any = {} + message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)) + message.minutes !== undefined && (obj.minutes = Math.round(message.minutes)) message.minutesInterval !== undefined && - (obj.minutesInterval = message.minutesInterval ? HandleInterval.toJSON(message.minutesInterval) : undefined); - message.slot !== undefined && (obj.slot = Math.round(message.slot)); + (obj.minutesInterval = message.minutesInterval ? HandleInterval.toJSON(message.minutesInterval) : undefined) + message.slot !== undefined && (obj.slot = Math.round(message.slot)) message.slotInterval !== undefined && - (obj.slotInterval = message.slotInterval ? HandleInterval.toJSON(message.slotInterval) : undefined); - return obj; + (obj.slotInterval = message.slotInterval ? HandleInterval.toJSON(message.slotInterval) : undefined) + return obj }, fromPartial(object: DeepPartial): OnIntervalConfig { - const message = createBaseOnIntervalConfig(); - message.handlerId = object.handlerId ?? 0; - message.minutes = object.minutes ?? 0; - message.minutesInterval = (object.minutesInterval !== undefined && object.minutesInterval !== null) - ? HandleInterval.fromPartial(object.minutesInterval) - : undefined; - message.slot = object.slot ?? 0; - message.slotInterval = (object.slotInterval !== undefined && object.slotInterval !== null) - ? HandleInterval.fromPartial(object.slotInterval) - : undefined; - return message; - }, -}; + const message = createBaseOnIntervalConfig() + message.handlerId = object.handlerId ?? 0 + message.minutes = object.minutes ?? 0 + message.minutesInterval = + object.minutesInterval !== undefined && object.minutesInterval !== null + ? HandleInterval.fromPartial(object.minutesInterval) + : undefined + message.slot = object.slot ?? 0 + message.slotInterval = + object.slotInterval !== undefined && object.slotInterval !== null + ? HandleInterval.fromPartial(object.slotInterval) + : undefined + return message + }, +} function createBaseAptosOnIntervalConfig(): AptosOnIntervalConfig { - return { intervalConfig: undefined, type: "" }; + return { intervalConfig: undefined, type: '' } } export const AptosOnIntervalConfig = { encode(message: AptosOnIntervalConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.intervalConfig !== undefined) { - OnIntervalConfig.encode(message.intervalConfig, writer.uint32(10).fork()).ldelim(); + OnIntervalConfig.encode(message.intervalConfig, writer.uint32(10).fork()).ldelim() } - if (message.type !== "") { - writer.uint32(18).string(message.type); + if (message.type !== '') { + writer.uint32(18).string(message.type) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosOnIntervalConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosOnIntervalConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosOnIntervalConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.intervalConfig = OnIntervalConfig.decode(reader, reader.uint32()); - break; + message.intervalConfig = OnIntervalConfig.decode(reader, reader.uint32()) + break case 2: - message.type = reader.string(); - break; + message.type = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosOnIntervalConfig { return { intervalConfig: isSet(object.intervalConfig) ? OnIntervalConfig.fromJSON(object.intervalConfig) : undefined, - type: isSet(object.type) ? String(object.type) : "", - }; + type: isSet(object.type) ? String(object.type) : '', + } }, toJSON(message: AptosOnIntervalConfig): unknown { - const obj: any = {}; + const obj: any = {} message.intervalConfig !== undefined && - (obj.intervalConfig = message.intervalConfig ? OnIntervalConfig.toJSON(message.intervalConfig) : undefined); - message.type !== undefined && (obj.type = message.type); - return obj; + (obj.intervalConfig = message.intervalConfig ? OnIntervalConfig.toJSON(message.intervalConfig) : undefined) + message.type !== undefined && (obj.type = message.type) + return obj }, fromPartial(object: DeepPartial): AptosOnIntervalConfig { - const message = createBaseAptosOnIntervalConfig(); - message.intervalConfig = (object.intervalConfig !== undefined && object.intervalConfig !== null) - ? OnIntervalConfig.fromPartial(object.intervalConfig) - : undefined; - message.type = object.type ?? ""; - return message; + const message = createBaseAptosOnIntervalConfig() + message.intervalConfig = + object.intervalConfig !== undefined && object.intervalConfig !== null + ? OnIntervalConfig.fromPartial(object.intervalConfig) + : undefined + message.type = object.type ?? '' + return message }, -}; +} function createBaseContractInfo(): ContractInfo { - return { name: "", chainId: "", address: "", abi: "" }; + return { name: '', chainId: '', address: '', abi: '' } } export const ContractInfo = { encode(message: ContractInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); + if (message.name !== '') { + writer.uint32(10).string(message.name) } - if (message.chainId !== "") { - writer.uint32(18).string(message.chainId); + if (message.chainId !== '') { + writer.uint32(18).string(message.chainId) } - if (message.address !== "") { - writer.uint32(26).string(message.address); + if (message.address !== '') { + writer.uint32(26).string(message.address) } - if (message.abi !== "") { - writer.uint32(34).string(message.abi); + if (message.abi !== '') { + writer.uint32(34).string(message.abi) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseContractInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseContractInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; + message.name = reader.string() + break case 2: - message.chainId = reader.string(); - break; + message.chainId = reader.string() + break case 3: - message.address = reader.string(); - break; + message.address = reader.string() + break case 4: - message.abi = reader.string(); - break; + message.abi = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ContractInfo { return { - name: isSet(object.name) ? String(object.name) : "", - chainId: isSet(object.chainId) ? String(object.chainId) : "", - address: isSet(object.address) ? String(object.address) : "", - abi: isSet(object.abi) ? String(object.abi) : "", - }; + name: isSet(object.name) ? String(object.name) : '', + chainId: isSet(object.chainId) ? String(object.chainId) : '', + address: isSet(object.address) ? String(object.address) : '', + abi: isSet(object.abi) ? String(object.abi) : '', + } }, toJSON(message: ContractInfo): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.chainId !== undefined && (obj.chainId = message.chainId); - message.address !== undefined && (obj.address = message.address); - message.abi !== undefined && (obj.abi = message.abi); - return obj; + const obj: any = {} + message.name !== undefined && (obj.name = message.name) + message.chainId !== undefined && (obj.chainId = message.chainId) + message.address !== undefined && (obj.address = message.address) + message.abi !== undefined && (obj.abi = message.abi) + return obj }, fromPartial(object: DeepPartial): ContractInfo { - const message = createBaseContractInfo(); - message.name = object.name ?? ""; - message.chainId = object.chainId ?? ""; - message.address = object.address ?? ""; - message.abi = object.abi ?? ""; - return message; + const message = createBaseContractInfo() + message.name = object.name ?? '' + message.chainId = object.chainId ?? '' + message.address = object.address ?? '' + message.abi = object.abi ?? '' + return message }, -}; +} function createBaseTemplateInstance(): TemplateInstance { - return { contract: undefined, startBlock: Long.UZERO, endBlock: Long.UZERO, templateId: 0 }; + return { contract: undefined, startBlock: Long.UZERO, endBlock: Long.UZERO, templateId: 0 } } export const TemplateInstance = { encode(message: TemplateInstance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.contract !== undefined) { - ContractInfo.encode(message.contract, writer.uint32(10).fork()).ldelim(); + ContractInfo.encode(message.contract, writer.uint32(10).fork()).ldelim() } if (!message.startBlock.isZero()) { - writer.uint32(16).uint64(message.startBlock); + writer.uint32(16).uint64(message.startBlock) } if (!message.endBlock.isZero()) { - writer.uint32(24).uint64(message.endBlock); + writer.uint32(24).uint64(message.endBlock) } if (message.templateId !== 0) { - writer.uint32(32).int32(message.templateId); + writer.uint32(32).int32(message.templateId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TemplateInstance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTemplateInstance(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTemplateInstance() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.contract = ContractInfo.decode(reader, reader.uint32()); - break; + message.contract = ContractInfo.decode(reader, reader.uint32()) + break case 2: - message.startBlock = reader.uint64() as Long; - break; + message.startBlock = reader.uint64() as Long + break case 3: - message.endBlock = reader.uint64() as Long; - break; + message.endBlock = reader.uint64() as Long + break case 4: - message.templateId = reader.int32(); - break; + message.templateId = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TemplateInstance { @@ -1963,63 +1968,60 @@ export const TemplateInstance = { startBlock: isSet(object.startBlock) ? Long.fromValue(object.startBlock) : Long.UZERO, endBlock: isSet(object.endBlock) ? Long.fromValue(object.endBlock) : Long.UZERO, templateId: isSet(object.templateId) ? Number(object.templateId) : 0, - }; + } }, toJSON(message: TemplateInstance): unknown { - const obj: any = {}; + const obj: any = {} message.contract !== undefined && - (obj.contract = message.contract ? ContractInfo.toJSON(message.contract) : undefined); - message.startBlock !== undefined && (obj.startBlock = (message.startBlock || Long.UZERO).toString()); - message.endBlock !== undefined && (obj.endBlock = (message.endBlock || Long.UZERO).toString()); - message.templateId !== undefined && (obj.templateId = Math.round(message.templateId)); - return obj; + (obj.contract = message.contract ? ContractInfo.toJSON(message.contract) : undefined) + message.startBlock !== undefined && (obj.startBlock = (message.startBlock || Long.UZERO).toString()) + message.endBlock !== undefined && (obj.endBlock = (message.endBlock || Long.UZERO).toString()) + message.templateId !== undefined && (obj.templateId = Math.round(message.templateId)) + return obj }, fromPartial(object: DeepPartial): TemplateInstance { - const message = createBaseTemplateInstance(); - message.contract = (object.contract !== undefined && object.contract !== null) - ? ContractInfo.fromPartial(object.contract) - : undefined; - message.startBlock = (object.startBlock !== undefined && object.startBlock !== null) - ? Long.fromValue(object.startBlock) - : Long.UZERO; - message.endBlock = (object.endBlock !== undefined && object.endBlock !== null) - ? Long.fromValue(object.endBlock) - : Long.UZERO; - message.templateId = object.templateId ?? 0; - return message; - }, -}; + const message = createBaseTemplateInstance() + message.contract = + object.contract !== undefined && object.contract !== null ? ContractInfo.fromPartial(object.contract) : undefined + message.startBlock = + object.startBlock !== undefined && object.startBlock !== null ? Long.fromValue(object.startBlock) : Long.UZERO + message.endBlock = + object.endBlock !== undefined && object.endBlock !== null ? Long.fromValue(object.endBlock) : Long.UZERO + message.templateId = object.templateId ?? 0 + return message + }, +} function createBaseStartRequest(): StartRequest { - return { templateInstances: [] }; + return { templateInstances: [] } } export const StartRequest = { encode(message: StartRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.templateInstances) { - TemplateInstance.encode(v!, writer.uint32(10).fork()).ldelim(); + TemplateInstance.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): StartRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseStartRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseStartRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.templateInstances.push(TemplateInstance.decode(reader, reader.uint32())); - break; + message.templateInstances.push(TemplateInstance.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): StartRequest { @@ -2027,233 +2029,233 @@ export const StartRequest = { templateInstances: Array.isArray(object?.templateInstances) ? object.templateInstances.map((e: any) => TemplateInstance.fromJSON(e)) : [], - }; + } }, toJSON(message: StartRequest): unknown { - const obj: any = {}; + const obj: any = {} if (message.templateInstances) { - obj.templateInstances = message.templateInstances.map((e) => e ? TemplateInstance.toJSON(e) : undefined); + obj.templateInstances = message.templateInstances.map((e) => (e ? TemplateInstance.toJSON(e) : undefined)) } else { - obj.templateInstances = []; + obj.templateInstances = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): StartRequest { - const message = createBaseStartRequest(); - message.templateInstances = object.templateInstances?.map((e) => TemplateInstance.fromPartial(e)) || []; - return message; + const message = createBaseStartRequest() + message.templateInstances = object.templateInstances?.map((e) => TemplateInstance.fromPartial(e)) || [] + return message }, -}; +} function createBaseBlockHandlerConfig(): BlockHandlerConfig { - return { handlerId: 0 }; + return { handlerId: 0 } } export const BlockHandlerConfig = { encode(message: BlockHandlerConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.handlerId !== 0) { - writer.uint32(8).int32(message.handlerId); + writer.uint32(8).int32(message.handlerId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BlockHandlerConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockHandlerConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBlockHandlerConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.handlerId = reader.int32(); - break; + message.handlerId = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BlockHandlerConfig { - return { handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0 }; + return { handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0 } }, toJSON(message: BlockHandlerConfig): unknown { - const obj: any = {}; - message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)); - return obj; + const obj: any = {} + message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)) + return obj }, fromPartial(object: DeepPartial): BlockHandlerConfig { - const message = createBaseBlockHandlerConfig(); - message.handlerId = object.handlerId ?? 0; - return message; + const message = createBaseBlockHandlerConfig() + message.handlerId = object.handlerId ?? 0 + return message }, -}; +} function createBaseTraceHandlerConfig(): TraceHandlerConfig { - return { signature: "", handlerId: 0 }; + return { signature: '', handlerId: 0 } } export const TraceHandlerConfig = { encode(message: TraceHandlerConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.signature !== "") { - writer.uint32(10).string(message.signature); + if (message.signature !== '') { + writer.uint32(10).string(message.signature) } if (message.handlerId !== 0) { - writer.uint32(16).int32(message.handlerId); + writer.uint32(16).int32(message.handlerId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): TraceHandlerConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTraceHandlerConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTraceHandlerConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.signature = reader.string(); - break; + message.signature = reader.string() + break case 2: - message.handlerId = reader.int32(); - break; + message.handlerId = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): TraceHandlerConfig { return { - signature: isSet(object.signature) ? String(object.signature) : "", + signature: isSet(object.signature) ? String(object.signature) : '', handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0, - }; + } }, toJSON(message: TraceHandlerConfig): unknown { - const obj: any = {}; - message.signature !== undefined && (obj.signature = message.signature); - message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)); - return obj; + const obj: any = {} + message.signature !== undefined && (obj.signature = message.signature) + message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)) + return obj }, fromPartial(object: DeepPartial): TraceHandlerConfig { - const message = createBaseTraceHandlerConfig(); - message.signature = object.signature ?? ""; - message.handlerId = object.handlerId ?? 0; - return message; + const message = createBaseTraceHandlerConfig() + message.signature = object.signature ?? '' + message.handlerId = object.handlerId ?? 0 + return message }, -}; +} function createBaseLogHandlerConfig(): LogHandlerConfig { - return { filters: [], handlerId: 0 }; + return { filters: [], handlerId: 0 } } export const LogHandlerConfig = { encode(message: LogHandlerConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.filters) { - LogFilter.encode(v!, writer.uint32(10).fork()).ldelim(); + LogFilter.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.handlerId !== 0) { - writer.uint32(16).int32(message.handlerId); + writer.uint32(16).int32(message.handlerId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LogHandlerConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLogHandlerConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLogHandlerConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.filters.push(LogFilter.decode(reader, reader.uint32())); - break; + message.filters.push(LogFilter.decode(reader, reader.uint32())) + break case 2: - message.handlerId = reader.int32(); - break; + message.handlerId = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LogHandlerConfig { return { filters: Array.isArray(object?.filters) ? object.filters.map((e: any) => LogFilter.fromJSON(e)) : [], handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0, - }; + } }, toJSON(message: LogHandlerConfig): unknown { - const obj: any = {}; + const obj: any = {} if (message.filters) { - obj.filters = message.filters.map((e) => e ? LogFilter.toJSON(e) : undefined); + obj.filters = message.filters.map((e) => (e ? LogFilter.toJSON(e) : undefined)) } else { - obj.filters = []; + obj.filters = [] } - message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)); - return obj; + message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)) + return obj }, fromPartial(object: DeepPartial): LogHandlerConfig { - const message = createBaseLogHandlerConfig(); - message.filters = object.filters?.map((e) => LogFilter.fromPartial(e)) || []; - message.handlerId = object.handlerId ?? 0; - return message; + const message = createBaseLogHandlerConfig() + message.filters = object.filters?.map((e) => LogFilter.fromPartial(e)) || [] + message.handlerId = object.handlerId ?? 0 + return message }, -}; +} function createBaseLogFilter(): LogFilter { - return { topics: [], address: undefined, addressType: undefined }; + return { topics: [], address: undefined, addressType: undefined } } export const LogFilter = { encode(message: LogFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.topics) { - Topic.encode(v!, writer.uint32(10).fork()).ldelim(); + Topic.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.address !== undefined) { - writer.uint32(18).string(message.address); + writer.uint32(18).string(message.address) } if (message.addressType !== undefined) { - writer.uint32(24).int32(message.addressType); + writer.uint32(24).int32(message.addressType) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LogFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLogFilter(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLogFilter() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.topics.push(Topic.decode(reader, reader.uint32())); - break; + message.topics.push(Topic.decode(reader, reader.uint32())) + break case 2: - message.address = reader.string(); - break; + message.address = reader.string() + break case 3: - message.addressType = reader.int32() as any; - break; + message.addressType = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LogFilter { @@ -2261,71 +2263,71 @@ export const LogFilter = { topics: Array.isArray(object?.topics) ? object.topics.map((e: any) => Topic.fromJSON(e)) : [], address: isSet(object.address) ? String(object.address) : undefined, addressType: isSet(object.addressType) ? addressTypeFromJSON(object.addressType) : undefined, - }; + } }, toJSON(message: LogFilter): unknown { - const obj: any = {}; + const obj: any = {} if (message.topics) { - obj.topics = message.topics.map((e) => e ? Topic.toJSON(e) : undefined); + obj.topics = message.topics.map((e) => (e ? Topic.toJSON(e) : undefined)) } else { - obj.topics = []; + obj.topics = [] } - message.address !== undefined && (obj.address = message.address); + message.address !== undefined && (obj.address = message.address) message.addressType !== undefined && - (obj.addressType = message.addressType !== undefined ? addressTypeToJSON(message.addressType) : undefined); - return obj; + (obj.addressType = message.addressType !== undefined ? addressTypeToJSON(message.addressType) : undefined) + return obj }, fromPartial(object: DeepPartial): LogFilter { - const message = createBaseLogFilter(); - message.topics = object.topics?.map((e) => Topic.fromPartial(e)) || []; - message.address = object.address ?? undefined; - message.addressType = object.addressType ?? undefined; - return message; + const message = createBaseLogFilter() + message.topics = object.topics?.map((e) => Topic.fromPartial(e)) || [] + message.address = object.address ?? undefined + message.addressType = object.addressType ?? undefined + return message }, -}; +} function createBaseInstructionHandlerConfig(): InstructionHandlerConfig { - return { innerInstruction: false, parsedInstruction: false, rawDataInstruction: false }; + return { innerInstruction: false, parsedInstruction: false, rawDataInstruction: false } } export const InstructionHandlerConfig = { encode(message: InstructionHandlerConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.innerInstruction === true) { - writer.uint32(8).bool(message.innerInstruction); + writer.uint32(8).bool(message.innerInstruction) } if (message.parsedInstruction === true) { - writer.uint32(16).bool(message.parsedInstruction); + writer.uint32(16).bool(message.parsedInstruction) } if (message.rawDataInstruction === true) { - writer.uint32(24).bool(message.rawDataInstruction); + writer.uint32(24).bool(message.rawDataInstruction) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): InstructionHandlerConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInstructionHandlerConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseInstructionHandlerConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.innerInstruction = reader.bool(); - break; + message.innerInstruction = reader.bool() + break case 2: - message.parsedInstruction = reader.bool(); - break; + message.parsedInstruction = reader.bool() + break case 3: - message.rawDataInstruction = reader.bool(); - break; + message.rawDataInstruction = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): InstructionHandlerConfig { @@ -2333,492 +2335,491 @@ export const InstructionHandlerConfig = { innerInstruction: isSet(object.innerInstruction) ? Boolean(object.innerInstruction) : false, parsedInstruction: isSet(object.parsedInstruction) ? Boolean(object.parsedInstruction) : false, rawDataInstruction: isSet(object.rawDataInstruction) ? Boolean(object.rawDataInstruction) : false, - }; + } }, toJSON(message: InstructionHandlerConfig): unknown { - const obj: any = {}; - message.innerInstruction !== undefined && (obj.innerInstruction = message.innerInstruction); - message.parsedInstruction !== undefined && (obj.parsedInstruction = message.parsedInstruction); - message.rawDataInstruction !== undefined && (obj.rawDataInstruction = message.rawDataInstruction); - return obj; + const obj: any = {} + message.innerInstruction !== undefined && (obj.innerInstruction = message.innerInstruction) + message.parsedInstruction !== undefined && (obj.parsedInstruction = message.parsedInstruction) + message.rawDataInstruction !== undefined && (obj.rawDataInstruction = message.rawDataInstruction) + return obj }, fromPartial(object: DeepPartial): InstructionHandlerConfig { - const message = createBaseInstructionHandlerConfig(); - message.innerInstruction = object.innerInstruction ?? false; - message.parsedInstruction = object.parsedInstruction ?? false; - message.rawDataInstruction = object.rawDataInstruction ?? false; - return message; + const message = createBaseInstructionHandlerConfig() + message.innerInstruction = object.innerInstruction ?? false + message.parsedInstruction = object.parsedInstruction ?? false + message.rawDataInstruction = object.rawDataInstruction ?? false + return message }, -}; +} function createBaseAptosEventHandlerConfig(): AptosEventHandlerConfig { - return { filters: [], handlerId: 0 }; + return { filters: [], handlerId: 0 } } export const AptosEventHandlerConfig = { encode(message: AptosEventHandlerConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.filters) { - AptosEventFilter.encode(v!, writer.uint32(10).fork()).ldelim(); + AptosEventFilter.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.handlerId !== 0) { - writer.uint32(16).int32(message.handlerId); + writer.uint32(16).int32(message.handlerId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosEventHandlerConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosEventHandlerConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosEventHandlerConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.filters.push(AptosEventFilter.decode(reader, reader.uint32())); - break; + message.filters.push(AptosEventFilter.decode(reader, reader.uint32())) + break case 2: - message.handlerId = reader.int32(); - break; + message.handlerId = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosEventHandlerConfig { return { filters: Array.isArray(object?.filters) ? object.filters.map((e: any) => AptosEventFilter.fromJSON(e)) : [], handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0, - }; + } }, toJSON(message: AptosEventHandlerConfig): unknown { - const obj: any = {}; + const obj: any = {} if (message.filters) { - obj.filters = message.filters.map((e) => e ? AptosEventFilter.toJSON(e) : undefined); + obj.filters = message.filters.map((e) => (e ? AptosEventFilter.toJSON(e) : undefined)) } else { - obj.filters = []; + obj.filters = [] } - message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)); - return obj; + message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)) + return obj }, fromPartial(object: DeepPartial): AptosEventHandlerConfig { - const message = createBaseAptosEventHandlerConfig(); - message.filters = object.filters?.map((e) => AptosEventFilter.fromPartial(e)) || []; - message.handlerId = object.handlerId ?? 0; - return message; + const message = createBaseAptosEventHandlerConfig() + message.filters = object.filters?.map((e) => AptosEventFilter.fromPartial(e)) || [] + message.handlerId = object.handlerId ?? 0 + return message }, -}; +} function createBaseAptosEventFilter(): AptosEventFilter { - return { type: "", account: "" }; + return { type: '', account: '' } } export const AptosEventFilter = { encode(message: AptosEventFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.type !== "") { - writer.uint32(10).string(message.type); + if (message.type !== '') { + writer.uint32(10).string(message.type) } - if (message.account !== "") { - writer.uint32(18).string(message.account); + if (message.account !== '') { + writer.uint32(18).string(message.account) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosEventFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosEventFilter(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosEventFilter() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.type = reader.string(); - break; + message.type = reader.string() + break case 2: - message.account = reader.string(); - break; + message.account = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosEventFilter { return { - type: isSet(object.type) ? String(object.type) : "", - account: isSet(object.account) ? String(object.account) : "", - }; + type: isSet(object.type) ? String(object.type) : '', + account: isSet(object.account) ? String(object.account) : '', + } }, toJSON(message: AptosEventFilter): unknown { - const obj: any = {}; - message.type !== undefined && (obj.type = message.type); - message.account !== undefined && (obj.account = message.account); - return obj; + const obj: any = {} + message.type !== undefined && (obj.type = message.type) + message.account !== undefined && (obj.account = message.account) + return obj }, fromPartial(object: DeepPartial): AptosEventFilter { - const message = createBaseAptosEventFilter(); - message.type = object.type ?? ""; - message.account = object.account ?? ""; - return message; + const message = createBaseAptosEventFilter() + message.type = object.type ?? '' + message.account = object.account ?? '' + return message }, -}; +} function createBaseAptosCallHandlerConfig(): AptosCallHandlerConfig { - return { filters: [], handlerId: 0 }; + return { filters: [], handlerId: 0 } } export const AptosCallHandlerConfig = { encode(message: AptosCallHandlerConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.filters) { - AptosCallFilter.encode(v!, writer.uint32(10).fork()).ldelim(); + AptosCallFilter.encode(v!, writer.uint32(10).fork()).ldelim() } if (message.handlerId !== 0) { - writer.uint32(16).int32(message.handlerId); + writer.uint32(16).int32(message.handlerId) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosCallHandlerConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosCallHandlerConfig(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosCallHandlerConfig() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.filters.push(AptosCallFilter.decode(reader, reader.uint32())); - break; + message.filters.push(AptosCallFilter.decode(reader, reader.uint32())) + break case 2: - message.handlerId = reader.int32(); - break; + message.handlerId = reader.int32() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosCallHandlerConfig { return { filters: Array.isArray(object?.filters) ? object.filters.map((e: any) => AptosCallFilter.fromJSON(e)) : [], handlerId: isSet(object.handlerId) ? Number(object.handlerId) : 0, - }; + } }, toJSON(message: AptosCallHandlerConfig): unknown { - const obj: any = {}; + const obj: any = {} if (message.filters) { - obj.filters = message.filters.map((e) => e ? AptosCallFilter.toJSON(e) : undefined); + obj.filters = message.filters.map((e) => (e ? AptosCallFilter.toJSON(e) : undefined)) } else { - obj.filters = []; + obj.filters = [] } - message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)); - return obj; + message.handlerId !== undefined && (obj.handlerId = Math.round(message.handlerId)) + return obj }, fromPartial(object: DeepPartial): AptosCallHandlerConfig { - const message = createBaseAptosCallHandlerConfig(); - message.filters = object.filters?.map((e) => AptosCallFilter.fromPartial(e)) || []; - message.handlerId = object.handlerId ?? 0; - return message; + const message = createBaseAptosCallHandlerConfig() + message.filters = object.filters?.map((e) => AptosCallFilter.fromPartial(e)) || [] + message.handlerId = object.handlerId ?? 0 + return message }, -}; +} function createBaseAptosCallFilter(): AptosCallFilter { - return { function: "", typeArguments: [], withTypeArguments: false, includeFailed: false }; + return { function: '', typeArguments: [], withTypeArguments: false, includeFailed: false } } export const AptosCallFilter = { encode(message: AptosCallFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.function !== "") { - writer.uint32(10).string(message.function); + if (message.function !== '') { + writer.uint32(10).string(message.function) } for (const v of message.typeArguments) { - writer.uint32(18).string(v!); + writer.uint32(18).string(v!) } if (message.withTypeArguments === true) { - writer.uint32(24).bool(message.withTypeArguments); + writer.uint32(24).bool(message.withTypeArguments) } if (message.includeFailed === true) { - writer.uint32(32).bool(message.includeFailed); + writer.uint32(32).bool(message.includeFailed) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): AptosCallFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAptosCallFilter(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseAptosCallFilter() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.function = reader.string(); - break; + message.function = reader.string() + break case 2: - message.typeArguments.push(reader.string()); - break; + message.typeArguments.push(reader.string()) + break case 3: - message.withTypeArguments = reader.bool(); - break; + message.withTypeArguments = reader.bool() + break case 4: - message.includeFailed = reader.bool(); - break; + message.includeFailed = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): AptosCallFilter { return { - function: isSet(object.function) ? String(object.function) : "", + function: isSet(object.function) ? String(object.function) : '', typeArguments: Array.isArray(object?.typeArguments) ? object.typeArguments.map((e: any) => String(e)) : [], withTypeArguments: isSet(object.withTypeArguments) ? Boolean(object.withTypeArguments) : false, includeFailed: isSet(object.includeFailed) ? Boolean(object.includeFailed) : false, - }; + } }, toJSON(message: AptosCallFilter): unknown { - const obj: any = {}; - message.function !== undefined && (obj.function = message.function); + const obj: any = {} + message.function !== undefined && (obj.function = message.function) if (message.typeArguments) { - obj.typeArguments = message.typeArguments.map((e) => e); + obj.typeArguments = message.typeArguments.map((e) => e) } else { - obj.typeArguments = []; + obj.typeArguments = [] } - message.withTypeArguments !== undefined && (obj.withTypeArguments = message.withTypeArguments); - message.includeFailed !== undefined && (obj.includeFailed = message.includeFailed); - return obj; + message.withTypeArguments !== undefined && (obj.withTypeArguments = message.withTypeArguments) + message.includeFailed !== undefined && (obj.includeFailed = message.includeFailed) + return obj }, fromPartial(object: DeepPartial): AptosCallFilter { - const message = createBaseAptosCallFilter(); - message.function = object.function ?? ""; - message.typeArguments = object.typeArguments?.map((e) => e) || []; - message.withTypeArguments = object.withTypeArguments ?? false; - message.includeFailed = object.includeFailed ?? false; - return message; + const message = createBaseAptosCallFilter() + message.function = object.function ?? '' + message.typeArguments = object.typeArguments?.map((e) => e) || [] + message.withTypeArguments = object.withTypeArguments ?? false + message.includeFailed = object.includeFailed ?? false + return message }, -}; +} function createBaseTopic(): Topic { - return { hashes: [] }; + return { hashes: [] } } export const Topic = { encode(message: Topic, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.hashes) { - writer.uint32(10).string(v!); + writer.uint32(10).string(v!) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Topic { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTopic(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseTopic() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.hashes.push(reader.string()); - break; + message.hashes.push(reader.string()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Topic { - return { hashes: Array.isArray(object?.hashes) ? object.hashes.map((e: any) => String(e)) : [] }; + return { hashes: Array.isArray(object?.hashes) ? object.hashes.map((e: any) => String(e)) : [] } }, toJSON(message: Topic): unknown { - const obj: any = {}; + const obj: any = {} if (message.hashes) { - obj.hashes = message.hashes.map((e) => e); + obj.hashes = message.hashes.map((e) => e) } else { - obj.hashes = []; + obj.hashes = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): Topic { - const message = createBaseTopic(); - message.hashes = object.hashes?.map((e) => e) || []; - return message; + const message = createBaseTopic() + message.hashes = object.hashes?.map((e) => e) || [] + return message }, -}; +} function createBaseProcessBindingsRequest(): ProcessBindingsRequest { - return { bindings: [] }; + return { bindings: [] } } export const ProcessBindingsRequest = { encode(message: ProcessBindingsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.bindings) { - DataBinding.encode(v!, writer.uint32(10).fork()).ldelim(); + DataBinding.encode(v!, writer.uint32(10).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProcessBindingsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessBindingsRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProcessBindingsRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bindings.push(DataBinding.decode(reader, reader.uint32())); - break; + message.bindings.push(DataBinding.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProcessBindingsRequest { return { bindings: Array.isArray(object?.bindings) ? object.bindings.map((e: any) => DataBinding.fromJSON(e)) : [], - }; + } }, toJSON(message: ProcessBindingsRequest): unknown { - const obj: any = {}; + const obj: any = {} if (message.bindings) { - obj.bindings = message.bindings.map((e) => e ? DataBinding.toJSON(e) : undefined); + obj.bindings = message.bindings.map((e) => (e ? DataBinding.toJSON(e) : undefined)) } else { - obj.bindings = []; + obj.bindings = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): ProcessBindingsRequest { - const message = createBaseProcessBindingsRequest(); - message.bindings = object.bindings?.map((e) => DataBinding.fromPartial(e)) || []; - return message; + const message = createBaseProcessBindingsRequest() + message.bindings = object.bindings?.map((e) => DataBinding.fromPartial(e)) || [] + return message }, -}; +} function createBaseProcessBindingResponse(): ProcessBindingResponse { - return { result: undefined, configUpdated: false }; + return { result: undefined, configUpdated: false } } export const ProcessBindingResponse = { encode(message: ProcessBindingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.result !== undefined) { - ProcessResult.encode(message.result, writer.uint32(10).fork()).ldelim(); + ProcessResult.encode(message.result, writer.uint32(10).fork()).ldelim() } if (message.configUpdated === true) { - writer.uint32(32).bool(message.configUpdated); + writer.uint32(32).bool(message.configUpdated) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProcessBindingResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessBindingResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProcessBindingResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.result = ProcessResult.decode(reader, reader.uint32()); - break; + message.result = ProcessResult.decode(reader, reader.uint32()) + break case 4: - message.configUpdated = reader.bool(); - break; + message.configUpdated = reader.bool() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProcessBindingResponse { return { result: isSet(object.result) ? ProcessResult.fromJSON(object.result) : undefined, configUpdated: isSet(object.configUpdated) ? Boolean(object.configUpdated) : false, - }; + } }, toJSON(message: ProcessBindingResponse): unknown { - const obj: any = {}; - message.result !== undefined && (obj.result = message.result ? ProcessResult.toJSON(message.result) : undefined); - message.configUpdated !== undefined && (obj.configUpdated = message.configUpdated); - return obj; + const obj: any = {} + message.result !== undefined && (obj.result = message.result ? ProcessResult.toJSON(message.result) : undefined) + message.configUpdated !== undefined && (obj.configUpdated = message.configUpdated) + return obj }, fromPartial(object: DeepPartial): ProcessBindingResponse { - const message = createBaseProcessBindingResponse(); - message.result = (object.result !== undefined && object.result !== null) - ? ProcessResult.fromPartial(object.result) - : undefined; - message.configUpdated = object.configUpdated ?? false; - return message; + const message = createBaseProcessBindingResponse() + message.result = + object.result !== undefined && object.result !== null ? ProcessResult.fromPartial(object.result) : undefined + message.configUpdated = object.configUpdated ?? false + return message }, -}; +} function createBaseRawTransaction(): RawTransaction { - return { raw: new Uint8Array(), programAccountId: undefined, slot: undefined }; + return { raw: new Uint8Array(), programAccountId: undefined, slot: undefined } } export const RawTransaction = { encode(message: RawTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.raw.length !== 0) { - writer.uint32(10).bytes(message.raw); + writer.uint32(10).bytes(message.raw) } if (message.programAccountId !== undefined) { - writer.uint32(18).string(message.programAccountId); + writer.uint32(18).string(message.programAccountId) } if (message.slot !== undefined) { - writer.uint32(24).uint64(message.slot); + writer.uint32(24).uint64(message.slot) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RawTransaction { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRawTransaction(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRawTransaction() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.raw = reader.bytes(); - break; + message.raw = reader.bytes() + break case 2: - message.programAccountId = reader.string(); - break; + message.programAccountId = reader.string() + break case 3: - message.slot = reader.uint64() as Long; - break; + message.slot = reader.uint64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RawTransaction { @@ -2826,26 +2827,25 @@ export const RawTransaction = { raw: isSet(object.raw) ? bytesFromBase64(object.raw) : new Uint8Array(), programAccountId: isSet(object.programAccountId) ? String(object.programAccountId) : undefined, slot: isSet(object.slot) ? Long.fromValue(object.slot) : undefined, - }; + } }, toJSON(message: RawTransaction): unknown { - const obj: any = {}; - message.raw !== undefined && - (obj.raw = base64FromBytes(message.raw !== undefined ? message.raw : new Uint8Array())); - message.programAccountId !== undefined && (obj.programAccountId = message.programAccountId); - message.slot !== undefined && (obj.slot = (message.slot || undefined).toString()); - return obj; + const obj: any = {} + message.raw !== undefined && (obj.raw = base64FromBytes(message.raw !== undefined ? message.raw : new Uint8Array())) + message.programAccountId !== undefined && (obj.programAccountId = message.programAccountId) + message.slot !== undefined && (obj.slot = (message.slot || undefined).toString()) + return obj }, fromPartial(object: DeepPartial): RawTransaction { - const message = createBaseRawTransaction(); - message.raw = object.raw ?? new Uint8Array(); - message.programAccountId = object.programAccountId ?? undefined; - message.slot = (object.slot !== undefined && object.slot !== null) ? Long.fromValue(object.slot) : undefined; - return message; + const message = createBaseRawTransaction() + message.raw = object.raw ?? new Uint8Array() + message.programAccountId = object.programAccountId ?? undefined + message.slot = object.slot !== undefined && object.slot !== null ? Long.fromValue(object.slot) : undefined + return message }, -}; +} function createBaseData(): Data { return { @@ -2858,81 +2858,81 @@ function createBaseData(): Data { aptEvent: undefined, aptCall: undefined, aptResource: undefined, - }; + } } export const Data = { encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.raw.length !== 0) { - writer.uint32(10).bytes(message.raw); + writer.uint32(10).bytes(message.raw) } if (message.ethLog !== undefined) { - Data_EthLog.encode(message.ethLog, writer.uint32(18).fork()).ldelim(); + Data_EthLog.encode(message.ethLog, writer.uint32(18).fork()).ldelim() } if (message.ethBlock !== undefined) { - Data_EthBlock.encode(message.ethBlock, writer.uint32(26).fork()).ldelim(); + Data_EthBlock.encode(message.ethBlock, writer.uint32(26).fork()).ldelim() } if (message.ethTransaction !== undefined) { - Data_EthTransaction.encode(message.ethTransaction, writer.uint32(34).fork()).ldelim(); + Data_EthTransaction.encode(message.ethTransaction, writer.uint32(34).fork()).ldelim() } if (message.ethTrace !== undefined) { - Data_EthTrace.encode(message.ethTrace, writer.uint32(42).fork()).ldelim(); + Data_EthTrace.encode(message.ethTrace, writer.uint32(42).fork()).ldelim() } if (message.solInstruction !== undefined) { - Data_SolInstruction.encode(message.solInstruction, writer.uint32(50).fork()).ldelim(); + Data_SolInstruction.encode(message.solInstruction, writer.uint32(50).fork()).ldelim() } if (message.aptEvent !== undefined) { - Data_AptEvent.encode(message.aptEvent, writer.uint32(58).fork()).ldelim(); + Data_AptEvent.encode(message.aptEvent, writer.uint32(58).fork()).ldelim() } if (message.aptCall !== undefined) { - Data_AptCall.encode(message.aptCall, writer.uint32(66).fork()).ldelim(); + Data_AptCall.encode(message.aptCall, writer.uint32(66).fork()).ldelim() } if (message.aptResource !== undefined) { - Data_AptResource.encode(message.aptResource, writer.uint32(74).fork()).ldelim(); + Data_AptResource.encode(message.aptResource, writer.uint32(74).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.raw = reader.bytes(); - break; + message.raw = reader.bytes() + break case 2: - message.ethLog = Data_EthLog.decode(reader, reader.uint32()); - break; + message.ethLog = Data_EthLog.decode(reader, reader.uint32()) + break case 3: - message.ethBlock = Data_EthBlock.decode(reader, reader.uint32()); - break; + message.ethBlock = Data_EthBlock.decode(reader, reader.uint32()) + break case 4: - message.ethTransaction = Data_EthTransaction.decode(reader, reader.uint32()); - break; + message.ethTransaction = Data_EthTransaction.decode(reader, reader.uint32()) + break case 5: - message.ethTrace = Data_EthTrace.decode(reader, reader.uint32()); - break; + message.ethTrace = Data_EthTrace.decode(reader, reader.uint32()) + break case 6: - message.solInstruction = Data_SolInstruction.decode(reader, reader.uint32()); - break; + message.solInstruction = Data_SolInstruction.decode(reader, reader.uint32()) + break case 7: - message.aptEvent = Data_AptEvent.decode(reader, reader.uint32()); - break; + message.aptEvent = Data_AptEvent.decode(reader, reader.uint32()) + break case 8: - message.aptCall = Data_AptCall.decode(reader, reader.uint32()); - break; + message.aptCall = Data_AptCall.decode(reader, reader.uint32()) + break case 9: - message.aptResource = Data_AptResource.decode(reader, reader.uint32()); - break; + message.aptResource = Data_AptResource.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data { @@ -2946,267 +2946,264 @@ export const Data = { aptEvent: isSet(object.aptEvent) ? Data_AptEvent.fromJSON(object.aptEvent) : undefined, aptCall: isSet(object.aptCall) ? Data_AptCall.fromJSON(object.aptCall) : undefined, aptResource: isSet(object.aptResource) ? Data_AptResource.fromJSON(object.aptResource) : undefined, - }; + } }, toJSON(message: Data): unknown { - const obj: any = {}; - message.raw !== undefined && - (obj.raw = base64FromBytes(message.raw !== undefined ? message.raw : new Uint8Array())); - message.ethLog !== undefined && (obj.ethLog = message.ethLog ? Data_EthLog.toJSON(message.ethLog) : undefined); + const obj: any = {} + message.raw !== undefined && (obj.raw = base64FromBytes(message.raw !== undefined ? message.raw : new Uint8Array())) + message.ethLog !== undefined && (obj.ethLog = message.ethLog ? Data_EthLog.toJSON(message.ethLog) : undefined) message.ethBlock !== undefined && - (obj.ethBlock = message.ethBlock ? Data_EthBlock.toJSON(message.ethBlock) : undefined); + (obj.ethBlock = message.ethBlock ? Data_EthBlock.toJSON(message.ethBlock) : undefined) message.ethTransaction !== undefined && - (obj.ethTransaction = message.ethTransaction ? Data_EthTransaction.toJSON(message.ethTransaction) : undefined); + (obj.ethTransaction = message.ethTransaction ? Data_EthTransaction.toJSON(message.ethTransaction) : undefined) message.ethTrace !== undefined && - (obj.ethTrace = message.ethTrace ? Data_EthTrace.toJSON(message.ethTrace) : undefined); + (obj.ethTrace = message.ethTrace ? Data_EthTrace.toJSON(message.ethTrace) : undefined) message.solInstruction !== undefined && - (obj.solInstruction = message.solInstruction ? Data_SolInstruction.toJSON(message.solInstruction) : undefined); + (obj.solInstruction = message.solInstruction ? Data_SolInstruction.toJSON(message.solInstruction) : undefined) message.aptEvent !== undefined && - (obj.aptEvent = message.aptEvent ? Data_AptEvent.toJSON(message.aptEvent) : undefined); - message.aptCall !== undefined && (obj.aptCall = message.aptCall ? Data_AptCall.toJSON(message.aptCall) : undefined); + (obj.aptEvent = message.aptEvent ? Data_AptEvent.toJSON(message.aptEvent) : undefined) + message.aptCall !== undefined && (obj.aptCall = message.aptCall ? Data_AptCall.toJSON(message.aptCall) : undefined) message.aptResource !== undefined && - (obj.aptResource = message.aptResource ? Data_AptResource.toJSON(message.aptResource) : undefined); - return obj; + (obj.aptResource = message.aptResource ? Data_AptResource.toJSON(message.aptResource) : undefined) + return obj }, fromPartial(object: DeepPartial): Data { - const message = createBaseData(); - message.raw = object.raw ?? new Uint8Array(); - message.ethLog = (object.ethLog !== undefined && object.ethLog !== null) - ? Data_EthLog.fromPartial(object.ethLog) - : undefined; - message.ethBlock = (object.ethBlock !== undefined && object.ethBlock !== null) - ? Data_EthBlock.fromPartial(object.ethBlock) - : undefined; - message.ethTransaction = (object.ethTransaction !== undefined && object.ethTransaction !== null) - ? Data_EthTransaction.fromPartial(object.ethTransaction) - : undefined; - message.ethTrace = (object.ethTrace !== undefined && object.ethTrace !== null) - ? Data_EthTrace.fromPartial(object.ethTrace) - : undefined; - message.solInstruction = (object.solInstruction !== undefined && object.solInstruction !== null) - ? Data_SolInstruction.fromPartial(object.solInstruction) - : undefined; - message.aptEvent = (object.aptEvent !== undefined && object.aptEvent !== null) - ? Data_AptEvent.fromPartial(object.aptEvent) - : undefined; - message.aptCall = (object.aptCall !== undefined && object.aptCall !== null) - ? Data_AptCall.fromPartial(object.aptCall) - : undefined; - message.aptResource = (object.aptResource !== undefined && object.aptResource !== null) - ? Data_AptResource.fromPartial(object.aptResource) - : undefined; - return message; - }, -}; + const message = createBaseData() + message.raw = object.raw ?? new Uint8Array() + message.ethLog = + object.ethLog !== undefined && object.ethLog !== null ? Data_EthLog.fromPartial(object.ethLog) : undefined + message.ethBlock = + object.ethBlock !== undefined && object.ethBlock !== null ? Data_EthBlock.fromPartial(object.ethBlock) : undefined + message.ethTransaction = + object.ethTransaction !== undefined && object.ethTransaction !== null + ? Data_EthTransaction.fromPartial(object.ethTransaction) + : undefined + message.ethTrace = + object.ethTrace !== undefined && object.ethTrace !== null ? Data_EthTrace.fromPartial(object.ethTrace) : undefined + message.solInstruction = + object.solInstruction !== undefined && object.solInstruction !== null + ? Data_SolInstruction.fromPartial(object.solInstruction) + : undefined + message.aptEvent = + object.aptEvent !== undefined && object.aptEvent !== null ? Data_AptEvent.fromPartial(object.aptEvent) : undefined + message.aptCall = + object.aptCall !== undefined && object.aptCall !== null ? Data_AptCall.fromPartial(object.aptCall) : undefined + message.aptResource = + object.aptResource !== undefined && object.aptResource !== null + ? Data_AptResource.fromPartial(object.aptResource) + : undefined + return message + }, +} function createBaseData_EthLog(): Data_EthLog { - return { log: undefined, transaction: undefined }; + return { log: undefined, transaction: undefined } } export const Data_EthLog = { encode(message: Data_EthLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.log !== undefined) { - Struct.encode(Struct.wrap(message.log), writer.uint32(26).fork()).ldelim(); + Struct.encode(Struct.wrap(message.log), writer.uint32(26).fork()).ldelim() } if (message.transaction !== undefined) { - writer.uint32(18).bytes(message.transaction); + writer.uint32(18).bytes(message.transaction) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_EthLog { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_EthLog(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_EthLog() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 3: - message.log = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.log = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break case 2: - message.transaction = reader.bytes(); - break; + message.transaction = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_EthLog { return { log: isObject(object.log) ? object.log : undefined, transaction: isSet(object.transaction) ? bytesFromBase64(object.transaction) : undefined, - }; + } }, toJSON(message: Data_EthLog): unknown { - const obj: any = {}; - message.log !== undefined && (obj.log = message.log); + const obj: any = {} + message.log !== undefined && (obj.log = message.log) message.transaction !== undefined && - (obj.transaction = message.transaction !== undefined ? base64FromBytes(message.transaction) : undefined); - return obj; + (obj.transaction = message.transaction !== undefined ? base64FromBytes(message.transaction) : undefined) + return obj }, fromPartial(object: DeepPartial): Data_EthLog { - const message = createBaseData_EthLog(); - message.log = object.log ?? undefined; - message.transaction = object.transaction ?? undefined; - return message; + const message = createBaseData_EthLog() + message.log = object.log ?? undefined + message.transaction = object.transaction ?? undefined + return message }, -}; +} function createBaseData_EthBlock(): Data_EthBlock { - return { block: undefined }; + return { block: undefined } } export const Data_EthBlock = { encode(message: Data_EthBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.block !== undefined) { - Struct.encode(Struct.wrap(message.block), writer.uint32(18).fork()).ldelim(); + Struct.encode(Struct.wrap(message.block), writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_EthBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_EthBlock(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_EthBlock() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.block = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.block = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_EthBlock { - return { block: isObject(object.block) ? object.block : undefined }; + return { block: isObject(object.block) ? object.block : undefined } }, toJSON(message: Data_EthBlock): unknown { - const obj: any = {}; - message.block !== undefined && (obj.block = message.block); - return obj; + const obj: any = {} + message.block !== undefined && (obj.block = message.block) + return obj }, fromPartial(object: DeepPartial): Data_EthBlock { - const message = createBaseData_EthBlock(); - message.block = object.block ?? undefined; - return message; + const message = createBaseData_EthBlock() + message.block = object.block ?? undefined + return message }, -}; +} function createBaseData_EthTransaction(): Data_EthTransaction { - return { transaction: undefined, transactionReceipt: undefined }; + return { transaction: undefined, transactionReceipt: undefined } } export const Data_EthTransaction = { encode(message: Data_EthTransaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.transaction !== undefined) { - Struct.encode(Struct.wrap(message.transaction), writer.uint32(34).fork()).ldelim(); + Struct.encode(Struct.wrap(message.transaction), writer.uint32(34).fork()).ldelim() } if (message.transactionReceipt !== undefined) { - writer.uint32(26).bytes(message.transactionReceipt); + writer.uint32(26).bytes(message.transactionReceipt) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_EthTransaction { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_EthTransaction(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_EthTransaction() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 4: - message.transaction = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.transaction = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break case 3: - message.transactionReceipt = reader.bytes(); - break; + message.transactionReceipt = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_EthTransaction { return { transaction: isObject(object.transaction) ? object.transaction : undefined, transactionReceipt: isSet(object.transactionReceipt) ? bytesFromBase64(object.transactionReceipt) : undefined, - }; + } }, toJSON(message: Data_EthTransaction): unknown { - const obj: any = {}; - message.transaction !== undefined && (obj.transaction = message.transaction); - message.transactionReceipt !== undefined && (obj.transactionReceipt = message.transactionReceipt !== undefined - ? base64FromBytes(message.transactionReceipt) - : undefined); - return obj; + const obj: any = {} + message.transaction !== undefined && (obj.transaction = message.transaction) + message.transactionReceipt !== undefined && + (obj.transactionReceipt = + message.transactionReceipt !== undefined ? base64FromBytes(message.transactionReceipt) : undefined) + return obj }, fromPartial(object: DeepPartial): Data_EthTransaction { - const message = createBaseData_EthTransaction(); - message.transaction = object.transaction ?? undefined; - message.transactionReceipt = object.transactionReceipt ?? undefined; - return message; + const message = createBaseData_EthTransaction() + message.transaction = object.transaction ?? undefined + message.transactionReceipt = object.transactionReceipt ?? undefined + return message }, -}; +} function createBaseData_EthTrace(): Data_EthTrace { - return { trace: undefined, transaction: undefined, transactionReceipt: undefined }; + return { trace: undefined, transaction: undefined, transactionReceipt: undefined } } export const Data_EthTrace = { encode(message: Data_EthTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.trace !== undefined) { - Struct.encode(Struct.wrap(message.trace), writer.uint32(34).fork()).ldelim(); + Struct.encode(Struct.wrap(message.trace), writer.uint32(34).fork()).ldelim() } if (message.transaction !== undefined) { - writer.uint32(18).bytes(message.transaction); + writer.uint32(18).bytes(message.transaction) } if (message.transactionReceipt !== undefined) { - writer.uint32(26).bytes(message.transactionReceipt); + writer.uint32(26).bytes(message.transactionReceipt) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_EthTrace { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_EthTrace(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_EthTrace() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 4: - message.trace = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.trace = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break case 2: - message.transaction = reader.bytes(); - break; + message.transaction = reader.bytes() + break case 3: - message.transactionReceipt = reader.bytes(); - break; + message.transactionReceipt = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_EthTrace { @@ -3214,252 +3211,252 @@ export const Data_EthTrace = { trace: isObject(object.trace) ? object.trace : undefined, transaction: isSet(object.transaction) ? bytesFromBase64(object.transaction) : undefined, transactionReceipt: isSet(object.transactionReceipt) ? bytesFromBase64(object.transactionReceipt) : undefined, - }; + } }, toJSON(message: Data_EthTrace): unknown { - const obj: any = {}; - message.trace !== undefined && (obj.trace = message.trace); + const obj: any = {} + message.trace !== undefined && (obj.trace = message.trace) message.transaction !== undefined && - (obj.transaction = message.transaction !== undefined ? base64FromBytes(message.transaction) : undefined); - message.transactionReceipt !== undefined && (obj.transactionReceipt = message.transactionReceipt !== undefined - ? base64FromBytes(message.transactionReceipt) - : undefined); - return obj; + (obj.transaction = message.transaction !== undefined ? base64FromBytes(message.transaction) : undefined) + message.transactionReceipt !== undefined && + (obj.transactionReceipt = + message.transactionReceipt !== undefined ? base64FromBytes(message.transactionReceipt) : undefined) + return obj }, fromPartial(object: DeepPartial): Data_EthTrace { - const message = createBaseData_EthTrace(); - message.trace = object.trace ?? undefined; - message.transaction = object.transaction ?? undefined; - message.transactionReceipt = object.transactionReceipt ?? undefined; - return message; + const message = createBaseData_EthTrace() + message.trace = object.trace ?? undefined + message.transaction = object.transaction ?? undefined + message.transactionReceipt = object.transactionReceipt ?? undefined + return message }, -}; +} function createBaseData_SolInstruction(): Data_SolInstruction { - return { instructionData: "", slot: Long.UZERO, programAccountId: "", accounts: [], parsed: undefined }; + return { instructionData: '', slot: Long.UZERO, programAccountId: '', accounts: [], parsed: undefined } } export const Data_SolInstruction = { encode(message: Data_SolInstruction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.instructionData !== "") { - writer.uint32(10).string(message.instructionData); + if (message.instructionData !== '') { + writer.uint32(10).string(message.instructionData) } if (!message.slot.isZero()) { - writer.uint32(16).uint64(message.slot); + writer.uint32(16).uint64(message.slot) } - if (message.programAccountId !== "") { - writer.uint32(26).string(message.programAccountId); + if (message.programAccountId !== '') { + writer.uint32(26).string(message.programAccountId) } for (const v of message.accounts) { - writer.uint32(42).string(v!); + writer.uint32(42).string(v!) } if (message.parsed !== undefined) { - Struct.encode(Struct.wrap(message.parsed), writer.uint32(34).fork()).ldelim(); + Struct.encode(Struct.wrap(message.parsed), writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_SolInstruction { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_SolInstruction(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_SolInstruction() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.instructionData = reader.string(); - break; + message.instructionData = reader.string() + break case 2: - message.slot = reader.uint64() as Long; - break; + message.slot = reader.uint64() as Long + break case 3: - message.programAccountId = reader.string(); - break; + message.programAccountId = reader.string() + break case 5: - message.accounts.push(reader.string()); - break; + message.accounts.push(reader.string()) + break case 4: - message.parsed = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.parsed = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_SolInstruction { return { - instructionData: isSet(object.instructionData) ? String(object.instructionData) : "", + instructionData: isSet(object.instructionData) ? String(object.instructionData) : '', slot: isSet(object.slot) ? Long.fromValue(object.slot) : Long.UZERO, - programAccountId: isSet(object.programAccountId) ? String(object.programAccountId) : "", + programAccountId: isSet(object.programAccountId) ? String(object.programAccountId) : '', accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => String(e)) : [], parsed: isObject(object.parsed) ? object.parsed : undefined, - }; + } }, toJSON(message: Data_SolInstruction): unknown { - const obj: any = {}; - message.instructionData !== undefined && (obj.instructionData = message.instructionData); - message.slot !== undefined && (obj.slot = (message.slot || Long.UZERO).toString()); - message.programAccountId !== undefined && (obj.programAccountId = message.programAccountId); + const obj: any = {} + message.instructionData !== undefined && (obj.instructionData = message.instructionData) + message.slot !== undefined && (obj.slot = (message.slot || Long.UZERO).toString()) + message.programAccountId !== undefined && (obj.programAccountId = message.programAccountId) if (message.accounts) { - obj.accounts = message.accounts.map((e) => e); + obj.accounts = message.accounts.map((e) => e) } else { - obj.accounts = []; + obj.accounts = [] } - message.parsed !== undefined && (obj.parsed = message.parsed); - return obj; + message.parsed !== undefined && (obj.parsed = message.parsed) + return obj }, fromPartial(object: DeepPartial): Data_SolInstruction { - const message = createBaseData_SolInstruction(); - message.instructionData = object.instructionData ?? ""; - message.slot = (object.slot !== undefined && object.slot !== null) ? Long.fromValue(object.slot) : Long.UZERO; - message.programAccountId = object.programAccountId ?? ""; - message.accounts = object.accounts?.map((e) => e) || []; - message.parsed = object.parsed ?? undefined; - return message; + const message = createBaseData_SolInstruction() + message.instructionData = object.instructionData ?? '' + message.slot = object.slot !== undefined && object.slot !== null ? Long.fromValue(object.slot) : Long.UZERO + message.programAccountId = object.programAccountId ?? '' + message.accounts = object.accounts?.map((e) => e) || [] + message.parsed = object.parsed ?? undefined + return message }, -}; +} function createBaseData_AptEvent(): Data_AptEvent { - return { event: undefined }; + return { event: undefined } } export const Data_AptEvent = { encode(message: Data_AptEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.event !== undefined) { - Struct.encode(Struct.wrap(message.event), writer.uint32(18).fork()).ldelim(); + Struct.encode(Struct.wrap(message.event), writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_AptEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_AptEvent(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_AptEvent() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.event = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.event = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_AptEvent { - return { event: isObject(object.event) ? object.event : undefined }; + return { event: isObject(object.event) ? object.event : undefined } }, toJSON(message: Data_AptEvent): unknown { - const obj: any = {}; - message.event !== undefined && (obj.event = message.event); - return obj; + const obj: any = {} + message.event !== undefined && (obj.event = message.event) + return obj }, fromPartial(object: DeepPartial): Data_AptEvent { - const message = createBaseData_AptEvent(); - message.event = object.event ?? undefined; - return message; + const message = createBaseData_AptEvent() + message.event = object.event ?? undefined + return message }, -}; +} function createBaseData_AptCall(): Data_AptCall { - return { call: undefined }; + return { call: undefined } } export const Data_AptCall = { encode(message: Data_AptCall, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.call !== undefined) { - Struct.encode(Struct.wrap(message.call), writer.uint32(18).fork()).ldelim(); + Struct.encode(Struct.wrap(message.call), writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_AptCall { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_AptCall(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_AptCall() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.call = Struct.unwrap(Struct.decode(reader, reader.uint32())); - break; + message.call = Struct.unwrap(Struct.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_AptCall { - return { call: isObject(object.call) ? object.call : undefined }; + return { call: isObject(object.call) ? object.call : undefined } }, toJSON(message: Data_AptCall): unknown { - const obj: any = {}; - message.call !== undefined && (obj.call = message.call); - return obj; + const obj: any = {} + message.call !== undefined && (obj.call = message.call) + return obj }, fromPartial(object: DeepPartial): Data_AptCall { - const message = createBaseData_AptCall(); - message.call = object.call ?? undefined; - return message; + const message = createBaseData_AptCall() + message.call = object.call ?? undefined + return message }, -}; +} function createBaseData_AptResource(): Data_AptResource { - return { resources: [], version: Long.ZERO, timestampMicros: Long.ZERO }; + return { resources: [], version: Long.ZERO, timestampMicros: Long.ZERO } } export const Data_AptResource = { encode(message: Data_AptResource, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.resources) { - Struct.encode(Struct.wrap(v!), writer.uint32(34).fork()).ldelim(); + Struct.encode(Struct.wrap(v!), writer.uint32(34).fork()).ldelim() } if (!message.version.isZero()) { - writer.uint32(16).int64(message.version); + writer.uint32(16).int64(message.version) } if (!message.timestampMicros.isZero()) { - writer.uint32(40).int64(message.timestampMicros); + writer.uint32(40).int64(message.timestampMicros) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): Data_AptResource { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseData_AptResource(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseData_AptResource() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 4: - message.resources.push(Struct.unwrap(Struct.decode(reader, reader.uint32()))); - break; + message.resources.push(Struct.unwrap(Struct.decode(reader, reader.uint32()))) + break case 2: - message.version = reader.int64() as Long; - break; + message.version = reader.int64() as Long + break case 5: - message.timestampMicros = reader.int64() as Long; - break; + message.timestampMicros = reader.int64() as Long + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): Data_AptResource { @@ -3467,83 +3464,83 @@ export const Data_AptResource = { resources: Array.isArray(object?.resources) ? [...object.resources] : [], version: isSet(object.version) ? Long.fromValue(object.version) : Long.ZERO, timestampMicros: isSet(object.timestampMicros) ? Long.fromValue(object.timestampMicros) : Long.ZERO, - }; + } }, toJSON(message: Data_AptResource): unknown { - const obj: any = {}; + const obj: any = {} if (message.resources) { - obj.resources = message.resources.map((e) => e); + obj.resources = message.resources.map((e) => e) } else { - obj.resources = []; + obj.resources = [] } - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); - message.timestampMicros !== undefined && (obj.timestampMicros = (message.timestampMicros || Long.ZERO).toString()); - return obj; + message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()) + message.timestampMicros !== undefined && (obj.timestampMicros = (message.timestampMicros || Long.ZERO).toString()) + return obj }, fromPartial(object: DeepPartial): Data_AptResource { - const message = createBaseData_AptResource(); - message.resources = object.resources?.map((e) => e) || []; - message.version = (object.version !== undefined && object.version !== null) - ? Long.fromValue(object.version) - : Long.ZERO; - message.timestampMicros = (object.timestampMicros !== undefined && object.timestampMicros !== null) - ? Long.fromValue(object.timestampMicros) - : Long.ZERO; - return message; - }, -}; + const message = createBaseData_AptResource() + message.resources = object.resources?.map((e) => e) || [] + message.version = + object.version !== undefined && object.version !== null ? Long.fromValue(object.version) : Long.ZERO + message.timestampMicros = + object.timestampMicros !== undefined && object.timestampMicros !== null + ? Long.fromValue(object.timestampMicros) + : Long.ZERO + return message + }, +} function createBaseDataBinding(): DataBinding { - return { data: undefined, handlerType: 0, handlerIds: [] }; + return { data: undefined, handlerType: 0, handlerIds: [] } } export const DataBinding = { encode(message: DataBinding, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.data !== undefined) { - Data.encode(message.data, writer.uint32(10).fork()).ldelim(); + Data.encode(message.data, writer.uint32(10).fork()).ldelim() } if (message.handlerType !== 0) { - writer.uint32(24).int32(message.handlerType); + writer.uint32(24).int32(message.handlerType) } - writer.uint32(34).fork(); + writer.uint32(34).fork() for (const v of message.handlerIds) { - writer.int32(v); + writer.int32(v) } - writer.ldelim(); - return writer; + writer.ldelim() + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): DataBinding { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDataBinding(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseDataBinding() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.data = Data.decode(reader, reader.uint32()); - break; + message.data = Data.decode(reader, reader.uint32()) + break case 3: - message.handlerType = reader.int32() as any; - break; + message.handlerType = reader.int32() as any + break case 4: if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; + const end2 = reader.uint32() + reader.pos while (reader.pos < end2) { - message.handlerIds.push(reader.int32()); + message.handlerIds.push(reader.int32()) } } else { - message.handlerIds.push(reader.int32()); + message.handlerIds.push(reader.int32()) } - break; + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): DataBinding { @@ -3551,82 +3548,82 @@ export const DataBinding = { data: isSet(object.data) ? Data.fromJSON(object.data) : undefined, handlerType: isSet(object.handlerType) ? handlerTypeFromJSON(object.handlerType) : 0, handlerIds: Array.isArray(object?.handlerIds) ? object.handlerIds.map((e: any) => Number(e)) : [], - }; + } }, toJSON(message: DataBinding): unknown { - const obj: any = {}; - message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined); - message.handlerType !== undefined && (obj.handlerType = handlerTypeToJSON(message.handlerType)); + const obj: any = {} + message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined) + message.handlerType !== undefined && (obj.handlerType = handlerTypeToJSON(message.handlerType)) if (message.handlerIds) { - obj.handlerIds = message.handlerIds.map((e) => Math.round(e)); + obj.handlerIds = message.handlerIds.map((e) => Math.round(e)) } else { - obj.handlerIds = []; + obj.handlerIds = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): DataBinding { - const message = createBaseDataBinding(); - message.data = (object.data !== undefined && object.data !== null) ? Data.fromPartial(object.data) : undefined; - message.handlerType = object.handlerType ?? 0; - message.handlerIds = object.handlerIds?.map((e) => e) || []; - return message; + const message = createBaseDataBinding() + message.data = object.data !== undefined && object.data !== null ? Data.fromPartial(object.data) : undefined + message.handlerType = object.handlerType ?? 0 + message.handlerIds = object.handlerIds?.map((e) => e) || [] + return message }, -}; +} function createBaseProcessResult(): ProcessResult { - return { gauges: [], counters: [], logs: [], events: [], exports: [] }; + return { gauges: [], counters: [], logs: [], events: [], exports: [] } } export const ProcessResult = { encode(message: ProcessResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.gauges) { - GaugeResult.encode(v!, writer.uint32(10).fork()).ldelim(); + GaugeResult.encode(v!, writer.uint32(10).fork()).ldelim() } for (const v of message.counters) { - CounterResult.encode(v!, writer.uint32(18).fork()).ldelim(); + CounterResult.encode(v!, writer.uint32(18).fork()).ldelim() } for (const v of message.logs) { - LogResult.encode(v!, writer.uint32(26).fork()).ldelim(); + LogResult.encode(v!, writer.uint32(26).fork()).ldelim() } for (const v of message.events) { - EventTrackingResult.encode(v!, writer.uint32(34).fork()).ldelim(); + EventTrackingResult.encode(v!, writer.uint32(34).fork()).ldelim() } for (const v of message.exports) { - ExportResult.encode(v!, writer.uint32(42).fork()).ldelim(); + ExportResult.encode(v!, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ProcessResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProcessResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseProcessResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.gauges.push(GaugeResult.decode(reader, reader.uint32())); - break; + message.gauges.push(GaugeResult.decode(reader, reader.uint32())) + break case 2: - message.counters.push(CounterResult.decode(reader, reader.uint32())); - break; + message.counters.push(CounterResult.decode(reader, reader.uint32())) + break case 3: - message.logs.push(LogResult.decode(reader, reader.uint32())); - break; + message.logs.push(LogResult.decode(reader, reader.uint32())) + break case 4: - message.events.push(EventTrackingResult.decode(reader, reader.uint32())); - break; + message.events.push(EventTrackingResult.decode(reader, reader.uint32())) + break case 5: - message.exports.push(ExportResult.decode(reader, reader.uint32())); - break; + message.exports.push(ExportResult.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ProcessResult { @@ -3636,296 +3633,295 @@ export const ProcessResult = { logs: Array.isArray(object?.logs) ? object.logs.map((e: any) => LogResult.fromJSON(e)) : [], events: Array.isArray(object?.events) ? object.events.map((e: any) => EventTrackingResult.fromJSON(e)) : [], exports: Array.isArray(object?.exports) ? object.exports.map((e: any) => ExportResult.fromJSON(e)) : [], - }; + } }, toJSON(message: ProcessResult): unknown { - const obj: any = {}; + const obj: any = {} if (message.gauges) { - obj.gauges = message.gauges.map((e) => e ? GaugeResult.toJSON(e) : undefined); + obj.gauges = message.gauges.map((e) => (e ? GaugeResult.toJSON(e) : undefined)) } else { - obj.gauges = []; + obj.gauges = [] } if (message.counters) { - obj.counters = message.counters.map((e) => e ? CounterResult.toJSON(e) : undefined); + obj.counters = message.counters.map((e) => (e ? CounterResult.toJSON(e) : undefined)) } else { - obj.counters = []; + obj.counters = [] } if (message.logs) { - obj.logs = message.logs.map((e) => e ? LogResult.toJSON(e) : undefined); + obj.logs = message.logs.map((e) => (e ? LogResult.toJSON(e) : undefined)) } else { - obj.logs = []; + obj.logs = [] } if (message.events) { - obj.events = message.events.map((e) => e ? EventTrackingResult.toJSON(e) : undefined); + obj.events = message.events.map((e) => (e ? EventTrackingResult.toJSON(e) : undefined)) } else { - obj.events = []; + obj.events = [] } if (message.exports) { - obj.exports = message.exports.map((e) => e ? ExportResult.toJSON(e) : undefined); + obj.exports = message.exports.map((e) => (e ? ExportResult.toJSON(e) : undefined)) } else { - obj.exports = []; + obj.exports = [] } - return obj; + return obj }, fromPartial(object: DeepPartial): ProcessResult { - const message = createBaseProcessResult(); - message.gauges = object.gauges?.map((e) => GaugeResult.fromPartial(e)) || []; - message.counters = object.counters?.map((e) => CounterResult.fromPartial(e)) || []; - message.logs = object.logs?.map((e) => LogResult.fromPartial(e)) || []; - message.events = object.events?.map((e) => EventTrackingResult.fromPartial(e)) || []; - message.exports = object.exports?.map((e) => ExportResult.fromPartial(e)) || []; - return message; + const message = createBaseProcessResult() + message.gauges = object.gauges?.map((e) => GaugeResult.fromPartial(e)) || [] + message.counters = object.counters?.map((e) => CounterResult.fromPartial(e)) || [] + message.logs = object.logs?.map((e) => LogResult.fromPartial(e)) || [] + message.events = object.events?.map((e) => EventTrackingResult.fromPartial(e)) || [] + message.exports = object.exports?.map((e) => ExportResult.fromPartial(e)) || [] + return message }, -}; +} function createBaseRecordMetaData(): RecordMetaData { return { - address: "", - contractName: "", + address: '', + contractName: '', blockNumber: Long.UZERO, - transactionHash: "", - chainId: "", + transactionHash: '', + chainId: '', transactionIndex: 0, logIndex: 0, - name: "", + name: '', labels: {}, - }; + } } export const RecordMetaData = { encode(message: RecordMetaData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); + if (message.address !== '') { + writer.uint32(10).string(message.address) } - if (message.contractName !== "") { - writer.uint32(74).string(message.contractName); + if (message.contractName !== '') { + writer.uint32(74).string(message.contractName) } if (!message.blockNumber.isZero()) { - writer.uint32(16).uint64(message.blockNumber); + writer.uint32(16).uint64(message.blockNumber) } - if (message.transactionHash !== "") { - writer.uint32(50).string(message.transactionHash); + if (message.transactionHash !== '') { + writer.uint32(50).string(message.transactionHash) } - if (message.chainId !== "") { - writer.uint32(42).string(message.chainId); + if (message.chainId !== '') { + writer.uint32(42).string(message.chainId) } if (message.transactionIndex !== 0) { - writer.uint32(24).int32(message.transactionIndex); + writer.uint32(24).int32(message.transactionIndex) } if (message.logIndex !== 0) { - writer.uint32(32).int32(message.logIndex); + writer.uint32(32).int32(message.logIndex) } - if (message.name !== "") { - writer.uint32(82).string(message.name); + if (message.name !== '') { + writer.uint32(82).string(message.name) } Object.entries(message.labels).forEach(([key, value]) => { - RecordMetaData_LabelsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).ldelim(); - }); - return writer; + RecordMetaData_LabelsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).ldelim() + }) + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RecordMetaData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRecordMetaData(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRecordMetaData() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 9: - message.contractName = reader.string(); - break; + message.contractName = reader.string() + break case 2: - message.blockNumber = reader.uint64() as Long; - break; + message.blockNumber = reader.uint64() as Long + break case 6: - message.transactionHash = reader.string(); - break; + message.transactionHash = reader.string() + break case 5: - message.chainId = reader.string(); - break; + message.chainId = reader.string() + break case 3: - message.transactionIndex = reader.int32(); - break; + message.transactionIndex = reader.int32() + break case 4: - message.logIndex = reader.int32(); - break; + message.logIndex = reader.int32() + break case 10: - message.name = reader.string(); - break; + message.name = reader.string() + break case 7: - const entry7 = RecordMetaData_LabelsEntry.decode(reader, reader.uint32()); + const entry7 = RecordMetaData_LabelsEntry.decode(reader, reader.uint32()) if (entry7.value !== undefined) { - message.labels[entry7.key] = entry7.value; + message.labels[entry7.key] = entry7.value } - break; + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RecordMetaData { return { - address: isSet(object.address) ? String(object.address) : "", - contractName: isSet(object.contractName) ? String(object.contractName) : "", + address: isSet(object.address) ? String(object.address) : '', + contractName: isSet(object.contractName) ? String(object.contractName) : '', blockNumber: isSet(object.blockNumber) ? Long.fromValue(object.blockNumber) : Long.UZERO, - transactionHash: isSet(object.transactionHash) ? String(object.transactionHash) : "", - chainId: isSet(object.chainId) ? String(object.chainId) : "", + transactionHash: isSet(object.transactionHash) ? String(object.transactionHash) : '', + chainId: isSet(object.chainId) ? String(object.chainId) : '', transactionIndex: isSet(object.transactionIndex) ? Number(object.transactionIndex) : 0, logIndex: isSet(object.logIndex) ? Number(object.logIndex) : 0, - name: isSet(object.name) ? String(object.name) : "", + name: isSet(object.name) ? String(object.name) : '', labels: isObject(object.labels) ? Object.entries(object.labels).reduce<{ [key: string]: string }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}) + acc[key] = String(value) + return acc + }, {}) : {}, - }; + } }, toJSON(message: RecordMetaData): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.contractName !== undefined && (obj.contractName = message.contractName); - message.blockNumber !== undefined && (obj.blockNumber = (message.blockNumber || Long.UZERO).toString()); - message.transactionHash !== undefined && (obj.transactionHash = message.transactionHash); - message.chainId !== undefined && (obj.chainId = message.chainId); - message.transactionIndex !== undefined && (obj.transactionIndex = Math.round(message.transactionIndex)); - message.logIndex !== undefined && (obj.logIndex = Math.round(message.logIndex)); - message.name !== undefined && (obj.name = message.name); - obj.labels = {}; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.contractName !== undefined && (obj.contractName = message.contractName) + message.blockNumber !== undefined && (obj.blockNumber = (message.blockNumber || Long.UZERO).toString()) + message.transactionHash !== undefined && (obj.transactionHash = message.transactionHash) + message.chainId !== undefined && (obj.chainId = message.chainId) + message.transactionIndex !== undefined && (obj.transactionIndex = Math.round(message.transactionIndex)) + message.logIndex !== undefined && (obj.logIndex = Math.round(message.logIndex)) + message.name !== undefined && (obj.name = message.name) + obj.labels = {} if (message.labels) { Object.entries(message.labels).forEach(([k, v]) => { - obj.labels[k] = v; - }); + obj.labels[k] = v + }) } - return obj; + return obj }, fromPartial(object: DeepPartial): RecordMetaData { - const message = createBaseRecordMetaData(); - message.address = object.address ?? ""; - message.contractName = object.contractName ?? ""; - message.blockNumber = (object.blockNumber !== undefined && object.blockNumber !== null) - ? Long.fromValue(object.blockNumber) - : Long.UZERO; - message.transactionHash = object.transactionHash ?? ""; - message.chainId = object.chainId ?? ""; - message.transactionIndex = object.transactionIndex ?? 0; - message.logIndex = object.logIndex ?? 0; - message.name = object.name ?? ""; + const message = createBaseRecordMetaData() + message.address = object.address ?? '' + message.contractName = object.contractName ?? '' + message.blockNumber = + object.blockNumber !== undefined && object.blockNumber !== null ? Long.fromValue(object.blockNumber) : Long.UZERO + message.transactionHash = object.transactionHash ?? '' + message.chainId = object.chainId ?? '' + message.transactionIndex = object.transactionIndex ?? 0 + message.logIndex = object.logIndex ?? 0 + message.name = object.name ?? '' message.labels = Object.entries(object.labels ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { if (value !== undefined) { - acc[key] = String(value); + acc[key] = String(value) } - return acc; - }, {}); - return message; + return acc + }, {}) + return message }, -}; +} function createBaseRecordMetaData_LabelsEntry(): RecordMetaData_LabelsEntry { - return { key: "", value: "" }; + return { key: '', value: '' } } export const RecordMetaData_LabelsEntry = { encode(message: RecordMetaData_LabelsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); + if (message.key !== '') { + writer.uint32(10).string(message.key) } - if (message.value !== "") { - writer.uint32(18).string(message.value); + if (message.value !== '') { + writer.uint32(18).string(message.value) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RecordMetaData_LabelsEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRecordMetaData_LabelsEntry(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRecordMetaData_LabelsEntry() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.key = reader.string(); - break; + message.key = reader.string() + break case 2: - message.value = reader.string(); - break; + message.value = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RecordMetaData_LabelsEntry { - return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" }; + return { key: isSet(object.key) ? String(object.key) : '', value: isSet(object.value) ? String(object.value) : '' } }, toJSON(message: RecordMetaData_LabelsEntry): unknown { - const obj: any = {}; - message.key !== undefined && (obj.key = message.key); - message.value !== undefined && (obj.value = message.value); - return obj; + const obj: any = {} + message.key !== undefined && (obj.key = message.key) + message.value !== undefined && (obj.value = message.value) + return obj }, fromPartial(object: DeepPartial): RecordMetaData_LabelsEntry { - const message = createBaseRecordMetaData_LabelsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; + const message = createBaseRecordMetaData_LabelsEntry() + message.key = object.key ?? '' + message.value = object.value ?? '' + return message }, -}; +} function createBaseMetricValue(): MetricValue { - return { bigDecimal: undefined, doubleValue: undefined, bigInteger: undefined }; + return { bigDecimal: undefined, doubleValue: undefined, bigInteger: undefined } } export const MetricValue = { encode(message: MetricValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.bigDecimal !== undefined) { - writer.uint32(10).string(message.bigDecimal); + writer.uint32(10).string(message.bigDecimal) } if (message.doubleValue !== undefined) { - writer.uint32(17).double(message.doubleValue); + writer.uint32(17).double(message.doubleValue) } if (message.bigInteger !== undefined) { - BigInteger.encode(message.bigInteger, writer.uint32(26).fork()).ldelim(); + BigInteger.encode(message.bigInteger, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): MetricValue { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMetricValue(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMetricValue() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.bigDecimal = reader.string(); - break; + message.bigDecimal = reader.string() + break case 2: - message.doubleValue = reader.double(); - break; + message.doubleValue = reader.double() + break case 3: - message.bigInteger = BigInteger.decode(reader, reader.uint32()); - break; + message.bigInteger = BigInteger.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): MetricValue { @@ -3933,175 +3929,176 @@ export const MetricValue = { bigDecimal: isSet(object.bigDecimal) ? String(object.bigDecimal) : undefined, doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : undefined, bigInteger: isSet(object.bigInteger) ? BigInteger.fromJSON(object.bigInteger) : undefined, - }; + } }, toJSON(message: MetricValue): unknown { - const obj: any = {}; - message.bigDecimal !== undefined && (obj.bigDecimal = message.bigDecimal); - message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + const obj: any = {} + message.bigDecimal !== undefined && (obj.bigDecimal = message.bigDecimal) + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue) message.bigInteger !== undefined && - (obj.bigInteger = message.bigInteger ? BigInteger.toJSON(message.bigInteger) : undefined); - return obj; + (obj.bigInteger = message.bigInteger ? BigInteger.toJSON(message.bigInteger) : undefined) + return obj }, fromPartial(object: DeepPartial): MetricValue { - const message = createBaseMetricValue(); - message.bigDecimal = object.bigDecimal ?? undefined; - message.doubleValue = object.doubleValue ?? undefined; - message.bigInteger = (object.bigInteger !== undefined && object.bigInteger !== null) - ? BigInteger.fromPartial(object.bigInteger) - : undefined; - return message; + const message = createBaseMetricValue() + message.bigDecimal = object.bigDecimal ?? undefined + message.doubleValue = object.doubleValue ?? undefined + message.bigInteger = + object.bigInteger !== undefined && object.bigInteger !== null + ? BigInteger.fromPartial(object.bigInteger) + : undefined + return message }, -}; +} function createBaseBigInteger(): BigInteger { - return { negative: false, data: new Uint8Array() }; + return { negative: false, data: new Uint8Array() } } export const BigInteger = { encode(message: BigInteger, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.negative === true) { - writer.uint32(8).bool(message.negative); + writer.uint32(8).bool(message.negative) } if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); + writer.uint32(18).bytes(message.data) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): BigInteger { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBigInteger(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseBigInteger() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.negative = reader.bool(); - break; + message.negative = reader.bool() + break case 2: - message.data = reader.bytes(); - break; + message.data = reader.bytes() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): BigInteger { return { negative: isSet(object.negative) ? Boolean(object.negative) : false, data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), - }; + } }, toJSON(message: BigInteger): unknown { - const obj: any = {}; - message.negative !== undefined && (obj.negative = message.negative); + const obj: any = {} + message.negative !== undefined && (obj.negative = message.negative) message.data !== undefined && - (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - return obj; + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())) + return obj }, fromPartial(object: DeepPartial): BigInteger { - const message = createBaseBigInteger(); - message.negative = object.negative ?? false; - message.data = object.data ?? new Uint8Array(); - return message; + const message = createBaseBigInteger() + message.negative = object.negative ?? false + message.data = object.data ?? new Uint8Array() + return message }, -}; +} function createBaseRuntimeInfo(): RuntimeInfo { - return { from: 0 }; + return { from: 0 } } export const RuntimeInfo = { encode(message: RuntimeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.from !== 0) { - writer.uint32(8).int32(message.from); + writer.uint32(8).int32(message.from) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): RuntimeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRuntimeInfo(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseRuntimeInfo() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.from = reader.int32() as any; - break; + message.from = reader.int32() as any + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): RuntimeInfo { - return { from: isSet(object.from) ? handlerTypeFromJSON(object.from) : 0 }; + return { from: isSet(object.from) ? handlerTypeFromJSON(object.from) : 0 } }, toJSON(message: RuntimeInfo): unknown { - const obj: any = {}; - message.from !== undefined && (obj.from = handlerTypeToJSON(message.from)); - return obj; + const obj: any = {} + message.from !== undefined && (obj.from = handlerTypeToJSON(message.from)) + return obj }, fromPartial(object: DeepPartial): RuntimeInfo { - const message = createBaseRuntimeInfo(); - message.from = object.from ?? 0; - return message; + const message = createBaseRuntimeInfo() + message.from = object.from ?? 0 + return message }, -}; +} function createBaseGaugeResult(): GaugeResult { - return { metadata: undefined, metricValue: undefined, runtimeInfo: undefined }; + return { metadata: undefined, metricValue: undefined, runtimeInfo: undefined } } export const GaugeResult = { encode(message: GaugeResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.metadata !== undefined) { - RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim() } if (message.metricValue !== undefined) { - MetricValue.encode(message.metricValue, writer.uint32(18).fork()).ldelim(); + MetricValue.encode(message.metricValue, writer.uint32(18).fork()).ldelim() } if (message.runtimeInfo !== undefined) { - RuntimeInfo.encode(message.runtimeInfo, writer.uint32(26).fork()).ldelim(); + RuntimeInfo.encode(message.runtimeInfo, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GaugeResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGaugeResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGaugeResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metadata = RecordMetaData.decode(reader, reader.uint32()); - break; + message.metadata = RecordMetaData.decode(reader, reader.uint32()) + break case 2: - message.metricValue = MetricValue.decode(reader, reader.uint32()); - break; + message.metricValue = MetricValue.decode(reader, reader.uint32()) + break case 3: - message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()); - break; + message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GaugeResult { @@ -4109,81 +4106,84 @@ export const GaugeResult = { metadata: isSet(object.metadata) ? RecordMetaData.fromJSON(object.metadata) : undefined, metricValue: isSet(object.metricValue) ? MetricValue.fromJSON(object.metricValue) : undefined, runtimeInfo: isSet(object.runtimeInfo) ? RuntimeInfo.fromJSON(object.runtimeInfo) : undefined, - }; + } }, toJSON(message: GaugeResult): unknown { - const obj: any = {}; + const obj: any = {} message.metadata !== undefined && - (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined); + (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined) message.metricValue !== undefined && - (obj.metricValue = message.metricValue ? MetricValue.toJSON(message.metricValue) : undefined); + (obj.metricValue = message.metricValue ? MetricValue.toJSON(message.metricValue) : undefined) message.runtimeInfo !== undefined && - (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined); - return obj; + (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined) + return obj }, fromPartial(object: DeepPartial): GaugeResult { - const message = createBaseGaugeResult(); - message.metadata = (object.metadata !== undefined && object.metadata !== null) - ? RecordMetaData.fromPartial(object.metadata) - : undefined; - message.metricValue = (object.metricValue !== undefined && object.metricValue !== null) - ? MetricValue.fromPartial(object.metricValue) - : undefined; - message.runtimeInfo = (object.runtimeInfo !== undefined && object.runtimeInfo !== null) - ? RuntimeInfo.fromPartial(object.runtimeInfo) - : undefined; - return message; - }, -}; + const message = createBaseGaugeResult() + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? RecordMetaData.fromPartial(object.metadata) + : undefined + message.metricValue = + object.metricValue !== undefined && object.metricValue !== null + ? MetricValue.fromPartial(object.metricValue) + : undefined + message.runtimeInfo = + object.runtimeInfo !== undefined && object.runtimeInfo !== null + ? RuntimeInfo.fromPartial(object.runtimeInfo) + : undefined + return message + }, +} function createBaseCounterResult(): CounterResult { - return { metadata: undefined, metricValue: undefined, add: false, runtimeInfo: undefined }; + return { metadata: undefined, metricValue: undefined, add: false, runtimeInfo: undefined } } export const CounterResult = { encode(message: CounterResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.metadata !== undefined) { - RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim() } if (message.metricValue !== undefined) { - MetricValue.encode(message.metricValue, writer.uint32(18).fork()).ldelim(); + MetricValue.encode(message.metricValue, writer.uint32(18).fork()).ldelim() } if (message.add === true) { - writer.uint32(24).bool(message.add); + writer.uint32(24).bool(message.add) } if (message.runtimeInfo !== undefined) { - RuntimeInfo.encode(message.runtimeInfo, writer.uint32(34).fork()).ldelim(); + RuntimeInfo.encode(message.runtimeInfo, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CounterResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCounterResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCounterResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metadata = RecordMetaData.decode(reader, reader.uint32()); - break; + message.metadata = RecordMetaData.decode(reader, reader.uint32()) + break case 2: - message.metricValue = MetricValue.decode(reader, reader.uint32()); - break; + message.metricValue = MetricValue.decode(reader, reader.uint32()) + break case 3: - message.add = reader.bool(); - break; + message.add = reader.bool() + break case 4: - message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()); - break; + message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CounterResult { @@ -4192,290 +4192,299 @@ export const CounterResult = { metricValue: isSet(object.metricValue) ? MetricValue.fromJSON(object.metricValue) : undefined, add: isSet(object.add) ? Boolean(object.add) : false, runtimeInfo: isSet(object.runtimeInfo) ? RuntimeInfo.fromJSON(object.runtimeInfo) : undefined, - }; + } }, toJSON(message: CounterResult): unknown { - const obj: any = {}; + const obj: any = {} message.metadata !== undefined && - (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined); + (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined) message.metricValue !== undefined && - (obj.metricValue = message.metricValue ? MetricValue.toJSON(message.metricValue) : undefined); - message.add !== undefined && (obj.add = message.add); + (obj.metricValue = message.metricValue ? MetricValue.toJSON(message.metricValue) : undefined) + message.add !== undefined && (obj.add = message.add) message.runtimeInfo !== undefined && - (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined); - return obj; + (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined) + return obj }, fromPartial(object: DeepPartial): CounterResult { - const message = createBaseCounterResult(); - message.metadata = (object.metadata !== undefined && object.metadata !== null) - ? RecordMetaData.fromPartial(object.metadata) - : undefined; - message.metricValue = (object.metricValue !== undefined && object.metricValue !== null) - ? MetricValue.fromPartial(object.metricValue) - : undefined; - message.add = object.add ?? false; - message.runtimeInfo = (object.runtimeInfo !== undefined && object.runtimeInfo !== null) - ? RuntimeInfo.fromPartial(object.runtimeInfo) - : undefined; - return message; - }, -}; + const message = createBaseCounterResult() + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? RecordMetaData.fromPartial(object.metadata) + : undefined + message.metricValue = + object.metricValue !== undefined && object.metricValue !== null + ? MetricValue.fromPartial(object.metricValue) + : undefined + message.add = object.add ?? false + message.runtimeInfo = + object.runtimeInfo !== undefined && object.runtimeInfo !== null + ? RuntimeInfo.fromPartial(object.runtimeInfo) + : undefined + return message + }, +} function createBaseLogResult(): LogResult { - return { metadata: undefined, level: 0, message: "", attributes: "", runtimeInfo: undefined }; + return { metadata: undefined, level: 0, message: '', attributes: '', runtimeInfo: undefined } } export const LogResult = { encode(message: LogResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.metadata !== undefined) { - RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim() } if (message.level !== 0) { - writer.uint32(16).int32(message.level); + writer.uint32(16).int32(message.level) } - if (message.message !== "") { - writer.uint32(26).string(message.message); + if (message.message !== '') { + writer.uint32(26).string(message.message) } - if (message.attributes !== "") { - writer.uint32(50).string(message.attributes); + if (message.attributes !== '') { + writer.uint32(50).string(message.attributes) } if (message.runtimeInfo !== undefined) { - RuntimeInfo.encode(message.runtimeInfo, writer.uint32(34).fork()).ldelim(); + RuntimeInfo.encode(message.runtimeInfo, writer.uint32(34).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): LogResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLogResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseLogResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metadata = RecordMetaData.decode(reader, reader.uint32()); - break; + message.metadata = RecordMetaData.decode(reader, reader.uint32()) + break case 2: - message.level = reader.int32() as any; - break; + message.level = reader.int32() as any + break case 3: - message.message = reader.string(); - break; + message.message = reader.string() + break case 6: - message.attributes = reader.string(); - break; + message.attributes = reader.string() + break case 4: - message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()); - break; + message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): LogResult { return { metadata: isSet(object.metadata) ? RecordMetaData.fromJSON(object.metadata) : undefined, level: isSet(object.level) ? logLevelFromJSON(object.level) : 0, - message: isSet(object.message) ? String(object.message) : "", - attributes: isSet(object.attributes) ? String(object.attributes) : "", + message: isSet(object.message) ? String(object.message) : '', + attributes: isSet(object.attributes) ? String(object.attributes) : '', runtimeInfo: isSet(object.runtimeInfo) ? RuntimeInfo.fromJSON(object.runtimeInfo) : undefined, - }; + } }, toJSON(message: LogResult): unknown { - const obj: any = {}; + const obj: any = {} message.metadata !== undefined && - (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined); - message.level !== undefined && (obj.level = logLevelToJSON(message.level)); - message.message !== undefined && (obj.message = message.message); - message.attributes !== undefined && (obj.attributes = message.attributes); + (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined) + message.level !== undefined && (obj.level = logLevelToJSON(message.level)) + message.message !== undefined && (obj.message = message.message) + message.attributes !== undefined && (obj.attributes = message.attributes) message.runtimeInfo !== undefined && - (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined); - return obj; + (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined) + return obj }, fromPartial(object: DeepPartial): LogResult { - const message = createBaseLogResult(); - message.metadata = (object.metadata !== undefined && object.metadata !== null) - ? RecordMetaData.fromPartial(object.metadata) - : undefined; - message.level = object.level ?? 0; - message.message = object.message ?? ""; - message.attributes = object.attributes ?? ""; - message.runtimeInfo = (object.runtimeInfo !== undefined && object.runtimeInfo !== null) - ? RuntimeInfo.fromPartial(object.runtimeInfo) - : undefined; - return message; - }, -}; + const message = createBaseLogResult() + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? RecordMetaData.fromPartial(object.metadata) + : undefined + message.level = object.level ?? 0 + message.message = object.message ?? '' + message.attributes = object.attributes ?? '' + message.runtimeInfo = + object.runtimeInfo !== undefined && object.runtimeInfo !== null + ? RuntimeInfo.fromPartial(object.runtimeInfo) + : undefined + return message + }, +} function createBaseEventTrackingResult(): EventTrackingResult { - return { metadata: undefined, distinctEntityId: "", attributes: "", runtimeInfo: undefined }; + return { metadata: undefined, distinctEntityId: '', attributes: '', runtimeInfo: undefined } } export const EventTrackingResult = { encode(message: EventTrackingResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.metadata !== undefined) { - RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim() } - if (message.distinctEntityId !== "") { - writer.uint32(18).string(message.distinctEntityId); + if (message.distinctEntityId !== '') { + writer.uint32(18).string(message.distinctEntityId) } - if (message.attributes !== "") { - writer.uint32(34).string(message.attributes); + if (message.attributes !== '') { + writer.uint32(34).string(message.attributes) } if (message.runtimeInfo !== undefined) { - RuntimeInfo.encode(message.runtimeInfo, writer.uint32(42).fork()).ldelim(); + RuntimeInfo.encode(message.runtimeInfo, writer.uint32(42).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): EventTrackingResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventTrackingResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseEventTrackingResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metadata = RecordMetaData.decode(reader, reader.uint32()); - break; + message.metadata = RecordMetaData.decode(reader, reader.uint32()) + break case 2: - message.distinctEntityId = reader.string(); - break; + message.distinctEntityId = reader.string() + break case 4: - message.attributes = reader.string(); - break; + message.attributes = reader.string() + break case 5: - message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()); - break; + message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): EventTrackingResult { return { metadata: isSet(object.metadata) ? RecordMetaData.fromJSON(object.metadata) : undefined, - distinctEntityId: isSet(object.distinctEntityId) ? String(object.distinctEntityId) : "", - attributes: isSet(object.attributes) ? String(object.attributes) : "", + distinctEntityId: isSet(object.distinctEntityId) ? String(object.distinctEntityId) : '', + attributes: isSet(object.attributes) ? String(object.attributes) : '', runtimeInfo: isSet(object.runtimeInfo) ? RuntimeInfo.fromJSON(object.runtimeInfo) : undefined, - }; + } }, toJSON(message: EventTrackingResult): unknown { - const obj: any = {}; + const obj: any = {} message.metadata !== undefined && - (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined); - message.distinctEntityId !== undefined && (obj.distinctEntityId = message.distinctEntityId); - message.attributes !== undefined && (obj.attributes = message.attributes); + (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined) + message.distinctEntityId !== undefined && (obj.distinctEntityId = message.distinctEntityId) + message.attributes !== undefined && (obj.attributes = message.attributes) message.runtimeInfo !== undefined && - (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined); - return obj; + (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined) + return obj }, fromPartial(object: DeepPartial): EventTrackingResult { - const message = createBaseEventTrackingResult(); - message.metadata = (object.metadata !== undefined && object.metadata !== null) - ? RecordMetaData.fromPartial(object.metadata) - : undefined; - message.distinctEntityId = object.distinctEntityId ?? ""; - message.attributes = object.attributes ?? ""; - message.runtimeInfo = (object.runtimeInfo !== undefined && object.runtimeInfo !== null) - ? RuntimeInfo.fromPartial(object.runtimeInfo) - : undefined; - return message; - }, -}; + const message = createBaseEventTrackingResult() + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? RecordMetaData.fromPartial(object.metadata) + : undefined + message.distinctEntityId = object.distinctEntityId ?? '' + message.attributes = object.attributes ?? '' + message.runtimeInfo = + object.runtimeInfo !== undefined && object.runtimeInfo !== null + ? RuntimeInfo.fromPartial(object.runtimeInfo) + : undefined + return message + }, +} function createBaseExportResult(): ExportResult { - return { metadata: undefined, payload: "", runtimeInfo: undefined }; + return { metadata: undefined, payload: '', runtimeInfo: undefined } } export const ExportResult = { encode(message: ExportResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.metadata !== undefined) { - RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + RecordMetaData.encode(message.metadata, writer.uint32(10).fork()).ldelim() } - if (message.payload !== "") { - writer.uint32(18).string(message.payload); + if (message.payload !== '') { + writer.uint32(18).string(message.payload) } if (message.runtimeInfo !== undefined) { - RuntimeInfo.encode(message.runtimeInfo, writer.uint32(26).fork()).ldelim(); + RuntimeInfo.encode(message.runtimeInfo, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): ExportResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportResult(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseExportResult() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.metadata = RecordMetaData.decode(reader, reader.uint32()); - break; + message.metadata = RecordMetaData.decode(reader, reader.uint32()) + break case 2: - message.payload = reader.string(); - break; + message.payload = reader.string() + break case 3: - message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()); - break; + message.runtimeInfo = RuntimeInfo.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): ExportResult { return { metadata: isSet(object.metadata) ? RecordMetaData.fromJSON(object.metadata) : undefined, - payload: isSet(object.payload) ? String(object.payload) : "", + payload: isSet(object.payload) ? String(object.payload) : '', runtimeInfo: isSet(object.runtimeInfo) ? RuntimeInfo.fromJSON(object.runtimeInfo) : undefined, - }; + } }, toJSON(message: ExportResult): unknown { - const obj: any = {}; + const obj: any = {} message.metadata !== undefined && - (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined); - message.payload !== undefined && (obj.payload = message.payload); + (obj.metadata = message.metadata ? RecordMetaData.toJSON(message.metadata) : undefined) + message.payload !== undefined && (obj.payload = message.payload) message.runtimeInfo !== undefined && - (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined); - return obj; + (obj.runtimeInfo = message.runtimeInfo ? RuntimeInfo.toJSON(message.runtimeInfo) : undefined) + return obj }, fromPartial(object: DeepPartial): ExportResult { - const message = createBaseExportResult(); - message.metadata = (object.metadata !== undefined && object.metadata !== null) - ? RecordMetaData.fromPartial(object.metadata) - : undefined; - message.payload = object.payload ?? ""; - message.runtimeInfo = (object.runtimeInfo !== undefined && object.runtimeInfo !== null) - ? RuntimeInfo.fromPartial(object.runtimeInfo) - : undefined; - return message; - }, -}; - -export type ProcessorDefinition = typeof ProcessorDefinition; + const message = createBaseExportResult() + message.metadata = + object.metadata !== undefined && object.metadata !== null + ? RecordMetaData.fromPartial(object.metadata) + : undefined + message.payload = object.payload ?? '' + message.runtimeInfo = + object.runtimeInfo !== undefined && object.runtimeInfo !== null + ? RuntimeInfo.fromPartial(object.runtimeInfo) + : undefined + return message + }, +} + +export type ProcessorDefinition = typeof ProcessorDefinition export const ProcessorDefinition = { - name: "Processor", - fullName: "processor.Processor", + name: 'Processor', + fullName: 'processor.Processor', methods: { start: { - name: "Start", + name: 'Start', requestType: StartRequest, requestStream: false, responseType: Empty, @@ -4483,7 +4492,7 @@ export const ProcessorDefinition = { options: {}, }, stop: { - name: "Stop", + name: 'Stop', requestType: Empty, requestStream: false, responseType: Empty, @@ -4491,7 +4500,7 @@ export const ProcessorDefinition = { options: {}, }, getConfig: { - name: "GetConfig", + name: 'GetConfig', requestType: ProcessConfigRequest, requestStream: false, responseType: ProcessConfigResponse, @@ -4499,7 +4508,7 @@ export const ProcessorDefinition = { options: {}, }, processBindings: { - name: "ProcessBindings", + name: 'ProcessBindings', requestType: ProcessBindingsRequest, requestStream: false, responseType: ProcessBindingResponse, @@ -4507,7 +4516,7 @@ export const ProcessorDefinition = { options: {}, }, processBindingsStream: { - name: "ProcessBindingsStream", + name: 'ProcessBindingsStream', requestType: DataBinding, requestStream: true, responseType: ProcessBindingResponse, @@ -4515,105 +4524,111 @@ export const ProcessorDefinition = { options: {}, }, }, -} as const; +} as const export interface ProcessorServiceImplementation { - start(request: StartRequest, context: CallContext & CallContextExt): Promise>; - stop(request: Empty, context: CallContext & CallContextExt): Promise>; + start(request: StartRequest, context: CallContext & CallContextExt): Promise> + stop(request: Empty, context: CallContext & CallContextExt): Promise> getConfig( request: ProcessConfigRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> processBindings( request: ProcessBindingsRequest, - context: CallContext & CallContextExt, - ): Promise>; + context: CallContext & CallContextExt + ): Promise> processBindingsStream( request: AsyncIterable, - context: CallContext & CallContextExt, - ): ServerStreamingMethodResult>; + context: CallContext & CallContextExt + ): ServerStreamingMethodResult> } export interface ProcessorClient { - start(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; - stop(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + start(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise + stop(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise getConfig( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise processBindings( request: DeepPartial, - options?: CallOptions & CallOptionsExt, - ): Promise; + options?: CallOptions & CallOptionsExt + ): Promise processBindingsStream( request: AsyncIterable>, - options?: CallOptions & CallOptionsExt, - ): AsyncIterable; + options?: CallOptions & CallOptionsExt + ): AsyncIterable } -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; +declare var self: any | undefined +declare var window: any | undefined +declare var global: any | undefined var tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; + if (typeof globalThis !== 'undefined') { + return globalThis } - if (typeof self !== "undefined") { - return self; + if (typeof self !== 'undefined') { + return self } - if (typeof window !== "undefined") { - return window; + if (typeof window !== 'undefined') { + return window } - if (typeof global !== "undefined") { - return global; + if (typeof global !== 'undefined') { + return global } - throw "Unable to locate global object"; -})(); + throw 'Unable to locate global object' +})() function bytesFromBase64(b64: string): Uint8Array { if (tsProtoGlobalThis.Buffer) { - return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, "base64")); + return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, 'base64')) } else { - const bin = tsProtoGlobalThis.atob(b64); - const arr = new Uint8Array(bin.length); + const bin = tsProtoGlobalThis.atob(b64) + const arr = new Uint8Array(bin.length) for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + arr[i] = bin.charCodeAt(i) } - return arr; + return arr } } function base64FromBytes(arr: Uint8Array): string { if (tsProtoGlobalThis.Buffer) { - return tsProtoGlobalThis.Buffer.from(arr).toString("base64"); + return tsProtoGlobalThis.Buffer.from(arr).toString('base64') } else { - const bin: string[] = []; + const bin: string[] = [] arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return tsProtoGlobalThis.btoa(bin.join("")); + bin.push(String.fromCharCode(byte)) + }) + return tsProtoGlobalThis.btoa(bin.join('')) } } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isObject(value: any): boolean { - return typeof value === "object" && value !== null; + return typeof value === 'object' && value !== null } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } -export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator }; +export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator } diff --git a/packages/sdk/src/gen/service/price/protos/price.ts b/packages/protos/src/service/price/protos/price.ts similarity index 55% rename from packages/sdk/src/gen/service/price/protos/price.ts rename to packages/protos/src/service/price/protos/price.ts index 5db13ad91..4fd49de32 100644 --- a/packages/sdk/src/gen/service/price/protos/price.ts +++ b/packages/protos/src/service/price/protos/price.ts @@ -1,273 +1,273 @@ /* eslint-disable */ -import Long from "long"; -import type { CallContext, CallOptions } from "nice-grpc-common"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../../google/protobuf/timestamp"; +import Long from 'long' +import type { CallContext, CallOptions } from 'nice-grpc-common' +import _m0 from 'protobufjs/minimal' +import { Timestamp } from '../../../google/protobuf/timestamp' export interface CoinID { - symbol?: string | undefined; - address?: CoinID_AddressIdentifier | undefined; + symbol?: string | undefined + address?: CoinID_AddressIdentifier | undefined } export interface CoinID_AddressIdentifier { - address: string; - chain: string; + address: string + chain: string } export interface GetPriceRequest { - timestamp: Date | undefined; - coinId: CoinID | undefined; + timestamp: Date | undefined + coinId: CoinID | undefined } export interface GetPriceResponse { - price: number; - timestamp: Date | undefined; + price: number + timestamp: Date | undefined } function createBaseCoinID(): CoinID { - return { symbol: undefined, address: undefined }; + return { symbol: undefined, address: undefined } } export const CoinID = { encode(message: CoinID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.symbol !== undefined) { - writer.uint32(18).string(message.symbol); + writer.uint32(18).string(message.symbol) } if (message.address !== undefined) { - CoinID_AddressIdentifier.encode(message.address, writer.uint32(26).fork()).ldelim(); + CoinID_AddressIdentifier.encode(message.address, writer.uint32(26).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CoinID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCoinID(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCoinID() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 2: - message.symbol = reader.string(); - break; + message.symbol = reader.string() + break case 3: - message.address = CoinID_AddressIdentifier.decode(reader, reader.uint32()); - break; + message.address = CoinID_AddressIdentifier.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CoinID { return { symbol: isSet(object.symbol) ? String(object.symbol) : undefined, address: isSet(object.address) ? CoinID_AddressIdentifier.fromJSON(object.address) : undefined, - }; + } }, toJSON(message: CoinID): unknown { - const obj: any = {}; - message.symbol !== undefined && (obj.symbol = message.symbol); + const obj: any = {} + message.symbol !== undefined && (obj.symbol = message.symbol) message.address !== undefined && - (obj.address = message.address ? CoinID_AddressIdentifier.toJSON(message.address) : undefined); - return obj; + (obj.address = message.address ? CoinID_AddressIdentifier.toJSON(message.address) : undefined) + return obj }, fromPartial(object: DeepPartial): CoinID { - const message = createBaseCoinID(); - message.symbol = object.symbol ?? undefined; - message.address = (object.address !== undefined && object.address !== null) - ? CoinID_AddressIdentifier.fromPartial(object.address) - : undefined; - return message; + const message = createBaseCoinID() + message.symbol = object.symbol ?? undefined + message.address = + object.address !== undefined && object.address !== null + ? CoinID_AddressIdentifier.fromPartial(object.address) + : undefined + return message }, -}; +} function createBaseCoinID_AddressIdentifier(): CoinID_AddressIdentifier { - return { address: "", chain: "" }; + return { address: '', chain: '' } } export const CoinID_AddressIdentifier = { encode(message: CoinID_AddressIdentifier, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.address !== "") { - writer.uint32(10).string(message.address); + if (message.address !== '') { + writer.uint32(10).string(message.address) } - if (message.chain !== "") { - writer.uint32(18).string(message.chain); + if (message.chain !== '') { + writer.uint32(18).string(message.chain) } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): CoinID_AddressIdentifier { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCoinID_AddressIdentifier(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseCoinID_AddressIdentifier() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.address = reader.string(); - break; + message.address = reader.string() + break case 2: - message.chain = reader.string(); - break; + message.chain = reader.string() + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): CoinID_AddressIdentifier { return { - address: isSet(object.address) ? String(object.address) : "", - chain: isSet(object.chain) ? String(object.chain) : "", - }; + address: isSet(object.address) ? String(object.address) : '', + chain: isSet(object.chain) ? String(object.chain) : '', + } }, toJSON(message: CoinID_AddressIdentifier): unknown { - const obj: any = {}; - message.address !== undefined && (obj.address = message.address); - message.chain !== undefined && (obj.chain = message.chain); - return obj; + const obj: any = {} + message.address !== undefined && (obj.address = message.address) + message.chain !== undefined && (obj.chain = message.chain) + return obj }, fromPartial(object: DeepPartial): CoinID_AddressIdentifier { - const message = createBaseCoinID_AddressIdentifier(); - message.address = object.address ?? ""; - message.chain = object.chain ?? ""; - return message; + const message = createBaseCoinID_AddressIdentifier() + message.address = object.address ?? '' + message.chain = object.chain ?? '' + return message }, -}; +} function createBaseGetPriceRequest(): GetPriceRequest { - return { timestamp: undefined, coinId: undefined }; + return { timestamp: undefined, coinId: undefined } } export const GetPriceRequest = { encode(message: GetPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.timestamp !== undefined) { - Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim() } if (message.coinId !== undefined) { - CoinID.encode(message.coinId, writer.uint32(18).fork()).ldelim(); + CoinID.encode(message.coinId, writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetPriceRequest(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetPriceRequest() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break case 2: - message.coinId = CoinID.decode(reader, reader.uint32()); - break; + message.coinId = CoinID.decode(reader, reader.uint32()) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetPriceRequest { return { timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, coinId: isSet(object.coinId) ? CoinID.fromJSON(object.coinId) : undefined, - }; + } }, toJSON(message: GetPriceRequest): unknown { - const obj: any = {}; - message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); - message.coinId !== undefined && (obj.coinId = message.coinId ? CoinID.toJSON(message.coinId) : undefined); - return obj; + const obj: any = {} + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()) + message.coinId !== undefined && (obj.coinId = message.coinId ? CoinID.toJSON(message.coinId) : undefined) + return obj }, fromPartial(object: DeepPartial): GetPriceRequest { - const message = createBaseGetPriceRequest(); - message.timestamp = object.timestamp ?? undefined; - message.coinId = (object.coinId !== undefined && object.coinId !== null) - ? CoinID.fromPartial(object.coinId) - : undefined; - return message; + const message = createBaseGetPriceRequest() + message.timestamp = object.timestamp ?? undefined + message.coinId = + object.coinId !== undefined && object.coinId !== null ? CoinID.fromPartial(object.coinId) : undefined + return message }, -}; +} function createBaseGetPriceResponse(): GetPriceResponse { - return { price: 0, timestamp: undefined }; + return { price: 0, timestamp: undefined } } export const GetPriceResponse = { encode(message: GetPriceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.price !== 0) { - writer.uint32(9).double(message.price); + writer.uint32(9).double(message.price) } if (message.timestamp !== undefined) { - Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).ldelim() } - return writer; + return writer }, decode(input: _m0.Reader | Uint8Array, length?: number): GetPriceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetPriceResponse(); + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseGetPriceResponse() while (reader.pos < end) { - const tag = reader.uint32(); + const tag = reader.uint32() switch (tag >>> 3) { case 1: - message.price = reader.double(); - break; + message.price = reader.double() + break case 2: - message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())) + break default: - reader.skipType(tag & 7); - break; + reader.skipType(tag & 7) + break } } - return message; + return message }, fromJSON(object: any): GetPriceResponse { return { price: isSet(object.price) ? Number(object.price) : 0, timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined, - }; + } }, toJSON(message: GetPriceResponse): unknown { - const obj: any = {}; - message.price !== undefined && (obj.price = message.price); - message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); - return obj; + const obj: any = {} + message.price !== undefined && (obj.price = message.price) + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()) + return obj }, fromPartial(object: DeepPartial): GetPriceResponse { - const message = createBaseGetPriceResponse(); - message.price = object.price ?? 0; - message.timestamp = object.timestamp ?? undefined; - return message; + const message = createBaseGetPriceResponse() + message.price = object.price ?? 0 + message.timestamp = object.timestamp ?? undefined + return message }, -}; +} -export type PriceServiceDefinition = typeof PriceServiceDefinition; +export type PriceServiceDefinition = typeof PriceServiceDefinition export const PriceServiceDefinition = { - name: "PriceService", - fullName: "price_service.PriceService", + name: 'PriceService', + fullName: 'price_service.PriceService', methods: { getPrice: { - name: "GetPrice", + name: 'GetPrice', requestType: GetPriceRequest, requestStream: false, responseType: GetPriceResponse, @@ -275,55 +275,61 @@ export const PriceServiceDefinition = { options: {}, }, }, -} as const; +} as const export interface PriceServiceImplementation { - getPrice(request: GetPriceRequest, context: CallContext & CallContextExt): Promise>; + getPrice(request: GetPriceRequest, context: CallContext & CallContextExt): Promise> } export interface PriceServiceClient { - getPrice(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getPrice(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise } -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined -type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial function toTimestamp(date: Date): Timestamp { - const seconds = numberToLong(date.getTime() / 1_000); - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; + const seconds = numberToLong(date.getTime() / 1_000) + const nanos = (date.getTime() % 1_000) * 1_000_000 + return { seconds, nanos } } function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); + let millis = t.seconds.toNumber() * 1_000 + millis += t.nanos / 1_000_000 + return new Date(millis) } function fromJsonTimestamp(o: any): Date { if (o instanceof Date) { - return o; - } else if (typeof o === "string") { - return new Date(o); + return o + } else if (typeof o === 'string') { + return new Date(o) } else { - return fromTimestamp(Timestamp.fromJSON(o)); + return fromTimestamp(Timestamp.fromJSON(o)) } } function numberToLong(number: number) { - return Long.fromNumber(number); + return Long.fromNumber(number) } if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); + _m0.util.Long = Long as any + _m0.configure() } function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined } diff --git a/packages/protos/tsconfig.json b/packages/protos/tsconfig.json new file mode 100644 index 000000000..fccf5b99b --- /dev/null +++ b/packages/protos/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "inlineSources": true, + "rootDir": "./src", + "baseUrl": "./src", + "paths": { + "@sentio/sdk": ["."] + }, + "outDir": "lib" + }, + "exclude": ["lib"] +} diff --git a/packages/runtime/package.json b/packages/runtime/package.json index cd8bf8efd..2ab31597e 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,10 +1,11 @@ { "name": "@sentio/runtime", "license": "Apache-2.0", - "version": "1.0.0-rc.5", + "version": "1.0.0", "scripts": { "compile": "tsc -p .", "build": "yarn compile", + "build_all": "yarn lerna run --scope=@sentio/runtime build --include-dependencies", "test": "jest" }, "dependencies": { @@ -45,9 +46,5 @@ "{lib,src,templates}", "!{lib,src}/tests", "!**/*.test.{js,ts}" - ], - "engines": { - "node": ">=16" - }, - "gitHead": "8bec43cdc9e778d66a4154bc1be1f9276b680408" + ] } diff --git a/packages/runtime/tsconfig.json b/packages/runtime/tsconfig.json index fccf5b99b..9817516bd 100644 --- a/packages/runtime/tsconfig.json +++ b/packages/runtime/tsconfig.json @@ -4,9 +4,6 @@ "inlineSources": true, "rootDir": "./src", "baseUrl": "./src", - "paths": { - "@sentio/sdk": ["."] - }, "outDir": "lib" }, "exclude": ["lib"] diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 4733b86cf..6b7fdd681 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,7 +1,7 @@ { "name": "@sentio/sdk", "license": "Apache-2.0", - "version": "1.0.0-rc.5", + "version": "1.0.0", "scripts": { "compile_target": "yarn tsc -b src/target-ethers-sentio/tsconfig.json", "compile": "tsc -p . && cp src/utils/*.csv lib/utils", @@ -23,6 +23,8 @@ "@ethersproject/providers": "~5.7.0", "@project-serum/anchor": "^0.26.0", "@sentio/cli": "^1.0.0", + "@sentio/base": "^1.0.0", + "@sentio/protos": "^1.0.0", "@solana/web3.js": "^1.47.3", "@typechain/ethers-v5": "^10.0.0", "@types/bn.js": "^5.1.0", @@ -72,6 +74,5 @@ ], "engines": { "node": ">=16" - }, - "gitHead": "8bec43cdc9e778d66a4154bc1be1f9276b680408" + } } diff --git a/packages/sdk/src/aptos/api.ts b/packages/sdk/src/aptos/api.ts index 9dd7777bd..ccb0c67cc 100644 --- a/packages/sdk/src/aptos/api.ts +++ b/packages/sdk/src/aptos/api.ts @@ -1,4 +1,4 @@ -import { AptosQueryClient, AptosQueryDefinition } from '../gen/chainquery/protos/chainquery' +import { AptosQueryClient, AptosQueryDefinition } from '@sentio/protos/lib/chainquery/protos/chainquery' import { createChannel, createClient } from 'nice-grpc' export function getChainQueryClient(address?: string): AptosQueryClient { diff --git a/packages/sdk/src/aptos/aptos-plugin.ts b/packages/sdk/src/aptos/aptos-plugin.ts index 8113b0aee..a2db2ca67 100644 --- a/packages/sdk/src/aptos/aptos-plugin.ts +++ b/packages/sdk/src/aptos/aptos-plugin.ts @@ -1,4 +1,4 @@ -import { Plugin, PluginManager } from '../plugin' +import { Plugin, PluginManager } from '@sentio/base' import { AccountConfig, AptosCallHandlerConfig, @@ -8,7 +8,8 @@ import { HandlerType, ProcessConfigResponse, ProcessResult, -} from '../gen/processor/protos/processor' +} from '@sentio/protos' + import { DEFAULT_MAX_BLOCK, errorString, mergeProcessResults, USER_PROCESSOR, Utf8ArrayToStr } from '../service' import { ServerError, Status } from 'nice-grpc' diff --git a/packages/sdk/src/aptos/aptos-processor.ts b/packages/sdk/src/aptos/aptos-processor.ts index afcf1ae5d..86c98bd30 100644 --- a/packages/sdk/src/aptos/aptos-processor.ts +++ b/packages/sdk/src/aptos/aptos-processor.ts @@ -8,8 +8,8 @@ import { TYPE_REGISTRY, TypeRegistry } from './type-registry' import { AptosBindOptions, AptosNetwork, getChainId } from './network' import { AptosContext, AptosResourceContext } from './context' import { EventInstance } from './models' -import { ListStateStorage } from '../state/state-storage' -import { HandleInterval, ProcessResult } from '../gen' +import { ListStateStorage } from '@sentio/base' +import { HandleInterval, ProcessResult } from '@sentio/protos' type IndexConfigure = { address: string diff --git a/packages/sdk/src/aptos/context.ts b/packages/sdk/src/aptos/context.ts index 4b50e6402..c3cf34c3b 100644 --- a/packages/sdk/src/aptos/context.ts +++ b/packages/sdk/src/aptos/context.ts @@ -1,5 +1,5 @@ import Long from 'long' -import { RecordMetaData } from '../gen' +import { RecordMetaData } from '@sentio/protos' import { Labels } from '../core/metadata' import { normalizeLabels } from '../core/meter' import { BaseContext } from '../core/base-context' diff --git a/packages/sdk/src/binds.ts b/packages/sdk/src/binds.ts index 77624d1bf..20f92e738 100644 --- a/packages/sdk/src/binds.ts +++ b/packages/sdk/src/binds.ts @@ -3,7 +3,7 @@ import { BaseProcessor, ContractView } from './core' import { Networkish } from '@ethersproject/networks' import { getNetwork } from '@ethersproject/providers' import { BaseContract } from 'ethers' -import { MapStateStorage } from './state/state-storage' +import { MapStateStorage } from '@sentio/base' export class ProcessorState extends MapStateStorage> { static INSTANCE = new ProcessorState() diff --git a/packages/sdk/src/core/account-processor.ts b/packages/sdk/src/core/account-processor.ts index 30c1cb035..6ada99f76 100644 --- a/packages/sdk/src/core/account-processor.ts +++ b/packages/sdk/src/core/account-processor.ts @@ -1,4 +1,4 @@ -import { ListStateStorage } from '../state/state-storage' +import { ListStateStorage } from '@sentio/base' import { ERC20__factory, ERC721__factory } from '../builtin/internal' import { AddressType, DummyProvider, ProcessResult } from '@sentio/sdk' import { AccountBindOptions } from './bind-options' diff --git a/packages/sdk/src/core/base-context.ts b/packages/sdk/src/core/base-context.ts index 7ccddcac6..038952072 100644 --- a/packages/sdk/src/core/base-context.ts +++ b/packages/sdk/src/core/base-context.ts @@ -1,4 +1,4 @@ -import { ProcessResult, RecordMetaData } from '../gen' +import { ProcessResult, RecordMetaData } from '@sentio/protos' import { Logger } from './logger' import { Labels } from './metadata' import { Meter } from './meter' diff --git a/packages/sdk/src/core/base-processor-template.ts b/packages/sdk/src/core/base-processor-template.ts index 2442479ed..e804ebffc 100644 --- a/packages/sdk/src/core/base-processor-template.ts +++ b/packages/sdk/src/core/base-processor-template.ts @@ -4,12 +4,12 @@ import { BaseContract, EventFilter } from 'ethers' import { Event } from '@ethersproject/contracts' import { BaseProcessor } from './base-processor' import { BindOptions, getOptionsSignature } from './bind-options' -import { HandleInterval, TemplateInstance } from '../gen' +import { HandleInterval, TemplateInstance } from '@sentio/protos' import Long from 'long' import { getNetwork } from '@ethersproject/providers' import { PromiseOrVoid } from '../promise-or-void' import { Trace } from './trace' -import { ListStateStorage } from '../state/state-storage' +import { ListStateStorage } from '@sentio/base' export class ProcessorTemplateProcessorState extends ListStateStorage< BaseProcessorTemplate> diff --git a/packages/sdk/src/core/base-processor.ts b/packages/sdk/src/core/base-processor.ts index add1580f2..5e5ff47a8 100644 --- a/packages/sdk/src/core/base-processor.ts +++ b/packages/sdk/src/core/base-processor.ts @@ -4,7 +4,7 @@ import { BaseContract, Event, EventFilter } from '@ethersproject/contracts' import Long from 'long' import { BoundContractView, ContractContext, ContractView } from './context' -import { AddressType, HandleInterval, ProcessResult } from '../gen' +import { AddressType, HandleInterval, ProcessResult } from '@sentio/protos' import { BindInternalOptions, BindOptions } from './bind-options' import { PromiseOrVoid } from '../promise-or-void' import { Trace } from './trace' diff --git a/packages/sdk/src/core/context.ts b/packages/sdk/src/core/context.ts index 6a005d3be..92807176d 100644 --- a/packages/sdk/src/core/context.ts +++ b/packages/sdk/src/core/context.ts @@ -1,4 +1,4 @@ -import { RecordMetaData, ProcessResult } from '../gen' +import { RecordMetaData, ProcessResult } from '@sentio/protos' import { BaseContract, EventFilter } from 'ethers' import { Block, Log } from '@ethersproject/abstract-provider' import { normalizeLabels } from './meter' diff --git a/packages/sdk/src/core/eth-plugin.ts b/packages/sdk/src/core/eth-plugin.ts index 3e804c67d..f717ebc1c 100644 --- a/packages/sdk/src/core/eth-plugin.ts +++ b/packages/sdk/src/core/eth-plugin.ts @@ -1,4 +1,4 @@ -import { Plugin, PluginManager } from '../plugin' +import { Plugin, PluginManager } from '@sentio/base' import { AccountConfig, ContractConfig, @@ -8,7 +8,7 @@ import { LogHandlerConfig, ProcessConfigResponse, ProcessResult, -} from '../gen/processor/protos/processor' +} from '@sentio/protos' import { DEFAULT_MAX_BLOCK, errorString, mergeProcessResults, USER_PROCESSOR, Utf8ArrayToStr } from '../service' import { ServerError, Status } from 'nice-grpc' diff --git a/packages/sdk/src/core/event-tracker.ts b/packages/sdk/src/core/event-tracker.ts index b7ca00e69..b8dd772f4 100644 --- a/packages/sdk/src/core/event-tracker.ts +++ b/packages/sdk/src/core/event-tracker.ts @@ -1,7 +1,7 @@ import { BaseContext } from './base-context' -import { EventTrackingResult } from '../gen' +import { EventTrackingResult } from '@sentio/protos' import { NamedResultDescriptor } from './metadata' -import { MapStateStorage } from '../state/state-storage' +import { MapStateStorage } from '@sentio/base' export interface Event { // The unique identifier of main identity associate with an event diff --git a/packages/sdk/src/core/exporter.ts b/packages/sdk/src/core/exporter.ts index 2f51bd131..35806a084 100644 --- a/packages/sdk/src/core/exporter.ts +++ b/packages/sdk/src/core/exporter.ts @@ -1,7 +1,7 @@ import { BaseContext } from './base-context' import { ExportResult } from '@sentio/sdk' import { NamedResultDescriptor } from './metadata' -import { MapStateStorage } from '../state/state-storage' +import { MapStateStorage } from '@sentio/base' export type Export = Record diff --git a/packages/sdk/src/core/generic-processor.test.ts b/packages/sdk/src/core/generic-processor.test.ts index 9f3a15844..9e4978685 100644 --- a/packages/sdk/src/core/generic-processor.test.ts +++ b/packages/sdk/src/core/generic-processor.test.ts @@ -2,7 +2,7 @@ import { expect } from 'chai' -import { HandlerType } from '../gen' +import { HandlerType } from '@sentio/protos' import { GenericProcessor } from './generic-processor' import { TestProcessorServer, firstCounterValue } from '../testing' diff --git a/packages/sdk/src/core/logger.ts b/packages/sdk/src/core/logger.ts index ad87f8789..14a944e1d 100644 --- a/packages/sdk/src/core/logger.ts +++ b/packages/sdk/src/core/logger.ts @@ -1,5 +1,5 @@ import { BaseContext } from './base-context' -import { LogLevel } from '../gen' +import { LogLevel } from '@sentio/protos' import { NamedResultDescriptor } from './metadata' export type Attributes = Record diff --git a/packages/sdk/src/core/meter.ts b/packages/sdk/src/core/meter.ts index bbbcdef4c..cd53db45b 100644 --- a/packages/sdk/src/core/meter.ts +++ b/packages/sdk/src/core/meter.ts @@ -1,8 +1,8 @@ import { BaseContext } from './base-context' import { Numberish, toMetricValue } from './numberish' import { Labels, NamedResultDescriptor } from './metadata' -import { AggregationConfig, AggregationType, MetricConfig, MetricType } from '../gen' -import { MapStateStorage } from '../state/state-storage' +import { AggregationConfig, AggregationType, MetricConfig, MetricType } from '@sentio/protos' +import { MapStateStorage } from '@sentio/base' export function normalizeName(name: string): string { const regex = new RegExp('![_.a-zA-Z0-9]') diff --git a/packages/sdk/src/core/numberish.test.ts b/packages/sdk/src/core/numberish.test.ts index 3253400fa..6323eef41 100644 --- a/packages/sdk/src/core/numberish.test.ts +++ b/packages/sdk/src/core/numberish.test.ts @@ -3,7 +3,7 @@ import { toBigInteger, toMetricValue } from './numberish' import { webcrypto } from 'crypto' import { BigNumber } from 'ethers' import { performance } from 'perf_hooks' -import { BigInteger } from '../gen' +import { BigInteger } from '@sentio/protos' import { BigDecimal } from '.' // TODO add test for type conversion diff --git a/packages/sdk/src/core/numberish.ts b/packages/sdk/src/core/numberish.ts index cb8de751a..d02cc2cad 100644 --- a/packages/sdk/src/core/numberish.ts +++ b/packages/sdk/src/core/numberish.ts @@ -1,5 +1,5 @@ import { BigNumber } from 'ethers' -import { BigInteger, MetricValue } from '../gen' +import { BigInteger, MetricValue } from '@sentio/protos' import { BigDecimal } from '.' import { BN } from '@project-serum/anchor' import Long from 'long' diff --git a/packages/sdk/src/core/solana-plugin.ts b/packages/sdk/src/core/solana-plugin.ts index 743e5a03a..31ee04360 100644 --- a/packages/sdk/src/core/solana-plugin.ts +++ b/packages/sdk/src/core/solana-plugin.ts @@ -1,4 +1,4 @@ -import { Plugin, PluginManager } from '../plugin' +import { Plugin, PluginManager } from '@sentio/base' import { ContractConfig, Data_SolInstruction, @@ -6,8 +6,8 @@ import { HandlerType, ProcessConfigResponse, ProcessResult, -} from '../gen/processor/protos/processor' -import { DEFAULT_MAX_BLOCK, errorString, mergeProcessResults, USER_PROCESSOR, Utf8ArrayToStr } from '../service' +} from '@sentio/protos' +import { DEFAULT_MAX_BLOCK, mergeProcessResults, USER_PROCESSOR } from '../service' import { ServerError, Status } from 'nice-grpc' diff --git a/packages/sdk/src/core/solana-processor.ts b/packages/sdk/src/core/solana-processor.ts index 71076b0c5..c1fb37cb1 100644 --- a/packages/sdk/src/core/solana-processor.ts +++ b/packages/sdk/src/core/solana-processor.ts @@ -1,9 +1,9 @@ -import { ProcessResult } from '../gen' +import { ProcessResult } from '@sentio/protos' import { SolanaContext } from './solana-context' import Long from 'long' import { Instruction } from '@project-serum/anchor' import { SolanaBindOptions } from './solana-options' -import { ListStateStorage } from '../state/state-storage' +import { ListStateStorage } from '@sentio/base' import { CHAIN_IDS } from '../utils/chain' type IndexConfigure = { diff --git a/packages/sdk/src/core/sui-plugin.ts b/packages/sdk/src/core/sui-plugin.ts index 5f81e855e..b7556dac1 100644 --- a/packages/sdk/src/core/sui-plugin.ts +++ b/packages/sdk/src/core/sui-plugin.ts @@ -1,11 +1,6 @@ -import { Plugin, PluginManager } from '../plugin' -import { - ContractConfig, - DataBinding, - HandlerType, - ProcessConfigResponse, - ProcessResult, -} from '../gen/processor/protos/processor' +import { Plugin, PluginManager } from '@sentio/base' +import { ContractConfig, DataBinding, HandlerType, ProcessConfigResponse, ProcessResult } from '@sentio/protos' + import { DEFAULT_MAX_BLOCK, USER_PROCESSOR } from '../service' import { ServerError, Status } from 'nice-grpc' diff --git a/packages/sdk/src/core/sui-processor.ts b/packages/sdk/src/core/sui-processor.ts index 18e4c0442..078f47f5c 100644 --- a/packages/sdk/src/core/sui-processor.ts +++ b/packages/sdk/src/core/sui-processor.ts @@ -1,7 +1,7 @@ import { SuiContext } from './context' -import { ProcessResult } from '../gen' +import { ProcessResult } from '@sentio/protos' import Long from 'long' -import { ListStateStorage } from '../state/state-storage' +import { ListStateStorage } from '@sentio/base' type IndexConfigure = { startSeqNumber: Long diff --git a/packages/sdk/src/gen/builtin.ts b/packages/sdk/src/gen/builtin.ts deleted file mode 100755 index af01c7c10..000000000 --- a/packages/sdk/src/gen/builtin.ts +++ /dev/null @@ -1,22 +0,0 @@ -import Long from 'long' - -type Builtin = - | Date - | Function - | Uint8Array - | string - | number - | boolean - | undefined; - -export type DeepPartial = T extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/packages/sdk/src/gen/google/protobuf/empty.ts b/packages/sdk/src/gen/google/protobuf/empty.ts deleted file mode 100644 index 2bb772c30..000000000 --- a/packages/sdk/src/gen/google/protobuf/empty.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export interface Empty { -} - -function createBaseEmpty(): Empty { - return {}; -} - -export const Empty = { - encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Empty { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEmpty(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): Empty { - return {}; - }, - - toJSON(_: Empty): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): Empty { - const message = createBaseEmpty(); - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/packages/sdk/src/gen/google/protobuf/timestamp.ts b/packages/sdk/src/gen/google/protobuf/timestamp.ts deleted file mode 100644 index 795152ba6..000000000 --- a/packages/sdk/src/gen/google/protobuf/timestamp.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export interface Timestamp { - seconds: Long; - nanos: number; -} - -function createBaseTimestamp(): Timestamp { - return { seconds: Long.ZERO, nanos: 0 }; -} - -export const Timestamp = { - encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.seconds.isZero()) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTimestamp(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64() as Long; - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Timestamp { - return { - seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, - nanos: isSet(object.nanos) ? Number(object.nanos) : 0, - }; - }, - - toJSON(message: Timestamp): unknown { - const obj: any = {}; - message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); - message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); - return obj; - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = createBaseTimestamp(); - message.seconds = (object.seconds !== undefined && object.seconds !== null) - ? Long.fromValue(object.seconds) - : Long.ZERO; - message.nanos = object.nanos ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -type DeepPartial = T extends Builtin ? T - : T extends Long ? string | number | Long : T extends Array ? Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 9d259e5f3..c239bb2e9 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,12 +1,11 @@ -// export { ProcessorServiceImpl } from './service' export { getProvider, setProvider, DummyProvider } from './provider' export { transformEtherError } from './error' -// export { ProcessorState } from './state/processor-state' export { EthersError } from './error' export { getProcessor, addProcessor, getContractByABI, addContractByABI } from './binds' -export * from './gen' +// TODO maybe remove this +export * from '@sentio/protos' export * from './core' diff --git a/packages/sdk/src/processor-runner.ts b/packages/sdk/src/processor-runner.ts index cf16c9d7f..3cd6d7461 100644 --- a/packages/sdk/src/processor-runner.ts +++ b/packages/sdk/src/processor-runner.ts @@ -9,14 +9,14 @@ import { createServer } from 'nice-grpc' import { createLogger, transports, format } from 'winston' import { CompressionAlgorithms } from '@grpc/grpc-js/build/src/compression-algorithms' -import { ProcessorDefinition } from './gen' +import { ProcessorDefinition } from '@sentio/protos' import { ProcessorServiceImpl } from './service' import { setProvider } from './provider' -import { ProcessorState } from './state/processor-state' +import { State } from '@sentio/base' import { load } from './loader' import { Endpoints } from './endpoints' -global.PROCESSOR_STATE = new ProcessorState() +State.reset() global.ENDPOINTS = new Endpoints() const optionDefinitions = [ diff --git a/packages/sdk/src/service.ts b/packages/sdk/src/service.ts index cd57a21af..2f9a21e52 100644 --- a/packages/sdk/src/service.ts +++ b/packages/sdk/src/service.ts @@ -10,9 +10,10 @@ import { ProcessorServiceImplementation, ProcessResult, StartRequest, -} from './gen' +} from '@sentio/protos' + +import { Empty } from '@sentio/protos/lib/google/protobuf/empty' -import { Empty } from './gen/google/protobuf/empty' import Long from 'long' import { MetricState } from './core/meter' import { ExporterState } from './core/exporter' @@ -22,7 +23,7 @@ import { ProcessorTemplateProcessorState, TemplateInstanceState } from './core/b // (Long.prototype as any).toBigInt = function() { // return BigInt(this.toString()) // }; -import { PluginManager } from './plugin' +import { PluginManager } from '@sentio/base' ;(BigInt.prototype as any).toJSON = function () { return this.toString() } diff --git a/packages/sdk/src/state/processor-state.ts b/packages/sdk/src/state/processor-state.ts deleted file mode 100644 index 688967d56..000000000 --- a/packages/sdk/src/state/processor-state.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class ProcessorState { - stateMap = new Map() -} diff --git a/packages/sdk/src/testing/metric-utils.ts b/packages/sdk/src/testing/metric-utils.ts index 62f16a417..5a471b88c 100644 --- a/packages/sdk/src/testing/metric-utils.ts +++ b/packages/sdk/src/testing/metric-utils.ts @@ -1,4 +1,4 @@ -import { MetricValue, ProcessResult } from '../gen' +import { MetricValue, ProcessResult } from '@sentio/protos' import { Numberish, BigDecimal } from '../core' import { BigNumber } from 'ethers' diff --git a/packages/sdk/src/testing/test-processor-server.ts b/packages/sdk/src/testing/test-processor-server.ts index 2d75cac30..1404340d0 100644 --- a/packages/sdk/src/testing/test-processor-server.ts +++ b/packages/sdk/src/testing/test-processor-server.ts @@ -10,16 +10,16 @@ import { ProcessConfigResponse, ProcessorServiceImplementation, StartRequest, -} from '../gen' +} from '@sentio/protos' import { CallContext } from 'nice-grpc-common' -import { Empty } from '../gen/google/protobuf/empty' +import { Empty } from '@sentio/protos/lib/google/protobuf/empty' import { ChainConfig } from '../chain-config' import { CHAIN_MAP } from '../utils/chain' import { Block, Log } from '@ethersproject/abstract-provider' import Long from 'long' import { getNetwork, Networkish } from '@ethersproject/providers' import { Endpoints } from '../endpoints' -import { ProcessorState } from '../state/processor-state' +import { State } from '@sentio/base' import { ProcessorServiceImpl } from '../service' import { Trace } from '../core/trace' import { setProvider } from '../provider' @@ -27,7 +27,7 @@ import { setProvider } from '../provider' export const TEST_CONTEXT: CallContext = {} export function cleanTest() { - global.PROCESSOR_STATE = new ProcessorState() + State.reset() if (!global.ENDPOINTS) { global.ENDPOINTS = new Endpoints() } @@ -323,12 +323,3 @@ export class TestProcessorServer implements ProcessorServiceImplementation { return this.service.processBindingsStream(request, context) } } - -function toBytes(obj: any): Uint8Array { - const logJsonStr = JSON.stringify(obj) - const raw = new Uint8Array(logJsonStr.length) - for (let i = 0; i < logJsonStr.length; i++) { - raw[i] = logJsonStr.charCodeAt(i) - } - return raw -} diff --git a/packages/sdk/src/tests/aptos.test.ts b/packages/sdk/src/tests/aptos.test.ts index eea77933a..6365bc0ae 100644 --- a/packages/sdk/src/tests/aptos.test.ts +++ b/packages/sdk/src/tests/aptos.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { HandlerType, ProcessBindingsRequest } from '../gen' +import { HandlerType, ProcessBindingsRequest } from '@sentio/protos' import { firstCounterValue, firstGaugeValue, TestProcessorServer } from '../testing' import Long from 'long' diff --git a/packages/sdk/src/tests/erc20-template.test.ts b/packages/sdk/src/tests/erc20-template.test.ts index 0b37e192b..88aae43b0 100644 --- a/packages/sdk/src/tests/erc20-template.test.ts +++ b/packages/sdk/src/tests/erc20-template.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai' -import { StartRequest } from '../gen' +import { StartRequest } from '@sentio/protos' import Long from 'long' import { TestProcessorServer } from '../testing' import { ERC20Processor, ERC20ProcessorTemplate } from '../builtin/internal/erc20_processor' diff --git a/packages/sdk/src/tests/erc20.test.ts b/packages/sdk/src/tests/erc20.test.ts index d844f64d0..1c85f6720 100644 --- a/packages/sdk/src/tests/erc20.test.ts +++ b/packages/sdk/src/tests/erc20.test.ts @@ -5,7 +5,7 @@ import { expect } from 'chai' import { TestProcessorServer, firstCounterValue, firstGaugeValue } from '../testing' import { BigNumber } from 'ethers' import { mockTransferLog } from '../builtin/erc20/test-utils' -import { HandlerType } from '../gen' +import { HandlerType } from '@sentio/protos' import { TemplateInstanceState } from '../core/base-processor-template' describe('Test Basic Examples', () => { diff --git a/packages/sdk/src/types/global.d.ts b/packages/sdk/src/types/global.d.ts index 85bc1a025..f8bb542b8 100644 --- a/packages/sdk/src/types/global.d.ts +++ b/packages/sdk/src/types/global.d.ts @@ -1,8 +1,8 @@ -import { ProcessorState } from '../state/processor-state' +// import { State } from '../../../base/src/state' import { Endpoints } from "../endpoints"; declare global { - var PROCESSOR_STATE: ProcessorState + // var PROCESSOR_STATE: State var ENDPOINTS: Endpoints } diff --git a/packages/sdk/src/utils/conversion.ts b/packages/sdk/src/utils/conversion.ts index 0849d9dc3..1ba72f5d9 100644 --- a/packages/sdk/src/utils/conversion.ts +++ b/packages/sdk/src/utils/conversion.ts @@ -1,7 +1,7 @@ import { BigNumber } from 'ethers' import { BigDecimal } from '../core/big-decimal' import { Numberish } from '../core' -import { MetricValue } from '../gen' +import { MetricValue } from '@sentio/protos' export function toBigDecimal(n: BigNumber | bigint) { return new BigDecimal(n.toString()) diff --git a/packages/sdk/src/utils/dex-price.test.ts b/packages/sdk/src/utils/dex-price.test.ts index 61723b1de..3d41ecc19 100644 --- a/packages/sdk/src/utils/dex-price.test.ts +++ b/packages/sdk/src/utils/dex-price.test.ts @@ -1,12 +1,12 @@ import { EthereumDexPrice, GoerliDexPrice } from './dex-price' -import { ProcessorState } from '../state/processor-state' +import { State } from '@sentio/base' import { loadTestProvidersFromEnv } from '../testing/test-provider' import { expect } from 'chai' import { Endpoints } from '../endpoints' describe('dex price tests', () => { - global.PROCESSOR_STATE = new ProcessorState() + State.reset() global.ENDPOINTS = new Endpoints() const haveProviders = loadTestProvidersFromEnv(['1', '5']) diff --git a/packages/sdk/src/utils/erc20.test.ts b/packages/sdk/src/utils/erc20.test.ts index a205ad8af..8b8941976 100644 --- a/packages/sdk/src/utils/erc20.test.ts +++ b/packages/sdk/src/utils/erc20.test.ts @@ -1,10 +1,10 @@ -import { ProcessorState } from '../state/processor-state' +import { State } from '@sentio/base' import { getERC20TokenInfo } from './token' import { loadTestProvidersFromEnv } from '../testing/test-provider' import { Endpoints } from '../endpoints' describe('erc20 tests', () => { - global.PROCESSOR_STATE = new ProcessorState() + State.reset() global.ENDPOINTS = new Endpoints() const haveProviders = loadTestProvidersFromEnv('1') diff --git a/packages/sdk/src/utils/price.ts b/packages/sdk/src/utils/price.ts index ba8270ce4..efeba4b53 100644 --- a/packages/sdk/src/utils/price.ts +++ b/packages/sdk/src/utils/price.ts @@ -1,4 +1,4 @@ -import { PriceServiceClient, PriceServiceDefinition } from '../gen/service/price/protos/price' +import { PriceServiceClient, PriceServiceDefinition } from '@sentio/protos/lib/service/price/protos/price' import { createChannel, createClientFactory } from 'nice-grpc' import { retryMiddleware, RetryOptions } from 'nice-grpc-client-middleware-retry'