From ab676d23e1781aa17b5f2c61cb7dec643443bded Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 3 Apr 2024 22:45:13 -0700 Subject: [PATCH] feat(connector-besu): add gRPC support for operations 1. The Besu connector now can be reached via the gRPC interface. 2. The same operations are exposed as via HTTP+SocketIO 3. gRPC supports bi-directional streaming so the block watching is also supported and test coverage verifies that it works. 4. To see an example of how to use the gRPC client of the Besu connector read the source code of the test case that provides the verification that the functionality works: ``` packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/ integration/grpc-services/connector-besu-grpc-services.test.ts ``` Depends on #3173 Signed-off-by: Peter Somogyvari --- .../package.json | 15 +- .../src/main/json/openapi.json | 9 + .../templates/protobuf-schema/api.mustache | 46 + .../templates/protobuf-schema/model.mustache | 41 + .../templates/protobuf-schema/root.mustache | 22 + .../openapi/.openapi-generator/FILES | 44 + .../openapi/.openapi-generator/VERSION | 1 + .../main/proto/generated/openapi/README.md | 31 + .../besu_private_transaction_config_pb.proto | 24 + .../models/besu_transaction_config_pb.proto | 38 + .../besu_transaction_config_to_pb.proto | 20 + .../models/consistency_strategy_pb.proto | 29 + ...ract_solidity_bytecode_v1_request_pb.proto | 47 + ...act_solidity_bytecode_v1_response_pb.proto | 23 + .../eth_contract_invocation_type_pb.proto | 21 + .../openapi/models/evm_block_pb.proto | 56 + .../generated/openapi/models/evm_log_pb.proto | 36 + .../openapi/models/evm_transaction_pb.proto | 42 + .../models/get_balance_v1_request_pb.proto | 24 + .../models/get_balance_v1_response_pb.proto | 22 + .../get_besu_record_v1_request_pb.proto | 25 + .../get_besu_record_v1_response_pb.proto | 28 + .../models/get_block_v1_request_pb.proto | 22 + .../models/get_block_v1_response_pb.proto | 23 + .../models/get_past_logs_v1_request_pb.proto | 28 + .../models/get_past_logs_v1_response_pb.proto | 23 + .../get_transaction_v1_request_pb.proto | 22 + .../get_transaction_v1_response_pb.proto | 23 + .../invoke_contract_v1_request_pb.proto | 58 ++ .../invoke_contract_v1_response_pb.proto | 27 + .../openapi/models/receipt_type_pb.proto | 21 + .../models/run_transaction_request_pb.proto | 32 + .../models/run_transaction_response_pb.proto | 23 + .../models/sign_transaction_request_pb.proto | 27 + .../models/sign_transaction_response_pb.proto | 23 + ...y_contract_json_artifact_compiler_pb.proto | 24 + ...n_artifact_gas_estimates_creation_pb.proto | 26 + ...tract_json_artifact_gas_estimates_pb.proto | 25 + .../solidity_contract_json_artifact_pb.proto | 42 + .../openapi/models/watch_blocks_v1_pb.proto | 24 + .../models/watch_blocks_v1_progress_pb.proto | 23 + .../models/watch_blocks_v1_request_pb.proto | 23 + .../openapi/models/web3_block_header_pb.proto | 49 + .../web3_block_header_timestamp_pb.proto | 20 + ...ng_credential_cactus_keychain_ref_pb.proto | 32 + .../web3_signing_credential_none_pb.proto | 23 + .../models/web3_signing_credential_pb.proto | 38 + ...igning_credential_private_key_hex_pb.proto | 29 + .../web3_signing_credential_type_pb.proto | 23 + .../models/web3_transaction_receipt_pb.proto | 38 + .../openapi/services/default_service.proto | 112 ++ .../services/besu-grpc-svc-streams.proto | 10 + .../generated/openapi/typescript-axios/api.ts | 15 + .../protoc-gen-ts/google/protobuf/any.ts | 98 ++ .../protoc-gen-ts/google/protobuf/empty.ts | 48 + .../besu_private_transaction_config_pb.ts | 99 ++ .../models/besu_transaction_config_pb.ts | 257 +++++ .../models/besu_transaction_config_to_pb.ts | 49 + .../models/consistency_strategy_pb.ts | 123 +++ ...ontract_solidity_bytecode_v1_request_pb.ts | 291 ++++++ ...ntract_solidity_bytecode_v1_response_pb.ts | 80 ++ .../models/eth_contract_invocation_type_pb.ts | 13 + .../protoc-gen-ts/models/evm_block_pb.ts | 480 +++++++++ .../proto/protoc-gen-ts/models/evm_log_pb.ts | 237 +++++ .../models/evm_transaction_pb.ts | 358 +++++++ .../models/get_balance_v1_request_pb.ts | 112 ++ .../models/get_balance_v1_response_pb.ts | 76 ++ .../models/get_besu_record_v1_request_pb.ts | 103 ++ .../models/get_besu_record_v1_response_pb.ts | 171 ++++ .../models/get_block_v1_request_pb.ts | 88 ++ .../models/get_block_v1_response_pb.ts | 80 ++ .../models/get_past_logs_v1_request_pb.ts | 184 ++++ .../models/get_past_logs_v1_response_pb.ts | 77 ++ .../models/get_transaction_v1_request_pb.ts | 76 ++ .../models/get_transaction_v1_response_pb.ts | 80 ++ .../models/invoke_contract_v1_request_pb.ts | 394 +++++++ .../models/invoke_contract_v1_response_pb.ts | 139 +++ .../protoc-gen-ts/models/receipt_type_pb.ts | 13 + .../models/run_transaction_request_pb.ts | 161 +++ .../models/run_transaction_response_pb.ts | 80 ++ .../models/sign_transaction_request_pb.ts | 122 +++ .../models/sign_transaction_response_pb.ts | 76 ++ .../models/watch_blocks_v1_pb.ts | 16 + .../models/watch_blocks_v1_progress_pb.ts | 80 ++ .../models/watch_blocks_v1_request_pb.ts | 77 ++ .../models/web3_block_header_pb.ts | 379 +++++++ .../models/web3_block_header_timestamp_pb.ts | 49 + ...gning_credential_cactus_keychain_ref_pb.ts | 146 +++ .../models/web3_signing_credential_none_pb.ts | 77 ++ .../models/web3_signing_credential_pb.ts | 172 ++++ ...3_signing_credential_private_key_hex_pb.ts | 123 +++ .../models/web3_signing_credential_type_pb.ts | 15 + .../models/web3_transaction_receipt_pb.ts | 273 +++++ .../services/besu-grpc-svc-streams.ts | 57 ++ .../protoc-gen-ts/services/default_service.ts | 969 ++++++++++++++++++ .../grpc-services/besu-grpc-svc-open-api.ts | 226 ++++ .../grpc-services/besu-grpc-svc-streams.ts | 94 ++ .../common/grpc-credentials-factory.ts | 91 ++ .../common/grpc-server-factory.ts | 21 + .../impl/get-block-v1/get-block-v1-grpc.ts | 46 + .../impl/get-block-v1/get-block-v1-http.ts | 15 + .../impl/get-block-v1/get-block-v1-impl.ts | 39 + .../plugin-ledger-connector-besu.ts | 65 +- .../src/main/typescript/public-api.ts | 71 ++ .../package.json | 1 + .../connector-besu-grpc-services.test.ts | 278 +++++ yarn.lock | 9 + 107 files changed, 9119 insertions(+), 7 deletions(-) create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/api.mustache create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/model.mustache create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/root.mustache create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/README.md create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_private_transaction_config_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_to_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/consistency_strategy_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/eth_contract_invocation_type_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_block_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_log_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_transaction_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/receipt_type_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_response_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_compiler_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_creation_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_progress_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_request_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_timestamp_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_cactus_keychain_ref_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_none_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_private_key_hex_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_type_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_transaction_receipt_pb.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/proto/services/besu-grpc-svc-streams.proto create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/any.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/empty.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_private_transaction_config_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_to_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/consistency_strategy_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/eth_contract_invocation_type_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_block_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_log_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_transaction_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/receipt_type_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_response_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_progress_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_request_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_timestamp_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_cactus_keychain_ref_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_none_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_private_key_hex_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_type_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_transaction_receipt_pb.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/besu-grpc-svc-streams.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-streams.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-credentials-factory.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-server-factory.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-grpc.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-http.ts create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-impl.ts create mode 100644 packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/grpc-services/connector-besu-grpc-services.test.ts diff --git a/packages/cactus-plugin-ledger-connector-besu/package.json b/packages/cactus-plugin-ledger-connector-besu/package.json index 94d8d5b16e..fe4c3e156e 100644 --- a/packages/cactus-plugin-ledger-connector-besu/package.json +++ b/packages/cactus-plugin-ledger-connector-besu/package.json @@ -44,10 +44,13 @@ ], "scripts": { "benchmark": "tsx ./src/test/typescript/benchmark/run-plugin-ledger-connector-besu-benchmark.ts .tmp/benchmark-results/plugin-ledger-connector-besu/run-plugin-ledger-connector-besu-benchmark.ts.log", - "codegen": "run-p 'codegen:*'", + "codegen": "run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", - "generate-sdk": "run-p 'generate-sdk:*'", + "codegen:proto": "run-s proto:openapi proto:protoc-gen-ts", + "generate-sdk": "run-s 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "proto:openapi": "yarn run --top-level openapi-generator-cli generate -i ./src/main/json/openapi.json -g protobuf-schema --model-name-suffix=PB --language-specific-primitives=google.protobuf.Any --type-mappings=AnyType=google.protobuf.Any --type-mappings=object=google.protobuf.Any --additional-properties=packageName=org.hyperledger.cacti.plugin.ledger.connector.besu -o ./src/main/proto/generated/openapi/ -t=./src/main/mustache/openapi-generator/templates/protobuf-schema/ --ignore-file-override ../../openapi-generator-ignore", + "proto:protoc-gen-ts": "yarn run --top-level grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./src/main/typescript/generated/proto/protoc-gen-ts/ --proto_path ./src/main/proto/generated/openapi/ --proto_path ./src/main/proto/generated/openapi/models/ --proto_path ./src/main/proto/ ./src/main/proto/generated/openapi/services/*.proto ./src/main/proto/services/*.proto", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", @@ -55,12 +58,15 @@ "webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js" }, "dependencies": { + "@grpc/grpc-js": "1.10.3", "@hyperledger/cactus-common": "2.0.0-alpha.2", "@hyperledger/cactus-core": "2.0.0-alpha.2", "@hyperledger/cactus-core-api": "2.0.0-alpha.2", "axios": "1.6.0", "express": "4.19.2", + "google-protobuf": "3.21.2", "http-errors": "2.0.0", + "http-errors-enhanced-cjs": "2.0.1", "joi": "17.9.1", "openapi-types": "12.1.3", "prom-client": "13.2.0", @@ -78,16 +84,21 @@ "devDependencies": { "@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.2", "@hyperledger/cactus-test-tooling": "2.0.0-alpha.2", + "@openapitools/openapi-generator-cli": "2.7.0", "@types/benchmark": "2.1.5", "@types/body-parser": "1.19.4", "@types/express": "4.17.21", "@types/fs-extra": "9.0.13", + "@types/google-protobuf": "3.15.5", "@types/http-errors": "2.0.4", "@types/uuid": "9.0.8", "benchmark": "2.1.4", "body-parser": "1.20.2", "fs-extra": "10.1.0", + "grpc-tools": "1.12.4", + "grpc_tools_node_protoc_ts": "5.3.3", "key-encoder": "2.0.3", + "npm-run-all2": "6.1.2", "protobufjs": "7.2.5", "socket.io": "4.5.4", "tsx": "4.7.0", diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json b/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json index 73f3a57fcc..be809bc208 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json @@ -240,6 +240,15 @@ "Complete" ] }, + "WatchBlocksV1Request": { + "type": "object", + "required": ["event"], + "properties": { + "event": { + "$ref": "#/components/schemas/WatchBlocksV1" + } + } + }, "Web3BlockHeader": { "type": "object", "required": [ diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/api.mustache b/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/api.mustache new file mode 100644 index 0000000000..b728d9e71f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/api.mustache @@ -0,0 +1,46 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{#lambda.lowercase}}{{{packageName}}}.{{{apiPackage}}}.{{{classname}}};{{/lambda.lowercase}} + +import "google/protobuf/empty.proto"; +{{#imports}} +{{#import}} +import "{{{modelPackage}}}/{{{.}}}.proto"; +{{/import}} +{{/imports}} + +service {{classname}} { +{{#operations}} +{{#operation}} + {{#description}} + // {{{.}}} + {{/description}} + rpc {{operationId}} ({{#hasParams}}{{operationId}}Request{{/hasParams}}{{^hasParams}}google.protobuf.Empty{{/hasParams}}) returns ({{#vendorExtensions.x-grpc-response}}{{.}}{{/vendorExtensions.x-grpc-response}}{{^vendorExtensions.x-grpc-response}}{{operationId}}Response{{/vendorExtensions.x-grpc-response}}); + +{{/operation}} +{{/operations}} +} + +{{#operations}} +{{#operation}} +{{#hasParams}} +message {{operationId}}Request { + {{#allParams}} + {{#description}} + // {{{.}}} + {{/description}} + {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{paramName}} = {{vendorExtensions.x-protobuf-index}}; + {{/allParams}} + +} + +{{/hasParams}} +{{^vendorExtensions.x-grpc-response}} +message {{operationId}}Response { + {{{vendorExtensions.x-grpc-response-type}}} data = 1; +} + +{{/vendorExtensions.x-grpc-response}} +{{/operation}} +{{/operations}} \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/model.mustache b/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/model.mustache new file mode 100644 index 0000000000..a350fd9e14 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/model.mustache @@ -0,0 +1,41 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{#lambda.lowercase}}{{{packageName}}};{{/lambda.lowercase}} + +import "google/protobuf/any.proto"; + +{{#imports}} +{{#import}} +import "{{{modelPackage}}}/{{{import}}}.proto"; +{{/import}} +{{/imports}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}message {{classname}} { + + {{#vars}} + {{#description}} + // {{{.}}} + {{/description}} + {{^isEnum}} + {{#vendorExtensions.x-protobuf-type}}{{{.}}} {{/vendorExtensions.x-protobuf-type}}{{{vendorExtensions.x-protobuf-data-type}}} {{{name}}} = {{vendorExtensions.x-protobuf-index}}{{#vendorExtensions.x-protobuf-packed}} [packed=true]{{/vendorExtensions.x-protobuf-packed}}; + {{/isEnum}} + {{#isEnum}} + enum {{enumName}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{protobuf-enum-index}}}; + {{/enumVars}} + {{/allowableValues}} + } + + {{enumName}} {{name}} = {{vendorExtensions.x-protobuf-index}}; + {{/isEnum}} + + {{/vars}} +} +{{/isEnum}} +{{/model}} +{{/models}} \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/root.mustache b/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/root.mustache new file mode 100644 index 0000000000..e2df456144 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/mustache/openapi-generator/templates/protobuf-schema/root.mustache @@ -0,0 +1,22 @@ +{{>partial_header}} +syntax = "proto3"; + +package {{{packageName}}}; + +{{#vendorExtensions.x-grpc-options}} +option {{{.}}}; +{{/vendorExtensions.x-grpc-options}} + +// Models +{{#models}} +{{#model}} +import "{{modelPackage}}/{{classFilename}}.proto"; +{{/model}} +{{/models}} + +// APIs +{{#apiInfo}} +{{#apis}} +import "{{apiPackage}}/{{classFilename}}.proto"; +{{/apis}} +{{/apiInfo}} \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES new file mode 100644 index 0000000000..2683bce8e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/FILES @@ -0,0 +1,44 @@ +README.md +models/besu_private_transaction_config_pb.proto +models/besu_transaction_config_pb.proto +models/besu_transaction_config_to_pb.proto +models/consistency_strategy_pb.proto +models/deploy_contract_solidity_bytecode_v1_request_pb.proto +models/deploy_contract_solidity_bytecode_v1_response_pb.proto +models/eth_contract_invocation_type_pb.proto +models/evm_block_pb.proto +models/evm_log_pb.proto +models/evm_transaction_pb.proto +models/get_balance_v1_request_pb.proto +models/get_balance_v1_response_pb.proto +models/get_besu_record_v1_request_pb.proto +models/get_besu_record_v1_response_pb.proto +models/get_block_v1_request_pb.proto +models/get_block_v1_response_pb.proto +models/get_past_logs_v1_request_pb.proto +models/get_past_logs_v1_response_pb.proto +models/get_transaction_v1_request_pb.proto +models/get_transaction_v1_response_pb.proto +models/invoke_contract_v1_request_pb.proto +models/invoke_contract_v1_response_pb.proto +models/receipt_type_pb.proto +models/run_transaction_request_pb.proto +models/run_transaction_response_pb.proto +models/sign_transaction_request_pb.proto +models/sign_transaction_response_pb.proto +models/solidity_contract_json_artifact_compiler_pb.proto +models/solidity_contract_json_artifact_gas_estimates_creation_pb.proto +models/solidity_contract_json_artifact_gas_estimates_pb.proto +models/solidity_contract_json_artifact_pb.proto +models/watch_blocks_v1_pb.proto +models/watch_blocks_v1_progress_pb.proto +models/watch_blocks_v1_request_pb.proto +models/web3_block_header_pb.proto +models/web3_block_header_timestamp_pb.proto +models/web3_signing_credential_cactus_keychain_ref_pb.proto +models/web3_signing_credential_none_pb.proto +models/web3_signing_credential_pb.proto +models/web3_signing_credential_private_key_hex_pb.proto +models/web3_signing_credential_type_pb.proto +models/web3_transaction_receipt_pb.proto +services/default_service.proto diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/README.md b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/README.md new file mode 100644 index 0000000000..53170f943f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/README.md @@ -0,0 +1,31 @@ +# gPRC for org.hyperledger.cacti.plugin.ledger.connector.besu + +Can perform basic tasks on a Besu ledger + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: v2.0.0-alpha.2 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Go +``` +# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` +mkdir /var/tmp/go/org.hyperledger.cacti.plugin.ledger.connector.besu +protoc --go_out=/var/tmp/go/org.hyperledger.cacti.plugin.ledger.connector.besu services/* +protoc --go_out=/var/tmp/go/org.hyperledger.cacti.plugin.ledger.connector.besu models/* +``` + +### Ruby +``` +# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` +RUBY_OUTPUT_DIR="/var/tmp/ruby/org.hyperledger.cacti.plugin.ledger.connector.besu" +mkdir $RUBY_OUTPUT_DIR +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* +``` diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_private_transaction_config_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_private_transaction_config_pb.proto new file mode 100644 index 0000000000..44eb29a2e9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_private_transaction_config_pb.proto @@ -0,0 +1,24 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message BesuPrivateTransactionConfigPB { + + string privateFrom = 360593360; + + repeated google.protobuf.Any privateFor = 265462717; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_pb.proto new file mode 100644 index 0000000000..8a8f5300ed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_pb.proto @@ -0,0 +1,38 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/besu_transaction_config_to_pb.proto"; +import "models/web3_block_header_timestamp_pb.proto"; + +message BesuTransactionConfigPB { + + string rawTransaction = 185047449; + + Web3BlockHeaderTimestampPB from = 3151786; + + BesuTransactionConfigToPB to = 3707; + + Web3BlockHeaderTimestampPB value = 111972721; + + Web3BlockHeaderTimestampPB gas = 102105; + + Web3BlockHeaderTimestampPB gasPrice = 5271059; + + float nonce = 105002991; + + BesuTransactionConfigToPB data = 3076010; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_to_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_to_pb.proto new file mode 100644 index 0000000000..c4828e6404 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/besu_transaction_config_to_pb.proto @@ -0,0 +1,20 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message BesuTransactionConfigToPB { + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/consistency_strategy_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/consistency_strategy_pb.proto new file mode 100644 index 0000000000..0b6bac7bfb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/consistency_strategy_pb.proto @@ -0,0 +1,29 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/receipt_type_pb.proto"; + +message ConsistencyStrategyPB { + + ReceiptTypePB receiptType = 423008661; + + // The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + int32 timeoutMs = 51479271; + + // The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + int32 blockConfirmations = 207555762; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_request_pb.proto new file mode 100644 index 0000000000..e104fe980e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_request_pb.proto @@ -0,0 +1,47 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/besu_private_transaction_config_pb.proto"; +import "models/web3_signing_credential_pb.proto"; + +message DeployContractSolidityBytecodeV1RequestPB { + + // The contract name for retrieve the contracts json on the keychain. + string contractName = 328784197; + + // The application binary interface of the solidity contract + repeated google.protobuf.Any contractAbi = 512852493; + + repeated google.protobuf.Any constructorArgs = 336490508; + + Web3SigningCredentialPB web3SigningCredential = 451211679; + + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + string bytecode = 256554254; + + // The keychainId for retrieve the contracts json. + string keychainId = 14058372; + + float gas = 102105; + + string gasPrice = 5271059; + + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + float timeoutMs = 51479271; + + BesuPrivateTransactionConfigPB privateTransactionConfig = 276796542; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_response_pb.proto new file mode 100644 index 0000000000..8ba746d5f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/deploy_contract_solidity_bytecode_v1_response_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_transaction_receipt_pb.proto"; + +message DeployContractSolidityBytecodeV1ResponsePB { + + Web3TransactionReceiptPB transactionReceipt = 472834426; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/eth_contract_invocation_type_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/eth_contract_invocation_type_pb.proto new file mode 100644 index 0000000000..4f4667dc6f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/eth_contract_invocation_type_pb.proto @@ -0,0 +1,21 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +enum EthContractInvocationTypePB { + EthContractInvocationTypePB_SEND = 0; + EthContractInvocationTypePB_CALL = 1; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_block_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_block_pb.proto new file mode 100644 index 0000000000..15295fa8f7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_block_pb.proto @@ -0,0 +1,56 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message EvmBlockPB { + + float number = 497493176; + + string hash = 3195150; + + string parentHash = 245049128; + + string nonce = 105002991; + + string sha3Uncles = 373514458; + + string logsBloom = 399161966; + + string transactionsRoot = 526502871; + + string stateRoot = 475330288; + + string miner = 103900799; + + float difficulty = 218888126; + + float totalDifficulty = 413035041; + + string extraData = 253792294; + + float size = 3530753; + + float gasLimit = 9229217; + + float gasUsed = 190522826; + + optional google.protobuf.Any timestamp = 55126294; + + repeated google.protobuf.Any transactions = 343509336; + + repeated google.protobuf.Any uncles = 303842065; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_log_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_log_pb.proto new file mode 100644 index 0000000000..e6b952a4b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_log_pb.proto @@ -0,0 +1,36 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message EvmLogPB { + + string address = 73950222; + + string data = 3076010; + + string blockHash = 335211324; + + string transactionHash = 188901646; + + repeated string topics = 331163357; + + float logIndex = 382599153; + + float transactionIndex = 488538260; + + float blockNumber = 205598263; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_transaction_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_transaction_pb.proto new file mode 100644 index 0000000000..2f93aa42f9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/evm_transaction_pb.proto @@ -0,0 +1,42 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message EvmTransactionPB { + + string hash = 3195150; + + float nonce = 105002991; + + optional google.protobuf.Any blockHash = 335211324; + + optional google.protobuf.Any blockNumber = 205598263; + + optional google.protobuf.Any transactionIndex = 488538260; + + string from = 3151786; + + optional google.protobuf.Any to = 3707; + + string value = 111972721; + + string gasPrice = 5271059; + + float gas = 102105; + + string input = 100358090; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_request_pb.proto new file mode 100644 index 0000000000..75f8b06ebd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_request_pb.proto @@ -0,0 +1,24 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message GetBalanceV1RequestPB { + + string address = 73950222; + + optional google.protobuf.Any defaultBlock = 140394805; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_response_pb.proto new file mode 100644 index 0000000000..0904eba1e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_balance_v1_response_pb.proto @@ -0,0 +1,22 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message GetBalanceV1ResponsePB { + + string balance = 339185956; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_request_pb.proto new file mode 100644 index 0000000000..467415c523 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_request_pb.proto @@ -0,0 +1,25 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/invoke_contract_v1_request_pb.proto"; + +message GetBesuRecordV1RequestPB { + + InvokeContractV1RequestPB invokeCall = 359347961; + + string transactionHash = 188901646; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_response_pb.proto new file mode 100644 index 0000000000..d369b4edb6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_besu_record_v1_response_pb.proto @@ -0,0 +1,28 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message GetBesuRecordV1ResponsePB { + + string ledgerId = 39059559; + + string stateContract = 509155523; + + optional google.protobuf.Any transactionInputData = 134507862; + + optional google.protobuf.Any callOutput = 401260801; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_request_pb.proto new file mode 100644 index 0000000000..1ec11e8d0c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_request_pb.proto @@ -0,0 +1,22 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message GetBlockV1RequestPB { + + optional google.protobuf.Any blockHashOrBlockNumber = 273815337; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_response_pb.proto new file mode 100644 index 0000000000..8e98fb8b7a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_block_v1_response_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/evm_block_pb.proto"; + +message GetBlockV1ResponsePB { + + EvmBlockPB block = 93832333; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_request_pb.proto new file mode 100644 index 0000000000..ac674671cd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_request_pb.proto @@ -0,0 +1,28 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message GetPastLogsV1RequestPB { + + optional google.protobuf.Any toBlock = 107898160; + + optional google.protobuf.Any fromBlock = 53671683; + + optional google.protobuf.Any address = 73950222; + + repeated google.protobuf.Any topics = 331163357; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_response_pb.proto new file mode 100644 index 0000000000..a0d9af8371 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_past_logs_v1_response_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/evm_log_pb.proto"; + +message GetPastLogsV1ResponsePB { + + repeated EvmLogPB logs = 3327407; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_request_pb.proto new file mode 100644 index 0000000000..3b19cf55fc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_request_pb.proto @@ -0,0 +1,22 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message GetTransactionV1RequestPB { + + string transactionHash = 188901646; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_response_pb.proto new file mode 100644 index 0000000000..59b3c4a144 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/get_transaction_v1_response_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/evm_transaction_pb.proto"; + +message GetTransactionV1ResponsePB { + + EvmTransactionPB transaction = 530633441; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_request_pb.proto new file mode 100644 index 0000000000..9e0804a2e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_request_pb.proto @@ -0,0 +1,58 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/besu_private_transaction_config_pb.proto"; +import "models/eth_contract_invocation_type_pb.proto"; +import "models/web3_block_header_timestamp_pb.proto"; +import "models/web3_signing_credential_pb.proto"; + +message InvokeContractV1RequestPB { + + string contractName = 328784197; + + Web3SigningCredentialPB signingCredential = 233015102; + + EthContractInvocationTypePB invocationType = 163296237; + + // The name of the contract method to invoke. + string methodName = 186292469; + + // The list of arguments to pass in to the contract method being invoked. + repeated google.protobuf.Any params = 458557051; + + // The application binary interface of the solidity contract, optional parameter + repeated google.protobuf.Any contractAbi = 512852493; + + // Address of the solidity contract, optional parameter + string contractAddress = 214641282; + + Web3BlockHeaderTimestampPB value = 111972721; + + Web3BlockHeaderTimestampPB gas = 102105; + + Web3BlockHeaderTimestampPB gasPrice = 5271059; + + float nonce = 105002991; + + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + float timeoutMs = 51479271; + + // The keychainId for retrieve the contracts json. + string keychainId = 14058372; + + BesuPrivateTransactionConfigPB privateTransactionConfig = 276796542; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_response_pb.proto new file mode 100644 index 0000000000..c5534c3581 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/invoke_contract_v1_response_pb.proto @@ -0,0 +1,27 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_transaction_receipt_pb.proto"; + +message InvokeContractV1ResponsePB { + + Web3TransactionReceiptPB transactionReceipt = 472834426; + + optional google.protobuf.Any callOutput = 401260801; + + bool success = 256557056; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/receipt_type_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/receipt_type_pb.proto new file mode 100644 index 0000000000..2aa6a0d866 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/receipt_type_pb.proto @@ -0,0 +1,21 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +enum ReceiptTypePB { + ReceiptTypePB_NODE_TX_POOL_ACK = 0; + ReceiptTypePB_LEDGER_BLOCK_ACK = 1; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_request_pb.proto new file mode 100644 index 0000000000..fe6d7ad23a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_request_pb.proto @@ -0,0 +1,32 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/besu_private_transaction_config_pb.proto"; +import "models/besu_transaction_config_pb.proto"; +import "models/consistency_strategy_pb.proto"; +import "models/web3_signing_credential_pb.proto"; + +message RunTransactionRequestPB { + + Web3SigningCredentialPB web3SigningCredential = 451211679; + + BesuTransactionConfigPB transactionConfig = 478618563; + + ConsistencyStrategyPB consistencyStrategy = 86789548; + + BesuPrivateTransactionConfigPB privateTransactionConfig = 276796542; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_response_pb.proto new file mode 100644 index 0000000000..1861e23929 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/run_transaction_response_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_transaction_receipt_pb.proto"; + +message RunTransactionResponsePB { + + Web3TransactionReceiptPB transactionReceipt = 472834426; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_request_pb.proto new file mode 100644 index 0000000000..c636896590 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_request_pb.proto @@ -0,0 +1,27 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message SignTransactionRequestPB { + + string keychainId = 14058372; + + string keychainRef = 101070193; + + // The transaction hash of ledger will be used to fetch the contain. + string transactionHash = 188901646; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_response_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_response_pb.proto new file mode 100644 index 0000000000..d1cee702a0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/sign_transaction_response_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message SignTransactionResponsePB { + + // The signatures of ledger from the corresponding transaction hash. + string signature = 536713401; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_compiler_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_compiler_pb.proto new file mode 100644 index 0000000000..3c83eb065e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_compiler_pb.proto @@ -0,0 +1,24 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message SolidityContractJsonArtifactCompilerPB { + + string name = 3373707; + + string version = 351608024; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_creation_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_creation_pb.proto new file mode 100644 index 0000000000..69d170d21e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_creation_pb.proto @@ -0,0 +1,26 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message SolidityContractJsonArtifactGasEstimatesCreationPB { + + string codeDepositCost = 380743519; + + string executionCost = 384688902; + + string totalCost = 40911568; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_pb.proto new file mode 100644 index 0000000000..99f13dd1d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_gas_estimates_pb.proto @@ -0,0 +1,25 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/solidity_contract_json_artifact_gas_estimates_creation_pb.proto"; + +message SolidityContractJsonArtifactGasEstimatesPB { + + SolidityContractJsonArtifactGasEstimatesCreationPB creation = 209809122; + + map external = 210148408; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_pb.proto new file mode 100644 index 0000000000..25d252e91c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/solidity_contract_json_artifact_pb.proto @@ -0,0 +1,42 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/solidity_contract_json_artifact_compiler_pb.proto"; +import "models/solidity_contract_json_artifact_gas_estimates_pb.proto"; + +message SolidityContractJsonArtifactPB { + + string contractName = 328784197; + + string metadata = 450004177; + + string bytecode = 256554254; + + string deployedBytecode = 146904872; + + string sourceMap = 87815362; + + string deployedSourceMap = 90090014; + + string sourcePath = 37831970; + + SolidityContractJsonArtifactCompilerPB compiler = 62657378; + + map functionHashes = 363274190; + + SolidityContractJsonArtifactGasEstimatesPB gasEstimates = 228215441; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_pb.proto new file mode 100644 index 0000000000..45a1e3f7e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_pb.proto @@ -0,0 +1,24 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +enum WatchBlocksV1PB { + WatchBlocksV1PB_Subscribe = 0; + WatchBlocksV1PB_Next = 1; + WatchBlocksV1PB_Unsubscribe = 2; + WatchBlocksV1PB_Error = 3; + WatchBlocksV1PB_Complete = 4; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_progress_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_progress_pb.proto new file mode 100644 index 0000000000..ff0fa08649 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_progress_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_block_header_pb.proto"; + +message WatchBlocksV1ProgressPB { + + Web3BlockHeaderPB blockHeader = 18691451; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_request_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_request_pb.proto new file mode 100644 index 0000000000..60a9950d70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/watch_blocks_v1_request_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/watch_blocks_v1_pb.proto"; + +message WatchBlocksV1RequestPB { + + WatchBlocksV1PB event = 96891546; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_pb.proto new file mode 100644 index 0000000000..b66910f5af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_pb.proto @@ -0,0 +1,49 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_block_header_timestamp_pb.proto"; + +message Web3BlockHeaderPB { + + float number = 497493176; + + string hash = 3195150; + + string parentHash = 245049128; + + string nonce = 105002991; + + string sha3Uncles = 373514458; + + string logsBloom = 399161966; + + string transactionRoot = 189212898; + + string stateRoot = 475330288; + + string receiptRoot = 422939453; + + string miner = 103900799; + + string extraData = 253792294; + + int32 gasLimit = 9229217; + + int32 gasUsed = 190522826; + + Web3BlockHeaderTimestampPB timestamp = 55126294; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_timestamp_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_timestamp_pb.proto new file mode 100644 index 0000000000..b7006fb2e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_block_header_timestamp_pb.proto @@ -0,0 +1,20 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message Web3BlockHeaderTimestampPB { + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_cactus_keychain_ref_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_cactus_keychain_ref_pb.proto new file mode 100644 index 0000000000..19b28cb66c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_cactus_keychain_ref_pb.proto @@ -0,0 +1,32 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_signing_credential_type_pb.proto"; + +message Web3SigningCredentialCactusKeychainRefPB { + + Web3SigningCredentialTypePB type = 3575610; + + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + string ethAccount = 528332204; + + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + string keychainEntryKey = 210645395; + + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + string keychainId = 14058372; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_none_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_none_pb.proto new file mode 100644 index 0000000000..41ff03cc2e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_none_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_signing_credential_type_pb.proto"; + +message Web3SigningCredentialNonePB { + + Web3SigningCredentialTypePB type = 3575610; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_pb.proto new file mode 100644 index 0000000000..b4395ad9c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_pb.proto @@ -0,0 +1,38 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_signing_credential_cactus_keychain_ref_pb.proto"; +import "models/web3_signing_credential_none_pb.proto"; +import "models/web3_signing_credential_private_key_hex_pb.proto"; +import "models/web3_signing_credential_type_pb.proto"; + +message Web3SigningCredentialPB { + + Web3SigningCredentialTypePB type = 3575610; + + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + string ethAccount = 528332204; + + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + string keychainEntryKey = 210645395; + + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + string keychainId = 14058372; + + // The HEX encoded private key of an eth account. + string secret = 369406289; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_private_key_hex_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_private_key_hex_pb.proto new file mode 100644 index 0000000000..ae5b35341c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_private_key_hex_pb.proto @@ -0,0 +1,29 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + +import "models/web3_signing_credential_type_pb.proto"; + +message Web3SigningCredentialPrivateKeyHexPB { + + Web3SigningCredentialTypePB type = 3575610; + + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + string ethAccount = 528332204; + + // The HEX encoded private key of an eth account. + string secret = 369406289; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_type_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_type_pb.proto new file mode 100644 index 0000000000..5f77044eb9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_signing_credential_type_pb.proto @@ -0,0 +1,23 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +enum Web3SigningCredentialTypePB { + Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF = 0; + Web3SigningCredentialTypePB_GETH_KEYCHAIN_PASSWORD = 1; + Web3SigningCredentialTypePB_PRIVATE_KEY_HEX = 2; + Web3SigningCredentialTypePB_NONE = 3; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_transaction_receipt_pb.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_transaction_receipt_pb.proto new file mode 100644 index 0000000000..663480a9a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/models/web3_transaction_receipt_pb.proto @@ -0,0 +1,38 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu; + +import "google/protobuf/any.proto"; + + +message Web3TransactionReceiptPB { + + bool status = 355610639; + + string transactionHash = 188901646; + + float transactionIndex = 488538260; + + string blockHash = 335211324; + + float blockNumber = 205598263; + + float gasUsed = 190522826; + + optional string contractAddress = 214641282; + + string from = 3151786; + + string to = 3707; + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto new file mode 100644 index 0000000000..be9b35a6a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/generated/openapi/services/default_service.proto @@ -0,0 +1,112 @@ +/* + Hyperledger Cactus Plugin - Connector Besu + + Can perform basic tasks on a Besu ledger + + The version of the OpenAPI document: v2.0.0-alpha.2 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice; + +import "google/protobuf/empty.proto"; +import "models/deploy_contract_solidity_bytecode_v1_request_pb.proto"; +import "models/deploy_contract_solidity_bytecode_v1_response_pb.proto"; +import "models/get_balance_v1_request_pb.proto"; +import "models/get_balance_v1_response_pb.proto"; +import "models/get_besu_record_v1_request_pb.proto"; +import "models/get_besu_record_v1_response_pb.proto"; +import "models/get_block_v1_request_pb.proto"; +import "models/get_block_v1_response_pb.proto"; +import "models/get_past_logs_v1_request_pb.proto"; +import "models/get_past_logs_v1_response_pb.proto"; +import "models/get_transaction_v1_request_pb.proto"; +import "models/get_transaction_v1_response_pb.proto"; +import "models/invoke_contract_v1_request_pb.proto"; +import "models/invoke_contract_v1_response_pb.proto"; +import "models/run_transaction_request_pb.proto"; +import "models/run_transaction_response_pb.proto"; +import "models/sign_transaction_request_pb.proto"; +import "models/sign_transaction_response_pb.proto"; + +service DefaultService { + rpc DeployContractSolBytecodeV1 (DeployContractSolBytecodeV1Request) returns (DeployContractSolidityBytecodeV1ResponsePB); + + rpc GetBalanceV1 (GetBalanceV1Request) returns (GetBalanceV1ResponsePB); + + rpc GetBesuRecordV1 (GetBesuRecordV1Request) returns (GetBesuRecordV1ResponsePB); + + rpc GetBlockV1 (GetBlockV1Request) returns (GetBlockV1ResponsePB); + + rpc GetOpenApiSpecV1 (google.protobuf.Empty) returns (GetOpenApiSpecV1Response); + + rpc GetPastLogsV1 (GetPastLogsV1Request) returns (GetPastLogsV1ResponsePB); + + rpc GetPrometheusMetricsV1 (google.protobuf.Empty) returns (GetPrometheusMetricsV1Response); + + rpc GetTransactionV1 (GetTransactionV1Request) returns (GetTransactionV1ResponsePB); + + rpc InvokeContractV1 (InvokeContractV1Request) returns (InvokeContractV1ResponsePB); + + rpc RunTransactionV1 (RunTransactionV1Request) returns (RunTransactionResponsePB); + + rpc SignTransactionV1 (SignTransactionV1Request) returns (SignTransactionResponsePB); + +} + +message DeployContractSolBytecodeV1Request { + DeployContractSolidityBytecodeV1RequestPB deployContractSolidityBytecodeV1RequestPB = 1; + +} + +message GetBalanceV1Request { + GetBalanceV1RequestPB getBalanceV1RequestPB = 1; + +} + +message GetBesuRecordV1Request { + GetBesuRecordV1RequestPB getBesuRecordV1RequestPB = 1; + +} + +message GetBlockV1Request { + GetBlockV1RequestPB getBlockV1RequestPB = 1; + +} + +message GetOpenApiSpecV1Response { + string data = 1; +} + +message GetPastLogsV1Request { + GetPastLogsV1RequestPB getPastLogsV1RequestPB = 1; + +} + +message GetPrometheusMetricsV1Response { + string data = 1; +} + +message GetTransactionV1Request { + GetTransactionV1RequestPB getTransactionV1RequestPB = 1; + +} + +message InvokeContractV1Request { + InvokeContractV1RequestPB invokeContractV1RequestPB = 1; + +} + +message RunTransactionV1Request { + RunTransactionRequestPB runTransactionRequestPB = 1; + +} + +message SignTransactionV1Request { + SignTransactionRequestPB signTransactionRequestPB = 1; + +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/proto/services/besu-grpc-svc-streams.proto b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/services/besu-grpc-svc-streams.proto new file mode 100644 index 0000000000..f0b2f2df61 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/proto/services/besu-grpc-svc-streams.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package org.hyperledger.cacti.plugin.ledger.connector.besu.services.besuservice; + +import "models/watch_blocks_v1_progress_pb.proto"; +import "models/watch_blocks_v1_request_pb.proto"; + +service BesuGrpcSvcStreams { + rpc WatchBlocksV1(stream WatchBlocksV1RequestPB) returns (stream WatchBlocksV1ProgressPB) {}; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts index cc33fe0a58..e89c1fe5c0 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/openapi/typescript-axios/api.ts @@ -1023,6 +1023,21 @@ export interface WatchBlocksV1Progress { */ 'blockHeader': Web3BlockHeader; } +/** + * + * @export + * @interface WatchBlocksV1Request + */ +export interface WatchBlocksV1Request { + /** + * + * @type {WatchBlocksV1} + * @memberof WatchBlocksV1Request + */ + 'event': WatchBlocksV1; +} + + /** * * @export diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/any.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/any.ts new file mode 100644 index 0000000000..d3816d414f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/any.ts @@ -0,0 +1,98 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: google/protobuf/any.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as pb_1 from "google-protobuf"; +export namespace google.protobuf { + export class Any extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + type_url?: string; + value?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("type_url" in data && data.type_url != undefined) { + this.type_url = data.type_url; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + } + } + get type_url() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set type_url(value: string) { + pb_1.Message.setField(this, 1, value); + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 2, new Uint8Array(0)) as Uint8Array; + } + set value(value: Uint8Array) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + type_url?: string; + value?: Uint8Array; + }): Any { + const message = new Any({}); + if (data.type_url != null) { + message.type_url = data.type_url; + } + if (data.value != null) { + message.value = data.value; + } + return message; + } + toObject() { + const data: { + type_url?: string; + value?: Uint8Array; + } = {}; + if (this.type_url != null) { + data.type_url = this.type_url; + } + if (this.value != null) { + data.value = this.value; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.type_url.length) + writer.writeString(1, this.type_url); + if (this.value.length) + writer.writeBytes(2, this.value); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Any { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Any(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.type_url = reader.readString(); + break; + case 2: + message.value = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Any { + return Any.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/empty.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/empty.ts new file mode 100644 index 0000000000..7b5a551bf9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/google/protobuf/empty.ts @@ -0,0 +1,48 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: google/protobuf/empty.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as pb_1 from "google-protobuf"; +export namespace google.protobuf { + export class Empty extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}): Empty { + const message = new Empty({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Empty { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Empty(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Empty { + return Empty.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_private_transaction_config_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_private_transaction_config_pb.ts new file mode 100644 index 0000000000..e02638d4f2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_private_transaction_config_pb.ts @@ -0,0 +1,99 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/besu_private_transaction_config_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class BesuPrivateTransactionConfigPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + privateFrom?: string; + privateFor?: dependency_1.google.protobuf.Any[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [265462717], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("privateFrom" in data && data.privateFrom != undefined) { + this.privateFrom = data.privateFrom; + } + if ("privateFor" in data && data.privateFor != undefined) { + this.privateFor = data.privateFor; + } + } + } + get privateFrom() { + return pb_1.Message.getFieldWithDefault(this, 360593360, "") as string; + } + set privateFrom(value: string) { + pb_1.Message.setField(this, 360593360, value); + } + get privateFor() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 265462717) as dependency_1.google.protobuf.Any[]; + } + set privateFor(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 265462717, value); + } + static fromObject(data: { + privateFrom?: string; + privateFor?: ReturnType[]; + }): BesuPrivateTransactionConfigPB { + const message = new BesuPrivateTransactionConfigPB({}); + if (data.privateFrom != null) { + message.privateFrom = data.privateFrom; + } + if (data.privateFor != null) { + message.privateFor = data.privateFor.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + return message; + } + toObject() { + const data: { + privateFrom?: string; + privateFor?: ReturnType[]; + } = {}; + if (this.privateFrom != null) { + data.privateFrom = this.privateFrom; + } + if (this.privateFor != null) { + data.privateFor = this.privateFor.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.privateFrom.length) + writer.writeString(360593360, this.privateFrom); + if (this.privateFor.length) + writer.writeRepeatedMessage(265462717, this.privateFor, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BesuPrivateTransactionConfigPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BesuPrivateTransactionConfigPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 360593360: + message.privateFrom = reader.readString(); + break; + case 265462717: + reader.readMessage(message.privateFor, () => pb_1.Message.addToRepeatedWrapperField(message, 265462717, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BesuPrivateTransactionConfigPB { + return BesuPrivateTransactionConfigPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_pb.ts new file mode 100644 index 0000000000..03ecb7278e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_pb.ts @@ -0,0 +1,257 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/besu_transaction_config_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./besu_transaction_config_to_pb"; +import * as dependency_3 from "./web3_block_header_timestamp_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class BesuTransactionConfigPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + rawTransaction?: string; + from?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + to?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB; + value?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + gas?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + gasPrice?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + nonce?: number; + data?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("rawTransaction" in data && data.rawTransaction != undefined) { + this.rawTransaction = data.rawTransaction; + } + if ("from" in data && data.from != undefined) { + this.from = data.from; + } + if ("to" in data && data.to != undefined) { + this.to = data.to; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("gasPrice" in data && data.gasPrice != undefined) { + this.gasPrice = data.gasPrice; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + } + } + get rawTransaction() { + return pb_1.Message.getFieldWithDefault(this, 185047449, "") as string; + } + set rawTransaction(value: string) { + pb_1.Message.setField(this, 185047449, value); + } + get from() { + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 3151786) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set from(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 3151786, value); + } + get has_from() { + return pb_1.Message.getField(this, 3151786) != null; + } + get to() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB, 3707) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB; + } + set to(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB) { + pb_1.Message.setWrapperField(this, 3707, value); + } + get has_to() { + return pb_1.Message.getField(this, 3707) != null; + } + get value() { + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 111972721) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set value(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 111972721, value); + } + get has_value() { + return pb_1.Message.getField(this, 111972721) != null; + } + get gas() { + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 102105) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set gas(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 102105, value); + } + get has_gas() { + return pb_1.Message.getField(this, 102105) != null; + } + get gasPrice() { + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 5271059) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set gasPrice(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 5271059, value); + } + get has_gasPrice() { + return pb_1.Message.getField(this, 5271059) != null; + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 105002991, 0) as number; + } + set nonce(value: number) { + pb_1.Message.setField(this, 105002991, value); + } + get data() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB, 3076010) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB; + } + set data(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB) { + pb_1.Message.setWrapperField(this, 3076010, value); + } + get has_data() { + return pb_1.Message.getField(this, 3076010) != null; + } + static fromObject(data: { + rawTransaction?: string; + from?: ReturnType; + to?: ReturnType; + value?: ReturnType; + gas?: ReturnType; + gasPrice?: ReturnType; + nonce?: number; + data?: ReturnType; + }): BesuTransactionConfigPB { + const message = new BesuTransactionConfigPB({}); + if (data.rawTransaction != null) { + message.rawTransaction = data.rawTransaction; + } + if (data.from != null) { + message.from = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.from); + } + if (data.to != null) { + message.to = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB.fromObject(data.to); + } + if (data.value != null) { + message.value = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.value); + } + if (data.gas != null) { + message.gas = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.gas); + } + if (data.gasPrice != null) { + message.gasPrice = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.gasPrice); + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.data != null) { + message.data = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB.fromObject(data.data); + } + return message; + } + toObject() { + const data: { + rawTransaction?: string; + from?: ReturnType; + to?: ReturnType; + value?: ReturnType; + gas?: ReturnType; + gasPrice?: ReturnType; + nonce?: number; + data?: ReturnType; + } = {}; + if (this.rawTransaction != null) { + data.rawTransaction = this.rawTransaction; + } + if (this.from != null) { + data.from = this.from.toObject(); + } + if (this.to != null) { + data.to = this.to.toObject(); + } + if (this.value != null) { + data.value = this.value.toObject(); + } + if (this.gas != null) { + data.gas = this.gas.toObject(); + } + if (this.gasPrice != null) { + data.gasPrice = this.gasPrice.toObject(); + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.data != null) { + data.data = this.data.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.rawTransaction.length) + writer.writeString(185047449, this.rawTransaction); + if (this.has_from) + writer.writeMessage(3151786, this.from, () => this.from.serialize(writer)); + if (this.has_to) + writer.writeMessage(3707, this.to, () => this.to.serialize(writer)); + if (this.has_value) + writer.writeMessage(111972721, this.value, () => this.value.serialize(writer)); + if (this.has_gas) + writer.writeMessage(102105, this.gas, () => this.gas.serialize(writer)); + if (this.has_gasPrice) + writer.writeMessage(5271059, this.gasPrice, () => this.gasPrice.serialize(writer)); + if (this.nonce != 0) + writer.writeFloat(105002991, this.nonce); + if (this.has_data) + writer.writeMessage(3076010, this.data, () => this.data.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BesuTransactionConfigPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BesuTransactionConfigPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 185047449: + message.rawTransaction = reader.readString(); + break; + case 3151786: + reader.readMessage(message.from, () => message.from = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + case 3707: + reader.readMessage(message.to, () => message.to = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB.deserialize(reader)); + break; + case 111972721: + reader.readMessage(message.value, () => message.value = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + case 102105: + reader.readMessage(message.gas, () => message.gas = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + case 5271059: + reader.readMessage(message.gasPrice, () => message.gasPrice = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + case 105002991: + message.nonce = reader.readFloat(); + break; + case 3076010: + reader.readMessage(message.data, () => message.data = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigToPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BesuTransactionConfigPB { + return BesuTransactionConfigPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_to_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_to_pb.ts new file mode 100644 index 0000000000..4b286db032 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/besu_transaction_config_to_pb.ts @@ -0,0 +1,49 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/besu_transaction_config_to_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class BesuTransactionConfigToPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}): BesuTransactionConfigToPB { + const message = new BesuTransactionConfigToPB({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BesuTransactionConfigToPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BesuTransactionConfigToPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): BesuTransactionConfigToPB { + return BesuTransactionConfigToPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/consistency_strategy_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/consistency_strategy_pb.ts new file mode 100644 index 0000000000..b2aa6e3f76 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/consistency_strategy_pb.ts @@ -0,0 +1,123 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/consistency_strategy_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./receipt_type_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class ConsistencyStrategyPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + receiptType?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.ReceiptTypePB; + timeoutMs?: number; + blockConfirmations?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("receiptType" in data && data.receiptType != undefined) { + this.receiptType = data.receiptType; + } + if ("timeoutMs" in data && data.timeoutMs != undefined) { + this.timeoutMs = data.timeoutMs; + } + if ("blockConfirmations" in data && data.blockConfirmations != undefined) { + this.blockConfirmations = data.blockConfirmations; + } + } + } + get receiptType() { + return pb_1.Message.getFieldWithDefault(this, 423008661, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.ReceiptTypePB.ReceiptTypePB_NODE_TX_POOL_ACK) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.ReceiptTypePB; + } + set receiptType(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.ReceiptTypePB) { + pb_1.Message.setField(this, 423008661, value); + } + get timeoutMs() { + return pb_1.Message.getFieldWithDefault(this, 51479271, 0) as number; + } + set timeoutMs(value: number) { + pb_1.Message.setField(this, 51479271, value); + } + get blockConfirmations() { + return pb_1.Message.getFieldWithDefault(this, 207555762, 0) as number; + } + set blockConfirmations(value: number) { + pb_1.Message.setField(this, 207555762, value); + } + static fromObject(data: { + receiptType?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.ReceiptTypePB; + timeoutMs?: number; + blockConfirmations?: number; + }): ConsistencyStrategyPB { + const message = new ConsistencyStrategyPB({}); + if (data.receiptType != null) { + message.receiptType = data.receiptType; + } + if (data.timeoutMs != null) { + message.timeoutMs = data.timeoutMs; + } + if (data.blockConfirmations != null) { + message.blockConfirmations = data.blockConfirmations; + } + return message; + } + toObject() { + const data: { + receiptType?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.ReceiptTypePB; + timeoutMs?: number; + blockConfirmations?: number; + } = {}; + if (this.receiptType != null) { + data.receiptType = this.receiptType; + } + if (this.timeoutMs != null) { + data.timeoutMs = this.timeoutMs; + } + if (this.blockConfirmations != null) { + data.blockConfirmations = this.blockConfirmations; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.receiptType != dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.ReceiptTypePB.ReceiptTypePB_NODE_TX_POOL_ACK) + writer.writeEnum(423008661, this.receiptType); + if (this.timeoutMs != 0) + writer.writeInt32(51479271, this.timeoutMs); + if (this.blockConfirmations != 0) + writer.writeInt32(207555762, this.blockConfirmations); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ConsistencyStrategyPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ConsistencyStrategyPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 423008661: + message.receiptType = reader.readEnum(); + break; + case 51479271: + message.timeoutMs = reader.readInt32(); + break; + case 207555762: + message.blockConfirmations = reader.readInt32(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ConsistencyStrategyPB { + return ConsistencyStrategyPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_request_pb.ts new file mode 100644 index 0000000000..5c669c6e11 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_request_pb.ts @@ -0,0 +1,291 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/deploy_contract_solidity_bytecode_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./besu_private_transaction_config_pb"; +import * as dependency_3 from "./web3_signing_credential_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class DeployContractSolidityBytecodeV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + contractName?: string; + contractAbi?: dependency_1.google.protobuf.Any[]; + constructorArgs?: dependency_1.google.protobuf.Any[]; + web3SigningCredential?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; + bytecode?: string; + keychainId?: string; + gas?: number; + gasPrice?: string; + timeoutMs?: number; + privateTransactionConfig?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [512852493, 336490508], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("contractName" in data && data.contractName != undefined) { + this.contractName = data.contractName; + } + if ("contractAbi" in data && data.contractAbi != undefined) { + this.contractAbi = data.contractAbi; + } + if ("constructorArgs" in data && data.constructorArgs != undefined) { + this.constructorArgs = data.constructorArgs; + } + if ("web3SigningCredential" in data && data.web3SigningCredential != undefined) { + this.web3SigningCredential = data.web3SigningCredential; + } + if ("bytecode" in data && data.bytecode != undefined) { + this.bytecode = data.bytecode; + } + if ("keychainId" in data && data.keychainId != undefined) { + this.keychainId = data.keychainId; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("gasPrice" in data && data.gasPrice != undefined) { + this.gasPrice = data.gasPrice; + } + if ("timeoutMs" in data && data.timeoutMs != undefined) { + this.timeoutMs = data.timeoutMs; + } + if ("privateTransactionConfig" in data && data.privateTransactionConfig != undefined) { + this.privateTransactionConfig = data.privateTransactionConfig; + } + } + } + get contractName() { + return pb_1.Message.getFieldWithDefault(this, 328784197, "") as string; + } + set contractName(value: string) { + pb_1.Message.setField(this, 328784197, value); + } + get contractAbi() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 512852493) as dependency_1.google.protobuf.Any[]; + } + set contractAbi(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 512852493, value); + } + get constructorArgs() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 336490508) as dependency_1.google.protobuf.Any[]; + } + set constructorArgs(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 336490508, value); + } + get web3SigningCredential() { + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB, 451211679) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; + } + set web3SigningCredential(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB) { + pb_1.Message.setWrapperField(this, 451211679, value); + } + get has_web3SigningCredential() { + return pb_1.Message.getField(this, 451211679) != null; + } + get bytecode() { + return pb_1.Message.getFieldWithDefault(this, 256554254, "") as string; + } + set bytecode(value: string) { + pb_1.Message.setField(this, 256554254, value); + } + get keychainId() { + return pb_1.Message.getFieldWithDefault(this, 14058372, "") as string; + } + set keychainId(value: string) { + pb_1.Message.setField(this, 14058372, value); + } + get gas() { + return pb_1.Message.getFieldWithDefault(this, 102105, 0) as number; + } + set gas(value: number) { + pb_1.Message.setField(this, 102105, value); + } + get gasPrice() { + return pb_1.Message.getFieldWithDefault(this, 5271059, "") as string; + } + set gasPrice(value: string) { + pb_1.Message.setField(this, 5271059, value); + } + get timeoutMs() { + return pb_1.Message.getFieldWithDefault(this, 51479271, 0) as number; + } + set timeoutMs(value: number) { + pb_1.Message.setField(this, 51479271, value); + } + get privateTransactionConfig() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB, 276796542) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + } + set privateTransactionConfig(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB) { + pb_1.Message.setWrapperField(this, 276796542, value); + } + get has_privateTransactionConfig() { + return pb_1.Message.getField(this, 276796542) != null; + } + static fromObject(data: { + contractName?: string; + contractAbi?: ReturnType[]; + constructorArgs?: ReturnType[]; + web3SigningCredential?: ReturnType; + bytecode?: string; + keychainId?: string; + gas?: number; + gasPrice?: string; + timeoutMs?: number; + privateTransactionConfig?: ReturnType; + }): DeployContractSolidityBytecodeV1RequestPB { + const message = new DeployContractSolidityBytecodeV1RequestPB({}); + if (data.contractName != null) { + message.contractName = data.contractName; + } + if (data.contractAbi != null) { + message.contractAbi = data.contractAbi.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + if (data.constructorArgs != null) { + message.constructorArgs = data.constructorArgs.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + if (data.web3SigningCredential != null) { + message.web3SigningCredential = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.fromObject(data.web3SigningCredential); + } + if (data.bytecode != null) { + message.bytecode = data.bytecode; + } + if (data.keychainId != null) { + message.keychainId = data.keychainId; + } + if (data.gas != null) { + message.gas = data.gas; + } + if (data.gasPrice != null) { + message.gasPrice = data.gasPrice; + } + if (data.timeoutMs != null) { + message.timeoutMs = data.timeoutMs; + } + if (data.privateTransactionConfig != null) { + message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.fromObject(data.privateTransactionConfig); + } + return message; + } + toObject() { + const data: { + contractName?: string; + contractAbi?: ReturnType[]; + constructorArgs?: ReturnType[]; + web3SigningCredential?: ReturnType; + bytecode?: string; + keychainId?: string; + gas?: number; + gasPrice?: string; + timeoutMs?: number; + privateTransactionConfig?: ReturnType; + } = {}; + if (this.contractName != null) { + data.contractName = this.contractName; + } + if (this.contractAbi != null) { + data.contractAbi = this.contractAbi.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + if (this.constructorArgs != null) { + data.constructorArgs = this.constructorArgs.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + if (this.web3SigningCredential != null) { + data.web3SigningCredential = this.web3SigningCredential.toObject(); + } + if (this.bytecode != null) { + data.bytecode = this.bytecode; + } + if (this.keychainId != null) { + data.keychainId = this.keychainId; + } + if (this.gas != null) { + data.gas = this.gas; + } + if (this.gasPrice != null) { + data.gasPrice = this.gasPrice; + } + if (this.timeoutMs != null) { + data.timeoutMs = this.timeoutMs; + } + if (this.privateTransactionConfig != null) { + data.privateTransactionConfig = this.privateTransactionConfig.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.contractName.length) + writer.writeString(328784197, this.contractName); + if (this.contractAbi.length) + writer.writeRepeatedMessage(512852493, this.contractAbi, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (this.constructorArgs.length) + writer.writeRepeatedMessage(336490508, this.constructorArgs, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (this.has_web3SigningCredential) + writer.writeMessage(451211679, this.web3SigningCredential, () => this.web3SigningCredential.serialize(writer)); + if (this.bytecode.length) + writer.writeString(256554254, this.bytecode); + if (this.keychainId.length) + writer.writeString(14058372, this.keychainId); + if (this.gas != 0) + writer.writeFloat(102105, this.gas); + if (this.gasPrice.length) + writer.writeString(5271059, this.gasPrice); + if (this.timeoutMs != 0) + writer.writeFloat(51479271, this.timeoutMs); + if (this.has_privateTransactionConfig) + writer.writeMessage(276796542, this.privateTransactionConfig, () => this.privateTransactionConfig.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DeployContractSolidityBytecodeV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeployContractSolidityBytecodeV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 328784197: + message.contractName = reader.readString(); + break; + case 512852493: + reader.readMessage(message.contractAbi, () => pb_1.Message.addToRepeatedWrapperField(message, 512852493, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + case 336490508: + reader.readMessage(message.constructorArgs, () => pb_1.Message.addToRepeatedWrapperField(message, 336490508, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + case 451211679: + reader.readMessage(message.web3SigningCredential, () => message.web3SigningCredential = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.deserialize(reader)); + break; + case 256554254: + message.bytecode = reader.readString(); + break; + case 14058372: + message.keychainId = reader.readString(); + break; + case 102105: + message.gas = reader.readFloat(); + break; + case 5271059: + message.gasPrice = reader.readString(); + break; + case 51479271: + message.timeoutMs = reader.readFloat(); + break; + case 276796542: + reader.readMessage(message.privateTransactionConfig, () => message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DeployContractSolidityBytecodeV1RequestPB { + return DeployContractSolidityBytecodeV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_response_pb.ts new file mode 100644 index 0000000000..0f53c99238 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_response_pb.ts @@ -0,0 +1,80 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/deploy_contract_solidity_bytecode_v1_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_transaction_receipt_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class DeployContractSolidityBytecodeV1ResponsePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + transactionReceipt?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("transactionReceipt" in data && data.transactionReceipt != undefined) { + this.transactionReceipt = data.transactionReceipt; + } + } + } + get transactionReceipt() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB, 472834426) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB; + } + set transactionReceipt(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB) { + pb_1.Message.setWrapperField(this, 472834426, value); + } + get has_transactionReceipt() { + return pb_1.Message.getField(this, 472834426) != null; + } + static fromObject(data: { + transactionReceipt?: ReturnType; + }): DeployContractSolidityBytecodeV1ResponsePB { + const message = new DeployContractSolidityBytecodeV1ResponsePB({}); + if (data.transactionReceipt != null) { + message.transactionReceipt = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB.fromObject(data.transactionReceipt); + } + return message; + } + toObject() { + const data: { + transactionReceipt?: ReturnType; + } = {}; + if (this.transactionReceipt != null) { + data.transactionReceipt = this.transactionReceipt.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_transactionReceipt) + writer.writeMessage(472834426, this.transactionReceipt, () => this.transactionReceipt.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DeployContractSolidityBytecodeV1ResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeployContractSolidityBytecodeV1ResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 472834426: + reader.readMessage(message.transactionReceipt, () => message.transactionReceipt = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DeployContractSolidityBytecodeV1ResponsePB { + return DeployContractSolidityBytecodeV1ResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/eth_contract_invocation_type_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/eth_contract_invocation_type_pb.ts new file mode 100644 index 0000000000..1db19d91fe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/eth_contract_invocation_type_pb.ts @@ -0,0 +1,13 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/eth_contract_invocation_type_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export enum EthContractInvocationTypePB { + EthContractInvocationTypePB_SEND = 0, + EthContractInvocationTypePB_CALL = 1 + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_block_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_block_pb.ts new file mode 100644 index 0000000000..32e836805c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_block_pb.ts @@ -0,0 +1,480 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/evm_block_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class EvmBlockPB extends pb_1.Message { + #one_of_decls: number[][] = [[55126294]]; + constructor(data?: any[] | ({ + number?: number; + hash?: string; + parentHash?: string; + nonce?: string; + sha3Uncles?: string; + logsBloom?: string; + transactionsRoot?: string; + stateRoot?: string; + miner?: string; + difficulty?: number; + totalDifficulty?: number; + extraData?: string; + size?: number; + gasLimit?: number; + gasUsed?: number; + transactions?: dependency_1.google.protobuf.Any[]; + uncles?: dependency_1.google.protobuf.Any[]; + } & (({ + timestamp?: dependency_1.google.protobuf.Any; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [343509336, 303842065], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("number" in data && data.number != undefined) { + this.number = data.number; + } + if ("hash" in data && data.hash != undefined) { + this.hash = data.hash; + } + if ("parentHash" in data && data.parentHash != undefined) { + this.parentHash = data.parentHash; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("sha3Uncles" in data && data.sha3Uncles != undefined) { + this.sha3Uncles = data.sha3Uncles; + } + if ("logsBloom" in data && data.logsBloom != undefined) { + this.logsBloom = data.logsBloom; + } + if ("transactionsRoot" in data && data.transactionsRoot != undefined) { + this.transactionsRoot = data.transactionsRoot; + } + if ("stateRoot" in data && data.stateRoot != undefined) { + this.stateRoot = data.stateRoot; + } + if ("miner" in data && data.miner != undefined) { + this.miner = data.miner; + } + if ("difficulty" in data && data.difficulty != undefined) { + this.difficulty = data.difficulty; + } + if ("totalDifficulty" in data && data.totalDifficulty != undefined) { + this.totalDifficulty = data.totalDifficulty; + } + if ("extraData" in data && data.extraData != undefined) { + this.extraData = data.extraData; + } + if ("size" in data && data.size != undefined) { + this.size = data.size; + } + if ("gasLimit" in data && data.gasLimit != undefined) { + this.gasLimit = data.gasLimit; + } + if ("gasUsed" in data && data.gasUsed != undefined) { + this.gasUsed = data.gasUsed; + } + if ("timestamp" in data && data.timestamp != undefined) { + this.timestamp = data.timestamp; + } + if ("transactions" in data && data.transactions != undefined) { + this.transactions = data.transactions; + } + if ("uncles" in data && data.uncles != undefined) { + this.uncles = data.uncles; + } + } + } + get number() { + return pb_1.Message.getFieldWithDefault(this, 497493176, 0) as number; + } + set number(value: number) { + pb_1.Message.setField(this, 497493176, value); + } + get hash() { + return pb_1.Message.getFieldWithDefault(this, 3195150, "") as string; + } + set hash(value: string) { + pb_1.Message.setField(this, 3195150, value); + } + get parentHash() { + return pb_1.Message.getFieldWithDefault(this, 245049128, "") as string; + } + set parentHash(value: string) { + pb_1.Message.setField(this, 245049128, value); + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 105002991, "") as string; + } + set nonce(value: string) { + pb_1.Message.setField(this, 105002991, value); + } + get sha3Uncles() { + return pb_1.Message.getFieldWithDefault(this, 373514458, "") as string; + } + set sha3Uncles(value: string) { + pb_1.Message.setField(this, 373514458, value); + } + get logsBloom() { + return pb_1.Message.getFieldWithDefault(this, 399161966, "") as string; + } + set logsBloom(value: string) { + pb_1.Message.setField(this, 399161966, value); + } + get transactionsRoot() { + return pb_1.Message.getFieldWithDefault(this, 526502871, "") as string; + } + set transactionsRoot(value: string) { + pb_1.Message.setField(this, 526502871, value); + } + get stateRoot() { + return pb_1.Message.getFieldWithDefault(this, 475330288, "") as string; + } + set stateRoot(value: string) { + pb_1.Message.setField(this, 475330288, value); + } + get miner() { + return pb_1.Message.getFieldWithDefault(this, 103900799, "") as string; + } + set miner(value: string) { + pb_1.Message.setField(this, 103900799, value); + } + get difficulty() { + return pb_1.Message.getFieldWithDefault(this, 218888126, 0) as number; + } + set difficulty(value: number) { + pb_1.Message.setField(this, 218888126, value); + } + get totalDifficulty() { + return pb_1.Message.getFieldWithDefault(this, 413035041, 0) as number; + } + set totalDifficulty(value: number) { + pb_1.Message.setField(this, 413035041, value); + } + get extraData() { + return pb_1.Message.getFieldWithDefault(this, 253792294, "") as string; + } + set extraData(value: string) { + pb_1.Message.setField(this, 253792294, value); + } + get size() { + return pb_1.Message.getFieldWithDefault(this, 3530753, 0) as number; + } + set size(value: number) { + pb_1.Message.setField(this, 3530753, value); + } + get gasLimit() { + return pb_1.Message.getFieldWithDefault(this, 9229217, 0) as number; + } + set gasLimit(value: number) { + pb_1.Message.setField(this, 9229217, value); + } + get gasUsed() { + return pb_1.Message.getFieldWithDefault(this, 190522826, 0) as number; + } + set gasUsed(value: number) { + pb_1.Message.setField(this, 190522826, value); + } + get timestamp() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 55126294) as dependency_1.google.protobuf.Any; + } + set timestamp(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 55126294, this.#one_of_decls[0], value); + } + get has_timestamp() { + return pb_1.Message.getField(this, 55126294) != null; + } + get transactions() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 343509336) as dependency_1.google.protobuf.Any[]; + } + set transactions(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 343509336, value); + } + get uncles() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 303842065) as dependency_1.google.protobuf.Any[]; + } + set uncles(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 303842065, value); + } + get _timestamp() { + const cases: { + [index: number]: "none" | "timestamp"; + } = { + 0: "none", + 55126294: "timestamp" + }; + return cases[pb_1.Message.computeOneofCase(this, [55126294])]; + } + static fromObject(data: { + number?: number; + hash?: string; + parentHash?: string; + nonce?: string; + sha3Uncles?: string; + logsBloom?: string; + transactionsRoot?: string; + stateRoot?: string; + miner?: string; + difficulty?: number; + totalDifficulty?: number; + extraData?: string; + size?: number; + gasLimit?: number; + gasUsed?: number; + timestamp?: ReturnType; + transactions?: ReturnType[]; + uncles?: ReturnType[]; + }): EvmBlockPB { + const message = new EvmBlockPB({}); + if (data.number != null) { + message.number = data.number; + } + if (data.hash != null) { + message.hash = data.hash; + } + if (data.parentHash != null) { + message.parentHash = data.parentHash; + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.sha3Uncles != null) { + message.sha3Uncles = data.sha3Uncles; + } + if (data.logsBloom != null) { + message.logsBloom = data.logsBloom; + } + if (data.transactionsRoot != null) { + message.transactionsRoot = data.transactionsRoot; + } + if (data.stateRoot != null) { + message.stateRoot = data.stateRoot; + } + if (data.miner != null) { + message.miner = data.miner; + } + if (data.difficulty != null) { + message.difficulty = data.difficulty; + } + if (data.totalDifficulty != null) { + message.totalDifficulty = data.totalDifficulty; + } + if (data.extraData != null) { + message.extraData = data.extraData; + } + if (data.size != null) { + message.size = data.size; + } + if (data.gasLimit != null) { + message.gasLimit = data.gasLimit; + } + if (data.gasUsed != null) { + message.gasUsed = data.gasUsed; + } + if (data.timestamp != null) { + message.timestamp = dependency_1.google.protobuf.Any.fromObject(data.timestamp); + } + if (data.transactions != null) { + message.transactions = data.transactions.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + if (data.uncles != null) { + message.uncles = data.uncles.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + return message; + } + toObject() { + const data: { + number?: number; + hash?: string; + parentHash?: string; + nonce?: string; + sha3Uncles?: string; + logsBloom?: string; + transactionsRoot?: string; + stateRoot?: string; + miner?: string; + difficulty?: number; + totalDifficulty?: number; + extraData?: string; + size?: number; + gasLimit?: number; + gasUsed?: number; + timestamp?: ReturnType; + transactions?: ReturnType[]; + uncles?: ReturnType[]; + } = {}; + if (this.number != null) { + data.number = this.number; + } + if (this.hash != null) { + data.hash = this.hash; + } + if (this.parentHash != null) { + data.parentHash = this.parentHash; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.sha3Uncles != null) { + data.sha3Uncles = this.sha3Uncles; + } + if (this.logsBloom != null) { + data.logsBloom = this.logsBloom; + } + if (this.transactionsRoot != null) { + data.transactionsRoot = this.transactionsRoot; + } + if (this.stateRoot != null) { + data.stateRoot = this.stateRoot; + } + if (this.miner != null) { + data.miner = this.miner; + } + if (this.difficulty != null) { + data.difficulty = this.difficulty; + } + if (this.totalDifficulty != null) { + data.totalDifficulty = this.totalDifficulty; + } + if (this.extraData != null) { + data.extraData = this.extraData; + } + if (this.size != null) { + data.size = this.size; + } + if (this.gasLimit != null) { + data.gasLimit = this.gasLimit; + } + if (this.gasUsed != null) { + data.gasUsed = this.gasUsed; + } + if (this.timestamp != null) { + data.timestamp = this.timestamp.toObject(); + } + if (this.transactions != null) { + data.transactions = this.transactions.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + if (this.uncles != null) { + data.uncles = this.uncles.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.number != 0) + writer.writeFloat(497493176, this.number); + if (this.hash.length) + writer.writeString(3195150, this.hash); + if (this.parentHash.length) + writer.writeString(245049128, this.parentHash); + if (this.nonce.length) + writer.writeString(105002991, this.nonce); + if (this.sha3Uncles.length) + writer.writeString(373514458, this.sha3Uncles); + if (this.logsBloom.length) + writer.writeString(399161966, this.logsBloom); + if (this.transactionsRoot.length) + writer.writeString(526502871, this.transactionsRoot); + if (this.stateRoot.length) + writer.writeString(475330288, this.stateRoot); + if (this.miner.length) + writer.writeString(103900799, this.miner); + if (this.difficulty != 0) + writer.writeFloat(218888126, this.difficulty); + if (this.totalDifficulty != 0) + writer.writeFloat(413035041, this.totalDifficulty); + if (this.extraData.length) + writer.writeString(253792294, this.extraData); + if (this.size != 0) + writer.writeFloat(3530753, this.size); + if (this.gasLimit != 0) + writer.writeFloat(9229217, this.gasLimit); + if (this.gasUsed != 0) + writer.writeFloat(190522826, this.gasUsed); + if (this.has_timestamp) + writer.writeMessage(55126294, this.timestamp, () => this.timestamp.serialize(writer)); + if (this.transactions.length) + writer.writeRepeatedMessage(343509336, this.transactions, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (this.uncles.length) + writer.writeRepeatedMessage(303842065, this.uncles, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EvmBlockPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EvmBlockPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 497493176: + message.number = reader.readFloat(); + break; + case 3195150: + message.hash = reader.readString(); + break; + case 245049128: + message.parentHash = reader.readString(); + break; + case 105002991: + message.nonce = reader.readString(); + break; + case 373514458: + message.sha3Uncles = reader.readString(); + break; + case 399161966: + message.logsBloom = reader.readString(); + break; + case 526502871: + message.transactionsRoot = reader.readString(); + break; + case 475330288: + message.stateRoot = reader.readString(); + break; + case 103900799: + message.miner = reader.readString(); + break; + case 218888126: + message.difficulty = reader.readFloat(); + break; + case 413035041: + message.totalDifficulty = reader.readFloat(); + break; + case 253792294: + message.extraData = reader.readString(); + break; + case 3530753: + message.size = reader.readFloat(); + break; + case 9229217: + message.gasLimit = reader.readFloat(); + break; + case 190522826: + message.gasUsed = reader.readFloat(); + break; + case 55126294: + reader.readMessage(message.timestamp, () => message.timestamp = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 343509336: + reader.readMessage(message.transactions, () => pb_1.Message.addToRepeatedWrapperField(message, 343509336, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + case 303842065: + reader.readMessage(message.uncles, () => pb_1.Message.addToRepeatedWrapperField(message, 303842065, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EvmBlockPB { + return EvmBlockPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_log_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_log_pb.ts new file mode 100644 index 0000000000..9db4807c88 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_log_pb.ts @@ -0,0 +1,237 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/evm_log_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class EvmLogPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + address?: string; + data?: string; + blockHash?: string; + transactionHash?: string; + topics?: string[]; + logIndex?: number; + transactionIndex?: number; + blockNumber?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [331163357], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + if ("blockHash" in data && data.blockHash != undefined) { + this.blockHash = data.blockHash; + } + if ("transactionHash" in data && data.transactionHash != undefined) { + this.transactionHash = data.transactionHash; + } + if ("topics" in data && data.topics != undefined) { + this.topics = data.topics; + } + if ("logIndex" in data && data.logIndex != undefined) { + this.logIndex = data.logIndex; + } + if ("transactionIndex" in data && data.transactionIndex != undefined) { + this.transactionIndex = data.transactionIndex; + } + if ("blockNumber" in data && data.blockNumber != undefined) { + this.blockNumber = data.blockNumber; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 73950222, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 73950222, value); + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 3076010, "") as string; + } + set data(value: string) { + pb_1.Message.setField(this, 3076010, value); + } + get blockHash() { + return pb_1.Message.getFieldWithDefault(this, 335211324, "") as string; + } + set blockHash(value: string) { + pb_1.Message.setField(this, 335211324, value); + } + get transactionHash() { + return pb_1.Message.getFieldWithDefault(this, 188901646, "") as string; + } + set transactionHash(value: string) { + pb_1.Message.setField(this, 188901646, value); + } + get topics() { + return pb_1.Message.getFieldWithDefault(this, 331163357, []) as string[]; + } + set topics(value: string[]) { + pb_1.Message.setField(this, 331163357, value); + } + get logIndex() { + return pb_1.Message.getFieldWithDefault(this, 382599153, 0) as number; + } + set logIndex(value: number) { + pb_1.Message.setField(this, 382599153, value); + } + get transactionIndex() { + return pb_1.Message.getFieldWithDefault(this, 488538260, 0) as number; + } + set transactionIndex(value: number) { + pb_1.Message.setField(this, 488538260, value); + } + get blockNumber() { + return pb_1.Message.getFieldWithDefault(this, 205598263, 0) as number; + } + set blockNumber(value: number) { + pb_1.Message.setField(this, 205598263, value); + } + static fromObject(data: { + address?: string; + data?: string; + blockHash?: string; + transactionHash?: string; + topics?: string[]; + logIndex?: number; + transactionIndex?: number; + blockNumber?: number; + }): EvmLogPB { + const message = new EvmLogPB({}); + if (data.address != null) { + message.address = data.address; + } + if (data.data != null) { + message.data = data.data; + } + if (data.blockHash != null) { + message.blockHash = data.blockHash; + } + if (data.transactionHash != null) { + message.transactionHash = data.transactionHash; + } + if (data.topics != null) { + message.topics = data.topics; + } + if (data.logIndex != null) { + message.logIndex = data.logIndex; + } + if (data.transactionIndex != null) { + message.transactionIndex = data.transactionIndex; + } + if (data.blockNumber != null) { + message.blockNumber = data.blockNumber; + } + return message; + } + toObject() { + const data: { + address?: string; + data?: string; + blockHash?: string; + transactionHash?: string; + topics?: string[]; + logIndex?: number; + transactionIndex?: number; + blockNumber?: number; + } = {}; + if (this.address != null) { + data.address = this.address; + } + if (this.data != null) { + data.data = this.data; + } + if (this.blockHash != null) { + data.blockHash = this.blockHash; + } + if (this.transactionHash != null) { + data.transactionHash = this.transactionHash; + } + if (this.topics != null) { + data.topics = this.topics; + } + if (this.logIndex != null) { + data.logIndex = this.logIndex; + } + if (this.transactionIndex != null) { + data.transactionIndex = this.transactionIndex; + } + if (this.blockNumber != null) { + data.blockNumber = this.blockNumber; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(73950222, this.address); + if (this.data.length) + writer.writeString(3076010, this.data); + if (this.blockHash.length) + writer.writeString(335211324, this.blockHash); + if (this.transactionHash.length) + writer.writeString(188901646, this.transactionHash); + if (this.topics.length) + writer.writeRepeatedString(331163357, this.topics); + if (this.logIndex != 0) + writer.writeFloat(382599153, this.logIndex); + if (this.transactionIndex != 0) + writer.writeFloat(488538260, this.transactionIndex); + if (this.blockNumber != 0) + writer.writeFloat(205598263, this.blockNumber); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EvmLogPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EvmLogPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 73950222: + message.address = reader.readString(); + break; + case 3076010: + message.data = reader.readString(); + break; + case 335211324: + message.blockHash = reader.readString(); + break; + case 188901646: + message.transactionHash = reader.readString(); + break; + case 331163357: + pb_1.Message.addToRepeatedField(message, 331163357, reader.readString()); + break; + case 382599153: + message.logIndex = reader.readFloat(); + break; + case 488538260: + message.transactionIndex = reader.readFloat(); + break; + case 205598263: + message.blockNumber = reader.readFloat(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EvmLogPB { + return EvmLogPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_transaction_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_transaction_pb.ts new file mode 100644 index 0000000000..89d90b94fc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/evm_transaction_pb.ts @@ -0,0 +1,358 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/evm_transaction_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class EvmTransactionPB extends pb_1.Message { + #one_of_decls: number[][] = [[335211324], [205598263], [488538260], [3707]]; + constructor(data?: any[] | ({ + hash?: string; + nonce?: number; + from?: string; + value?: string; + gasPrice?: string; + gas?: number; + input?: string; + } & (({ + blockHash?: dependency_1.google.protobuf.Any; + }) | ({ + blockNumber?: dependency_1.google.protobuf.Any; + }) | ({ + transactionIndex?: dependency_1.google.protobuf.Any; + }) | ({ + to?: dependency_1.google.protobuf.Any; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("hash" in data && data.hash != undefined) { + this.hash = data.hash; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("blockHash" in data && data.blockHash != undefined) { + this.blockHash = data.blockHash; + } + if ("blockNumber" in data && data.blockNumber != undefined) { + this.blockNumber = data.blockNumber; + } + if ("transactionIndex" in data && data.transactionIndex != undefined) { + this.transactionIndex = data.transactionIndex; + } + if ("from" in data && data.from != undefined) { + this.from = data.from; + } + if ("to" in data && data.to != undefined) { + this.to = data.to; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + if ("gasPrice" in data && data.gasPrice != undefined) { + this.gasPrice = data.gasPrice; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("input" in data && data.input != undefined) { + this.input = data.input; + } + } + } + get hash() { + return pb_1.Message.getFieldWithDefault(this, 3195150, "") as string; + } + set hash(value: string) { + pb_1.Message.setField(this, 3195150, value); + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 105002991, 0) as number; + } + set nonce(value: number) { + pb_1.Message.setField(this, 105002991, value); + } + get blockHash() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 335211324) as dependency_1.google.protobuf.Any; + } + set blockHash(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 335211324, this.#one_of_decls[0], value); + } + get has_blockHash() { + return pb_1.Message.getField(this, 335211324) != null; + } + get blockNumber() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 205598263) as dependency_1.google.protobuf.Any; + } + set blockNumber(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 205598263, this.#one_of_decls[1], value); + } + get has_blockNumber() { + return pb_1.Message.getField(this, 205598263) != null; + } + get transactionIndex() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 488538260) as dependency_1.google.protobuf.Any; + } + set transactionIndex(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 488538260, this.#one_of_decls[2], value); + } + get has_transactionIndex() { + return pb_1.Message.getField(this, 488538260) != null; + } + get from() { + return pb_1.Message.getFieldWithDefault(this, 3151786, "") as string; + } + set from(value: string) { + pb_1.Message.setField(this, 3151786, value); + } + get to() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 3707) as dependency_1.google.protobuf.Any; + } + set to(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 3707, this.#one_of_decls[3], value); + } + get has_to() { + return pb_1.Message.getField(this, 3707) != null; + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 111972721, "") as string; + } + set value(value: string) { + pb_1.Message.setField(this, 111972721, value); + } + get gasPrice() { + return pb_1.Message.getFieldWithDefault(this, 5271059, "") as string; + } + set gasPrice(value: string) { + pb_1.Message.setField(this, 5271059, value); + } + get gas() { + return pb_1.Message.getFieldWithDefault(this, 102105, 0) as number; + } + set gas(value: number) { + pb_1.Message.setField(this, 102105, value); + } + get input() { + return pb_1.Message.getFieldWithDefault(this, 100358090, "") as string; + } + set input(value: string) { + pb_1.Message.setField(this, 100358090, value); + } + get _blockHash() { + const cases: { + [index: number]: "none" | "blockHash"; + } = { + 0: "none", + 335211324: "blockHash" + }; + return cases[pb_1.Message.computeOneofCase(this, [335211324])]; + } + get _blockNumber() { + const cases: { + [index: number]: "none" | "blockNumber"; + } = { + 0: "none", + 205598263: "blockNumber" + }; + return cases[pb_1.Message.computeOneofCase(this, [205598263])]; + } + get _transactionIndex() { + const cases: { + [index: number]: "none" | "transactionIndex"; + } = { + 0: "none", + 488538260: "transactionIndex" + }; + return cases[pb_1.Message.computeOneofCase(this, [488538260])]; + } + get _to() { + const cases: { + [index: number]: "none" | "to"; + } = { + 0: "none", + 3707: "to" + }; + return cases[pb_1.Message.computeOneofCase(this, [3707])]; + } + static fromObject(data: { + hash?: string; + nonce?: number; + blockHash?: ReturnType; + blockNumber?: ReturnType; + transactionIndex?: ReturnType; + from?: string; + to?: ReturnType; + value?: string; + gasPrice?: string; + gas?: number; + input?: string; + }): EvmTransactionPB { + const message = new EvmTransactionPB({}); + if (data.hash != null) { + message.hash = data.hash; + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.blockHash != null) { + message.blockHash = dependency_1.google.protobuf.Any.fromObject(data.blockHash); + } + if (data.blockNumber != null) { + message.blockNumber = dependency_1.google.protobuf.Any.fromObject(data.blockNumber); + } + if (data.transactionIndex != null) { + message.transactionIndex = dependency_1.google.protobuf.Any.fromObject(data.transactionIndex); + } + if (data.from != null) { + message.from = data.from; + } + if (data.to != null) { + message.to = dependency_1.google.protobuf.Any.fromObject(data.to); + } + if (data.value != null) { + message.value = data.value; + } + if (data.gasPrice != null) { + message.gasPrice = data.gasPrice; + } + if (data.gas != null) { + message.gas = data.gas; + } + if (data.input != null) { + message.input = data.input; + } + return message; + } + toObject() { + const data: { + hash?: string; + nonce?: number; + blockHash?: ReturnType; + blockNumber?: ReturnType; + transactionIndex?: ReturnType; + from?: string; + to?: ReturnType; + value?: string; + gasPrice?: string; + gas?: number; + input?: string; + } = {}; + if (this.hash != null) { + data.hash = this.hash; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.blockHash != null) { + data.blockHash = this.blockHash.toObject(); + } + if (this.blockNumber != null) { + data.blockNumber = this.blockNumber.toObject(); + } + if (this.transactionIndex != null) { + data.transactionIndex = this.transactionIndex.toObject(); + } + if (this.from != null) { + data.from = this.from; + } + if (this.to != null) { + data.to = this.to.toObject(); + } + if (this.value != null) { + data.value = this.value; + } + if (this.gasPrice != null) { + data.gasPrice = this.gasPrice; + } + if (this.gas != null) { + data.gas = this.gas; + } + if (this.input != null) { + data.input = this.input; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.hash.length) + writer.writeString(3195150, this.hash); + if (this.nonce != 0) + writer.writeFloat(105002991, this.nonce); + if (this.has_blockHash) + writer.writeMessage(335211324, this.blockHash, () => this.blockHash.serialize(writer)); + if (this.has_blockNumber) + writer.writeMessage(205598263, this.blockNumber, () => this.blockNumber.serialize(writer)); + if (this.has_transactionIndex) + writer.writeMessage(488538260, this.transactionIndex, () => this.transactionIndex.serialize(writer)); + if (this.from.length) + writer.writeString(3151786, this.from); + if (this.has_to) + writer.writeMessage(3707, this.to, () => this.to.serialize(writer)); + if (this.value.length) + writer.writeString(111972721, this.value); + if (this.gasPrice.length) + writer.writeString(5271059, this.gasPrice); + if (this.gas != 0) + writer.writeFloat(102105, this.gas); + if (this.input.length) + writer.writeString(100358090, this.input); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EvmTransactionPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EvmTransactionPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 3195150: + message.hash = reader.readString(); + break; + case 105002991: + message.nonce = reader.readFloat(); + break; + case 335211324: + reader.readMessage(message.blockHash, () => message.blockHash = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 205598263: + reader.readMessage(message.blockNumber, () => message.blockNumber = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 488538260: + reader.readMessage(message.transactionIndex, () => message.transactionIndex = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 3151786: + message.from = reader.readString(); + break; + case 3707: + reader.readMessage(message.to, () => message.to = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 111972721: + message.value = reader.readString(); + break; + case 5271059: + message.gasPrice = reader.readString(); + break; + case 102105: + message.gas = reader.readFloat(); + break; + case 100358090: + message.input = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): EvmTransactionPB { + return EvmTransactionPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_request_pb.ts new file mode 100644 index 0000000000..32918b4910 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_request_pb.ts @@ -0,0 +1,112 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_balance_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetBalanceV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = [[140394805]]; + constructor(data?: any[] | ({ + address?: string; + } & (({ + defaultBlock?: dependency_1.google.protobuf.Any; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("defaultBlock" in data && data.defaultBlock != undefined) { + this.defaultBlock = data.defaultBlock; + } + } + } + get address() { + return pb_1.Message.getFieldWithDefault(this, 73950222, "") as string; + } + set address(value: string) { + pb_1.Message.setField(this, 73950222, value); + } + get defaultBlock() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 140394805) as dependency_1.google.protobuf.Any; + } + set defaultBlock(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 140394805, this.#one_of_decls[0], value); + } + get has_defaultBlock() { + return pb_1.Message.getField(this, 140394805) != null; + } + get _defaultBlock() { + const cases: { + [index: number]: "none" | "defaultBlock"; + } = { + 0: "none", + 140394805: "defaultBlock" + }; + return cases[pb_1.Message.computeOneofCase(this, [140394805])]; + } + static fromObject(data: { + address?: string; + defaultBlock?: ReturnType; + }): GetBalanceV1RequestPB { + const message = new GetBalanceV1RequestPB({}); + if (data.address != null) { + message.address = data.address; + } + if (data.defaultBlock != null) { + message.defaultBlock = dependency_1.google.protobuf.Any.fromObject(data.defaultBlock); + } + return message; + } + toObject() { + const data: { + address?: string; + defaultBlock?: ReturnType; + } = {}; + if (this.address != null) { + data.address = this.address; + } + if (this.defaultBlock != null) { + data.defaultBlock = this.defaultBlock.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.address.length) + writer.writeString(73950222, this.address); + if (this.has_defaultBlock) + writer.writeMessage(140394805, this.defaultBlock, () => this.defaultBlock.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBalanceV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBalanceV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 73950222: + message.address = reader.readString(); + break; + case 140394805: + reader.readMessage(message.defaultBlock, () => message.defaultBlock = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBalanceV1RequestPB { + return GetBalanceV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_response_pb.ts new file mode 100644 index 0000000000..1de83322f3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_balance_v1_response_pb.ts @@ -0,0 +1,76 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_balance_v1_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetBalanceV1ResponsePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + balance?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("balance" in data && data.balance != undefined) { + this.balance = data.balance; + } + } + } + get balance() { + return pb_1.Message.getFieldWithDefault(this, 339185956, "") as string; + } + set balance(value: string) { + pb_1.Message.setField(this, 339185956, value); + } + static fromObject(data: { + balance?: string; + }): GetBalanceV1ResponsePB { + const message = new GetBalanceV1ResponsePB({}); + if (data.balance != null) { + message.balance = data.balance; + } + return message; + } + toObject() { + const data: { + balance?: string; + } = {}; + if (this.balance != null) { + data.balance = this.balance; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.balance.length) + writer.writeString(339185956, this.balance); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBalanceV1ResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBalanceV1ResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 339185956: + message.balance = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBalanceV1ResponsePB { + return GetBalanceV1ResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_request_pb.ts new file mode 100644 index 0000000000..0df5c100e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_request_pb.ts @@ -0,0 +1,103 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_besu_record_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./invoke_contract_v1_request_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetBesuRecordV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + invokeCall?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; + transactionHash?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("invokeCall" in data && data.invokeCall != undefined) { + this.invokeCall = data.invokeCall; + } + if ("transactionHash" in data && data.transactionHash != undefined) { + this.transactionHash = data.transactionHash; + } + } + } + get invokeCall() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB, 359347961) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; + } + set invokeCall(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB) { + pb_1.Message.setWrapperField(this, 359347961, value); + } + get has_invokeCall() { + return pb_1.Message.getField(this, 359347961) != null; + } + get transactionHash() { + return pb_1.Message.getFieldWithDefault(this, 188901646, "") as string; + } + set transactionHash(value: string) { + pb_1.Message.setField(this, 188901646, value); + } + static fromObject(data: { + invokeCall?: ReturnType; + transactionHash?: string; + }): GetBesuRecordV1RequestPB { + const message = new GetBesuRecordV1RequestPB({}); + if (data.invokeCall != null) { + message.invokeCall = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.fromObject(data.invokeCall); + } + if (data.transactionHash != null) { + message.transactionHash = data.transactionHash; + } + return message; + } + toObject() { + const data: { + invokeCall?: ReturnType; + transactionHash?: string; + } = {}; + if (this.invokeCall != null) { + data.invokeCall = this.invokeCall.toObject(); + } + if (this.transactionHash != null) { + data.transactionHash = this.transactionHash; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_invokeCall) + writer.writeMessage(359347961, this.invokeCall, () => this.invokeCall.serialize(writer)); + if (this.transactionHash.length) + writer.writeString(188901646, this.transactionHash); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBesuRecordV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBesuRecordV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 359347961: + reader.readMessage(message.invokeCall, () => message.invokeCall = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.deserialize(reader)); + break; + case 188901646: + message.transactionHash = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBesuRecordV1RequestPB { + return GetBesuRecordV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_response_pb.ts new file mode 100644 index 0000000000..f1d57f5671 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_besu_record_v1_response_pb.ts @@ -0,0 +1,171 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_besu_record_v1_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetBesuRecordV1ResponsePB extends pb_1.Message { + #one_of_decls: number[][] = [[134507862], [401260801]]; + constructor(data?: any[] | ({ + ledgerId?: string; + stateContract?: string; + } & (({ + transactionInputData?: dependency_1.google.protobuf.Any; + }) | ({ + callOutput?: dependency_1.google.protobuf.Any; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("ledgerId" in data && data.ledgerId != undefined) { + this.ledgerId = data.ledgerId; + } + if ("stateContract" in data && data.stateContract != undefined) { + this.stateContract = data.stateContract; + } + if ("transactionInputData" in data && data.transactionInputData != undefined) { + this.transactionInputData = data.transactionInputData; + } + if ("callOutput" in data && data.callOutput != undefined) { + this.callOutput = data.callOutput; + } + } + } + get ledgerId() { + return pb_1.Message.getFieldWithDefault(this, 39059559, "") as string; + } + set ledgerId(value: string) { + pb_1.Message.setField(this, 39059559, value); + } + get stateContract() { + return pb_1.Message.getFieldWithDefault(this, 509155523, "") as string; + } + set stateContract(value: string) { + pb_1.Message.setField(this, 509155523, value); + } + get transactionInputData() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 134507862) as dependency_1.google.protobuf.Any; + } + set transactionInputData(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 134507862, this.#one_of_decls[0], value); + } + get has_transactionInputData() { + return pb_1.Message.getField(this, 134507862) != null; + } + get callOutput() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 401260801) as dependency_1.google.protobuf.Any; + } + set callOutput(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 401260801, this.#one_of_decls[1], value); + } + get has_callOutput() { + return pb_1.Message.getField(this, 401260801) != null; + } + get _transactionInputData() { + const cases: { + [index: number]: "none" | "transactionInputData"; + } = { + 0: "none", + 134507862: "transactionInputData" + }; + return cases[pb_1.Message.computeOneofCase(this, [134507862])]; + } + get _callOutput() { + const cases: { + [index: number]: "none" | "callOutput"; + } = { + 0: "none", + 401260801: "callOutput" + }; + return cases[pb_1.Message.computeOneofCase(this, [401260801])]; + } + static fromObject(data: { + ledgerId?: string; + stateContract?: string; + transactionInputData?: ReturnType; + callOutput?: ReturnType; + }): GetBesuRecordV1ResponsePB { + const message = new GetBesuRecordV1ResponsePB({}); + if (data.ledgerId != null) { + message.ledgerId = data.ledgerId; + } + if (data.stateContract != null) { + message.stateContract = data.stateContract; + } + if (data.transactionInputData != null) { + message.transactionInputData = dependency_1.google.protobuf.Any.fromObject(data.transactionInputData); + } + if (data.callOutput != null) { + message.callOutput = dependency_1.google.protobuf.Any.fromObject(data.callOutput); + } + return message; + } + toObject() { + const data: { + ledgerId?: string; + stateContract?: string; + transactionInputData?: ReturnType; + callOutput?: ReturnType; + } = {}; + if (this.ledgerId != null) { + data.ledgerId = this.ledgerId; + } + if (this.stateContract != null) { + data.stateContract = this.stateContract; + } + if (this.transactionInputData != null) { + data.transactionInputData = this.transactionInputData.toObject(); + } + if (this.callOutput != null) { + data.callOutput = this.callOutput.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.ledgerId.length) + writer.writeString(39059559, this.ledgerId); + if (this.stateContract.length) + writer.writeString(509155523, this.stateContract); + if (this.has_transactionInputData) + writer.writeMessage(134507862, this.transactionInputData, () => this.transactionInputData.serialize(writer)); + if (this.has_callOutput) + writer.writeMessage(401260801, this.callOutput, () => this.callOutput.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBesuRecordV1ResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBesuRecordV1ResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 39059559: + message.ledgerId = reader.readString(); + break; + case 509155523: + message.stateContract = reader.readString(); + break; + case 134507862: + reader.readMessage(message.transactionInputData, () => message.transactionInputData = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 401260801: + reader.readMessage(message.callOutput, () => message.callOutput = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBesuRecordV1ResponsePB { + return GetBesuRecordV1ResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_request_pb.ts new file mode 100644 index 0000000000..b67937f5a8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_request_pb.ts @@ -0,0 +1,88 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_block_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetBlockV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = [[273815337]]; + constructor(data?: any[] | ({} & (({ + blockHashOrBlockNumber?: dependency_1.google.protobuf.Any; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("blockHashOrBlockNumber" in data && data.blockHashOrBlockNumber != undefined) { + this.blockHashOrBlockNumber = data.blockHashOrBlockNumber; + } + } + } + get blockHashOrBlockNumber() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 273815337) as dependency_1.google.protobuf.Any; + } + set blockHashOrBlockNumber(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 273815337, this.#one_of_decls[0], value); + } + get has_blockHashOrBlockNumber() { + return pb_1.Message.getField(this, 273815337) != null; + } + get _blockHashOrBlockNumber() { + const cases: { + [index: number]: "none" | "blockHashOrBlockNumber"; + } = { + 0: "none", + 273815337: "blockHashOrBlockNumber" + }; + return cases[pb_1.Message.computeOneofCase(this, [273815337])]; + } + static fromObject(data: { + blockHashOrBlockNumber?: ReturnType; + }): GetBlockV1RequestPB { + const message = new GetBlockV1RequestPB({}); + if (data.blockHashOrBlockNumber != null) { + message.blockHashOrBlockNumber = dependency_1.google.protobuf.Any.fromObject(data.blockHashOrBlockNumber); + } + return message; + } + toObject() { + const data: { + blockHashOrBlockNumber?: ReturnType; + } = {}; + if (this.blockHashOrBlockNumber != null) { + data.blockHashOrBlockNumber = this.blockHashOrBlockNumber.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_blockHashOrBlockNumber) + writer.writeMessage(273815337, this.blockHashOrBlockNumber, () => this.blockHashOrBlockNumber.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBlockV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBlockV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 273815337: + reader.readMessage(message.blockHashOrBlockNumber, () => message.blockHashOrBlockNumber = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBlockV1RequestPB { + return GetBlockV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_response_pb.ts new file mode 100644 index 0000000000..ca393cbef3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_block_v1_response_pb.ts @@ -0,0 +1,80 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_block_v1_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./evm_block_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetBlockV1ResponsePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + block?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmBlockPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("block" in data && data.block != undefined) { + this.block = data.block; + } + } + } + get block() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmBlockPB, 93832333) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmBlockPB; + } + set block(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmBlockPB) { + pb_1.Message.setWrapperField(this, 93832333, value); + } + get has_block() { + return pb_1.Message.getField(this, 93832333) != null; + } + static fromObject(data: { + block?: ReturnType; + }): GetBlockV1ResponsePB { + const message = new GetBlockV1ResponsePB({}); + if (data.block != null) { + message.block = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmBlockPB.fromObject(data.block); + } + return message; + } + toObject() { + const data: { + block?: ReturnType; + } = {}; + if (this.block != null) { + data.block = this.block.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_block) + writer.writeMessage(93832333, this.block, () => this.block.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBlockV1ResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBlockV1ResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 93832333: + reader.readMessage(message.block, () => message.block = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmBlockPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBlockV1ResponsePB { + return GetBlockV1ResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_request_pb.ts new file mode 100644 index 0000000000..f0a85ec018 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_request_pb.ts @@ -0,0 +1,184 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_past_logs_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetPastLogsV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = [[107898160], [53671683], [73950222]]; + constructor(data?: any[] | ({ + topics?: dependency_1.google.protobuf.Any[]; + } & (({ + toBlock?: dependency_1.google.protobuf.Any; + }) | ({ + fromBlock?: dependency_1.google.protobuf.Any; + }) | ({ + address?: dependency_1.google.protobuf.Any; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [331163357], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("toBlock" in data && data.toBlock != undefined) { + this.toBlock = data.toBlock; + } + if ("fromBlock" in data && data.fromBlock != undefined) { + this.fromBlock = data.fromBlock; + } + if ("address" in data && data.address != undefined) { + this.address = data.address; + } + if ("topics" in data && data.topics != undefined) { + this.topics = data.topics; + } + } + } + get toBlock() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 107898160) as dependency_1.google.protobuf.Any; + } + set toBlock(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 107898160, this.#one_of_decls[0], value); + } + get has_toBlock() { + return pb_1.Message.getField(this, 107898160) != null; + } + get fromBlock() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 53671683) as dependency_1.google.protobuf.Any; + } + set fromBlock(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 53671683, this.#one_of_decls[1], value); + } + get has_fromBlock() { + return pb_1.Message.getField(this, 53671683) != null; + } + get address() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 73950222) as dependency_1.google.protobuf.Any; + } + set address(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 73950222, this.#one_of_decls[2], value); + } + get has_address() { + return pb_1.Message.getField(this, 73950222) != null; + } + get topics() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 331163357) as dependency_1.google.protobuf.Any[]; + } + set topics(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 331163357, value); + } + get _toBlock() { + const cases: { + [index: number]: "none" | "toBlock"; + } = { + 0: "none", + 107898160: "toBlock" + }; + return cases[pb_1.Message.computeOneofCase(this, [107898160])]; + } + get _fromBlock() { + const cases: { + [index: number]: "none" | "fromBlock"; + } = { + 0: "none", + 53671683: "fromBlock" + }; + return cases[pb_1.Message.computeOneofCase(this, [53671683])]; + } + get _address() { + const cases: { + [index: number]: "none" | "address"; + } = { + 0: "none", + 73950222: "address" + }; + return cases[pb_1.Message.computeOneofCase(this, [73950222])]; + } + static fromObject(data: { + toBlock?: ReturnType; + fromBlock?: ReturnType; + address?: ReturnType; + topics?: ReturnType[]; + }): GetPastLogsV1RequestPB { + const message = new GetPastLogsV1RequestPB({}); + if (data.toBlock != null) { + message.toBlock = dependency_1.google.protobuf.Any.fromObject(data.toBlock); + } + if (data.fromBlock != null) { + message.fromBlock = dependency_1.google.protobuf.Any.fromObject(data.fromBlock); + } + if (data.address != null) { + message.address = dependency_1.google.protobuf.Any.fromObject(data.address); + } + if (data.topics != null) { + message.topics = data.topics.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + return message; + } + toObject() { + const data: { + toBlock?: ReturnType; + fromBlock?: ReturnType; + address?: ReturnType; + topics?: ReturnType[]; + } = {}; + if (this.toBlock != null) { + data.toBlock = this.toBlock.toObject(); + } + if (this.fromBlock != null) { + data.fromBlock = this.fromBlock.toObject(); + } + if (this.address != null) { + data.address = this.address.toObject(); + } + if (this.topics != null) { + data.topics = this.topics.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_toBlock) + writer.writeMessage(107898160, this.toBlock, () => this.toBlock.serialize(writer)); + if (this.has_fromBlock) + writer.writeMessage(53671683, this.fromBlock, () => this.fromBlock.serialize(writer)); + if (this.has_address) + writer.writeMessage(73950222, this.address, () => this.address.serialize(writer)); + if (this.topics.length) + writer.writeRepeatedMessage(331163357, this.topics, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetPastLogsV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetPastLogsV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 107898160: + reader.readMessage(message.toBlock, () => message.toBlock = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 53671683: + reader.readMessage(message.fromBlock, () => message.fromBlock = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 73950222: + reader.readMessage(message.address, () => message.address = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 331163357: + reader.readMessage(message.topics, () => pb_1.Message.addToRepeatedWrapperField(message, 331163357, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetPastLogsV1RequestPB { + return GetPastLogsV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_response_pb.ts new file mode 100644 index 0000000000..719aa57319 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_past_logs_v1_response_pb.ts @@ -0,0 +1,77 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_past_logs_v1_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./evm_log_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetPastLogsV1ResponsePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + logs?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB[]; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3327407], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("logs" in data && data.logs != undefined) { + this.logs = data.logs; + } + } + } + get logs() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB, 3327407) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB[]; + } + set logs(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB[]) { + pb_1.Message.setRepeatedWrapperField(this, 3327407, value); + } + static fromObject(data: { + logs?: ReturnType[]; + }): GetPastLogsV1ResponsePB { + const message = new GetPastLogsV1ResponsePB({}); + if (data.logs != null) { + message.logs = data.logs.map(item => dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB.fromObject(item)); + } + return message; + } + toObject() { + const data: { + logs?: ReturnType[]; + } = {}; + if (this.logs != null) { + data.logs = this.logs.map((item: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB) => item.toObject()); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.logs.length) + writer.writeRepeatedMessage(3327407, this.logs, (item: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB) => item.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetPastLogsV1ResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetPastLogsV1ResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 3327407: + reader.readMessage(message.logs, () => pb_1.Message.addToRepeatedWrapperField(message, 3327407, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB.deserialize(reader), dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmLogPB)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetPastLogsV1ResponsePB { + return GetPastLogsV1ResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_request_pb.ts new file mode 100644 index 0000000000..f6dfad2cbe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_request_pb.ts @@ -0,0 +1,76 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_transaction_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetTransactionV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + transactionHash?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("transactionHash" in data && data.transactionHash != undefined) { + this.transactionHash = data.transactionHash; + } + } + } + get transactionHash() { + return pb_1.Message.getFieldWithDefault(this, 188901646, "") as string; + } + set transactionHash(value: string) { + pb_1.Message.setField(this, 188901646, value); + } + static fromObject(data: { + transactionHash?: string; + }): GetTransactionV1RequestPB { + const message = new GetTransactionV1RequestPB({}); + if (data.transactionHash != null) { + message.transactionHash = data.transactionHash; + } + return message; + } + toObject() { + const data: { + transactionHash?: string; + } = {}; + if (this.transactionHash != null) { + data.transactionHash = this.transactionHash; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.transactionHash.length) + writer.writeString(188901646, this.transactionHash); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetTransactionV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetTransactionV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 188901646: + message.transactionHash = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetTransactionV1RequestPB { + return GetTransactionV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_response_pb.ts new file mode 100644 index 0000000000..6ee76c1247 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/get_transaction_v1_response_pb.ts @@ -0,0 +1,80 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/get_transaction_v1_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./evm_transaction_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class GetTransactionV1ResponsePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + transaction?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmTransactionPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("transaction" in data && data.transaction != undefined) { + this.transaction = data.transaction; + } + } + } + get transaction() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmTransactionPB, 530633441) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmTransactionPB; + } + set transaction(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmTransactionPB) { + pb_1.Message.setWrapperField(this, 530633441, value); + } + get has_transaction() { + return pb_1.Message.getField(this, 530633441) != null; + } + static fromObject(data: { + transaction?: ReturnType; + }): GetTransactionV1ResponsePB { + const message = new GetTransactionV1ResponsePB({}); + if (data.transaction != null) { + message.transaction = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmTransactionPB.fromObject(data.transaction); + } + return message; + } + toObject() { + const data: { + transaction?: ReturnType; + } = {}; + if (this.transaction != null) { + data.transaction = this.transaction.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_transaction) + writer.writeMessage(530633441, this.transaction, () => this.transaction.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetTransactionV1ResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetTransactionV1ResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 530633441: + reader.readMessage(message.transaction, () => message.transaction = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmTransactionPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetTransactionV1ResponsePB { + return GetTransactionV1ResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_request_pb.ts new file mode 100644 index 0000000000..bb7475d42b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_request_pb.ts @@ -0,0 +1,394 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/invoke_contract_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./besu_private_transaction_config_pb"; +import * as dependency_3 from "./eth_contract_invocation_type_pb"; +import * as dependency_4 from "./web3_block_header_timestamp_pb"; +import * as dependency_5 from "./web3_signing_credential_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class InvokeContractV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + contractName?: string; + signingCredential?: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; + invocationType?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.EthContractInvocationTypePB; + methodName?: string; + params?: dependency_1.google.protobuf.Any[]; + contractAbi?: dependency_1.google.protobuf.Any[]; + contractAddress?: string; + value?: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + gas?: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + gasPrice?: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + nonce?: number; + timeoutMs?: number; + keychainId?: string; + privateTransactionConfig?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [458557051, 512852493], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("contractName" in data && data.contractName != undefined) { + this.contractName = data.contractName; + } + if ("signingCredential" in data && data.signingCredential != undefined) { + this.signingCredential = data.signingCredential; + } + if ("invocationType" in data && data.invocationType != undefined) { + this.invocationType = data.invocationType; + } + if ("methodName" in data && data.methodName != undefined) { + this.methodName = data.methodName; + } + if ("params" in data && data.params != undefined) { + this.params = data.params; + } + if ("contractAbi" in data && data.contractAbi != undefined) { + this.contractAbi = data.contractAbi; + } + if ("contractAddress" in data && data.contractAddress != undefined) { + this.contractAddress = data.contractAddress; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + if ("gas" in data && data.gas != undefined) { + this.gas = data.gas; + } + if ("gasPrice" in data && data.gasPrice != undefined) { + this.gasPrice = data.gasPrice; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("timeoutMs" in data && data.timeoutMs != undefined) { + this.timeoutMs = data.timeoutMs; + } + if ("keychainId" in data && data.keychainId != undefined) { + this.keychainId = data.keychainId; + } + if ("privateTransactionConfig" in data && data.privateTransactionConfig != undefined) { + this.privateTransactionConfig = data.privateTransactionConfig; + } + } + } + get contractName() { + return pb_1.Message.getFieldWithDefault(this, 328784197, "") as string; + } + set contractName(value: string) { + pb_1.Message.setField(this, 328784197, value); + } + get signingCredential() { + return pb_1.Message.getWrapperField(this, dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB, 233015102) as dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; + } + set signingCredential(value: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB) { + pb_1.Message.setWrapperField(this, 233015102, value); + } + get has_signingCredential() { + return pb_1.Message.getField(this, 233015102) != null; + } + get invocationType() { + return pb_1.Message.getFieldWithDefault(this, 163296237, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.EthContractInvocationTypePB.EthContractInvocationTypePB_SEND) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.EthContractInvocationTypePB; + } + set invocationType(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.EthContractInvocationTypePB) { + pb_1.Message.setField(this, 163296237, value); + } + get methodName() { + return pb_1.Message.getFieldWithDefault(this, 186292469, "") as string; + } + set methodName(value: string) { + pb_1.Message.setField(this, 186292469, value); + } + get params() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 458557051) as dependency_1.google.protobuf.Any[]; + } + set params(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 458557051, value); + } + get contractAbi() { + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.google.protobuf.Any, 512852493) as dependency_1.google.protobuf.Any[]; + } + set contractAbi(value: dependency_1.google.protobuf.Any[]) { + pb_1.Message.setRepeatedWrapperField(this, 512852493, value); + } + get contractAddress() { + return pb_1.Message.getFieldWithDefault(this, 214641282, "") as string; + } + set contractAddress(value: string) { + pb_1.Message.setField(this, 214641282, value); + } + get value() { + return pb_1.Message.getWrapperField(this, dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 111972721) as dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set value(value: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 111972721, value); + } + get has_value() { + return pb_1.Message.getField(this, 111972721) != null; + } + get gas() { + return pb_1.Message.getWrapperField(this, dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 102105) as dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set gas(value: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 102105, value); + } + get has_gas() { + return pb_1.Message.getField(this, 102105) != null; + } + get gasPrice() { + return pb_1.Message.getWrapperField(this, dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 5271059) as dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set gasPrice(value: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 5271059, value); + } + get has_gasPrice() { + return pb_1.Message.getField(this, 5271059) != null; + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 105002991, 0) as number; + } + set nonce(value: number) { + pb_1.Message.setField(this, 105002991, value); + } + get timeoutMs() { + return pb_1.Message.getFieldWithDefault(this, 51479271, 0) as number; + } + set timeoutMs(value: number) { + pb_1.Message.setField(this, 51479271, value); + } + get keychainId() { + return pb_1.Message.getFieldWithDefault(this, 14058372, "") as string; + } + set keychainId(value: string) { + pb_1.Message.setField(this, 14058372, value); + } + get privateTransactionConfig() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB, 276796542) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + } + set privateTransactionConfig(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB) { + pb_1.Message.setWrapperField(this, 276796542, value); + } + get has_privateTransactionConfig() { + return pb_1.Message.getField(this, 276796542) != null; + } + static fromObject(data: { + contractName?: string; + signingCredential?: ReturnType; + invocationType?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.EthContractInvocationTypePB; + methodName?: string; + params?: ReturnType[]; + contractAbi?: ReturnType[]; + contractAddress?: string; + value?: ReturnType; + gas?: ReturnType; + gasPrice?: ReturnType; + nonce?: number; + timeoutMs?: number; + keychainId?: string; + privateTransactionConfig?: ReturnType; + }): InvokeContractV1RequestPB { + const message = new InvokeContractV1RequestPB({}); + if (data.contractName != null) { + message.contractName = data.contractName; + } + if (data.signingCredential != null) { + message.signingCredential = dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.fromObject(data.signingCredential); + } + if (data.invocationType != null) { + message.invocationType = data.invocationType; + } + if (data.methodName != null) { + message.methodName = data.methodName; + } + if (data.params != null) { + message.params = data.params.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + if (data.contractAbi != null) { + message.contractAbi = data.contractAbi.map(item => dependency_1.google.protobuf.Any.fromObject(item)); + } + if (data.contractAddress != null) { + message.contractAddress = data.contractAddress; + } + if (data.value != null) { + message.value = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.value); + } + if (data.gas != null) { + message.gas = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.gas); + } + if (data.gasPrice != null) { + message.gasPrice = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.gasPrice); + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.timeoutMs != null) { + message.timeoutMs = data.timeoutMs; + } + if (data.keychainId != null) { + message.keychainId = data.keychainId; + } + if (data.privateTransactionConfig != null) { + message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.fromObject(data.privateTransactionConfig); + } + return message; + } + toObject() { + const data: { + contractName?: string; + signingCredential?: ReturnType; + invocationType?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.EthContractInvocationTypePB; + methodName?: string; + params?: ReturnType[]; + contractAbi?: ReturnType[]; + contractAddress?: string; + value?: ReturnType; + gas?: ReturnType; + gasPrice?: ReturnType; + nonce?: number; + timeoutMs?: number; + keychainId?: string; + privateTransactionConfig?: ReturnType; + } = {}; + if (this.contractName != null) { + data.contractName = this.contractName; + } + if (this.signingCredential != null) { + data.signingCredential = this.signingCredential.toObject(); + } + if (this.invocationType != null) { + data.invocationType = this.invocationType; + } + if (this.methodName != null) { + data.methodName = this.methodName; + } + if (this.params != null) { + data.params = this.params.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + if (this.contractAbi != null) { + data.contractAbi = this.contractAbi.map((item: dependency_1.google.protobuf.Any) => item.toObject()); + } + if (this.contractAddress != null) { + data.contractAddress = this.contractAddress; + } + if (this.value != null) { + data.value = this.value.toObject(); + } + if (this.gas != null) { + data.gas = this.gas.toObject(); + } + if (this.gasPrice != null) { + data.gasPrice = this.gasPrice.toObject(); + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.timeoutMs != null) { + data.timeoutMs = this.timeoutMs; + } + if (this.keychainId != null) { + data.keychainId = this.keychainId; + } + if (this.privateTransactionConfig != null) { + data.privateTransactionConfig = this.privateTransactionConfig.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.contractName.length) + writer.writeString(328784197, this.contractName); + if (this.has_signingCredential) + writer.writeMessage(233015102, this.signingCredential, () => this.signingCredential.serialize(writer)); + if (this.invocationType != dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.EthContractInvocationTypePB.EthContractInvocationTypePB_SEND) + writer.writeEnum(163296237, this.invocationType); + if (this.methodName.length) + writer.writeString(186292469, this.methodName); + if (this.params.length) + writer.writeRepeatedMessage(458557051, this.params, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (this.contractAbi.length) + writer.writeRepeatedMessage(512852493, this.contractAbi, (item: dependency_1.google.protobuf.Any) => item.serialize(writer)); + if (this.contractAddress.length) + writer.writeString(214641282, this.contractAddress); + if (this.has_value) + writer.writeMessage(111972721, this.value, () => this.value.serialize(writer)); + if (this.has_gas) + writer.writeMessage(102105, this.gas, () => this.gas.serialize(writer)); + if (this.has_gasPrice) + writer.writeMessage(5271059, this.gasPrice, () => this.gasPrice.serialize(writer)); + if (this.nonce != 0) + writer.writeFloat(105002991, this.nonce); + if (this.timeoutMs != 0) + writer.writeFloat(51479271, this.timeoutMs); + if (this.keychainId.length) + writer.writeString(14058372, this.keychainId); + if (this.has_privateTransactionConfig) + writer.writeMessage(276796542, this.privateTransactionConfig, () => this.privateTransactionConfig.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): InvokeContractV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InvokeContractV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 328784197: + message.contractName = reader.readString(); + break; + case 233015102: + reader.readMessage(message.signingCredential, () => message.signingCredential = dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.deserialize(reader)); + break; + case 163296237: + message.invocationType = reader.readEnum(); + break; + case 186292469: + message.methodName = reader.readString(); + break; + case 458557051: + reader.readMessage(message.params, () => pb_1.Message.addToRepeatedWrapperField(message, 458557051, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + case 512852493: + reader.readMessage(message.contractAbi, () => pb_1.Message.addToRepeatedWrapperField(message, 512852493, dependency_1.google.protobuf.Any.deserialize(reader), dependency_1.google.protobuf.Any)); + break; + case 214641282: + message.contractAddress = reader.readString(); + break; + case 111972721: + reader.readMessage(message.value, () => message.value = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + case 102105: + reader.readMessage(message.gas, () => message.gas = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + case 5271059: + reader.readMessage(message.gasPrice, () => message.gasPrice = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + case 105002991: + message.nonce = reader.readFloat(); + break; + case 51479271: + message.timeoutMs = reader.readFloat(); + break; + case 14058372: + message.keychainId = reader.readString(); + break; + case 276796542: + reader.readMessage(message.privateTransactionConfig, () => message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): InvokeContractV1RequestPB { + return InvokeContractV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_response_pb.ts new file mode 100644 index 0000000000..90f5b842ab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/invoke_contract_v1_response_pb.ts @@ -0,0 +1,139 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/invoke_contract_v1_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_transaction_receipt_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class InvokeContractV1ResponsePB extends pb_1.Message { + #one_of_decls: number[][] = [[401260801]]; + constructor(data?: any[] | ({ + transactionReceipt?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB; + success?: boolean; + } & (({ + callOutput?: dependency_1.google.protobuf.Any; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("transactionReceipt" in data && data.transactionReceipt != undefined) { + this.transactionReceipt = data.transactionReceipt; + } + if ("callOutput" in data && data.callOutput != undefined) { + this.callOutput = data.callOutput; + } + if ("success" in data && data.success != undefined) { + this.success = data.success; + } + } + } + get transactionReceipt() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB, 472834426) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB; + } + set transactionReceipt(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB) { + pb_1.Message.setWrapperField(this, 472834426, value); + } + get has_transactionReceipt() { + return pb_1.Message.getField(this, 472834426) != null; + } + get callOutput() { + return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Any, 401260801) as dependency_1.google.protobuf.Any; + } + set callOutput(value: dependency_1.google.protobuf.Any) { + pb_1.Message.setOneofWrapperField(this, 401260801, this.#one_of_decls[0], value); + } + get has_callOutput() { + return pb_1.Message.getField(this, 401260801) != null; + } + get success() { + return pb_1.Message.getFieldWithDefault(this, 256557056, false) as boolean; + } + set success(value: boolean) { + pb_1.Message.setField(this, 256557056, value); + } + get _callOutput() { + const cases: { + [index: number]: "none" | "callOutput"; + } = { + 0: "none", + 401260801: "callOutput" + }; + return cases[pb_1.Message.computeOneofCase(this, [401260801])]; + } + static fromObject(data: { + transactionReceipt?: ReturnType; + callOutput?: ReturnType; + success?: boolean; + }): InvokeContractV1ResponsePB { + const message = new InvokeContractV1ResponsePB({}); + if (data.transactionReceipt != null) { + message.transactionReceipt = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB.fromObject(data.transactionReceipt); + } + if (data.callOutput != null) { + message.callOutput = dependency_1.google.protobuf.Any.fromObject(data.callOutput); + } + if (data.success != null) { + message.success = data.success; + } + return message; + } + toObject() { + const data: { + transactionReceipt?: ReturnType; + callOutput?: ReturnType; + success?: boolean; + } = {}; + if (this.transactionReceipt != null) { + data.transactionReceipt = this.transactionReceipt.toObject(); + } + if (this.callOutput != null) { + data.callOutput = this.callOutput.toObject(); + } + if (this.success != null) { + data.success = this.success; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_transactionReceipt) + writer.writeMessage(472834426, this.transactionReceipt, () => this.transactionReceipt.serialize(writer)); + if (this.has_callOutput) + writer.writeMessage(401260801, this.callOutput, () => this.callOutput.serialize(writer)); + if (this.success != false) + writer.writeBool(256557056, this.success); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): InvokeContractV1ResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InvokeContractV1ResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 472834426: + reader.readMessage(message.transactionReceipt, () => message.transactionReceipt = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB.deserialize(reader)); + break; + case 401260801: + reader.readMessage(message.callOutput, () => message.callOutput = dependency_1.google.protobuf.Any.deserialize(reader)); + break; + case 256557056: + message.success = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): InvokeContractV1ResponsePB { + return InvokeContractV1ResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/receipt_type_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/receipt_type_pb.ts new file mode 100644 index 0000000000..eeb30946d1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/receipt_type_pb.ts @@ -0,0 +1,13 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/receipt_type_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export enum ReceiptTypePB { + ReceiptTypePB_NODE_TX_POOL_ACK = 0, + ReceiptTypePB_LEDGER_BLOCK_ACK = 1 + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_request_pb.ts new file mode 100644 index 0000000000..0d17029d84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_request_pb.ts @@ -0,0 +1,161 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/run_transaction_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./besu_private_transaction_config_pb"; +import * as dependency_3 from "./besu_transaction_config_pb"; +import * as dependency_4 from "./consistency_strategy_pb"; +import * as dependency_5 from "./web3_signing_credential_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class RunTransactionRequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + web3SigningCredential?: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; + transactionConfig?: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigPB; + consistencyStrategy?: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.ConsistencyStrategyPB; + privateTransactionConfig?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("web3SigningCredential" in data && data.web3SigningCredential != undefined) { + this.web3SigningCredential = data.web3SigningCredential; + } + if ("transactionConfig" in data && data.transactionConfig != undefined) { + this.transactionConfig = data.transactionConfig; + } + if ("consistencyStrategy" in data && data.consistencyStrategy != undefined) { + this.consistencyStrategy = data.consistencyStrategy; + } + if ("privateTransactionConfig" in data && data.privateTransactionConfig != undefined) { + this.privateTransactionConfig = data.privateTransactionConfig; + } + } + } + get web3SigningCredential() { + return pb_1.Message.getWrapperField(this, dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB, 451211679) as dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB; + } + set web3SigningCredential(value: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB) { + pb_1.Message.setWrapperField(this, 451211679, value); + } + get has_web3SigningCredential() { + return pb_1.Message.getField(this, 451211679) != null; + } + get transactionConfig() { + return pb_1.Message.getWrapperField(this, dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigPB, 478618563) as dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigPB; + } + set transactionConfig(value: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigPB) { + pb_1.Message.setWrapperField(this, 478618563, value); + } + get has_transactionConfig() { + return pb_1.Message.getField(this, 478618563) != null; + } + get consistencyStrategy() { + return pb_1.Message.getWrapperField(this, dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.ConsistencyStrategyPB, 86789548) as dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.ConsistencyStrategyPB; + } + set consistencyStrategy(value: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.ConsistencyStrategyPB) { + pb_1.Message.setWrapperField(this, 86789548, value); + } + get has_consistencyStrategy() { + return pb_1.Message.getField(this, 86789548) != null; + } + get privateTransactionConfig() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB, 276796542) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB; + } + set privateTransactionConfig(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB) { + pb_1.Message.setWrapperField(this, 276796542, value); + } + get has_privateTransactionConfig() { + return pb_1.Message.getField(this, 276796542) != null; + } + static fromObject(data: { + web3SigningCredential?: ReturnType; + transactionConfig?: ReturnType; + consistencyStrategy?: ReturnType; + privateTransactionConfig?: ReturnType; + }): RunTransactionRequestPB { + const message = new RunTransactionRequestPB({}); + if (data.web3SigningCredential != null) { + message.web3SigningCredential = dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.fromObject(data.web3SigningCredential); + } + if (data.transactionConfig != null) { + message.transactionConfig = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigPB.fromObject(data.transactionConfig); + } + if (data.consistencyStrategy != null) { + message.consistencyStrategy = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.ConsistencyStrategyPB.fromObject(data.consistencyStrategy); + } + if (data.privateTransactionConfig != null) { + message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.fromObject(data.privateTransactionConfig); + } + return message; + } + toObject() { + const data: { + web3SigningCredential?: ReturnType; + transactionConfig?: ReturnType; + consistencyStrategy?: ReturnType; + privateTransactionConfig?: ReturnType; + } = {}; + if (this.web3SigningCredential != null) { + data.web3SigningCredential = this.web3SigningCredential.toObject(); + } + if (this.transactionConfig != null) { + data.transactionConfig = this.transactionConfig.toObject(); + } + if (this.consistencyStrategy != null) { + data.consistencyStrategy = this.consistencyStrategy.toObject(); + } + if (this.privateTransactionConfig != null) { + data.privateTransactionConfig = this.privateTransactionConfig.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_web3SigningCredential) + writer.writeMessage(451211679, this.web3SigningCredential, () => this.web3SigningCredential.serialize(writer)); + if (this.has_transactionConfig) + writer.writeMessage(478618563, this.transactionConfig, () => this.transactionConfig.serialize(writer)); + if (this.has_consistencyStrategy) + writer.writeMessage(86789548, this.consistencyStrategy, () => this.consistencyStrategy.serialize(writer)); + if (this.has_privateTransactionConfig) + writer.writeMessage(276796542, this.privateTransactionConfig, () => this.privateTransactionConfig.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RunTransactionRequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RunTransactionRequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 451211679: + reader.readMessage(message.web3SigningCredential, () => message.web3SigningCredential = dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialPB.deserialize(reader)); + break; + case 478618563: + reader.readMessage(message.transactionConfig, () => message.transactionConfig = dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuTransactionConfigPB.deserialize(reader)); + break; + case 86789548: + reader.readMessage(message.consistencyStrategy, () => message.consistencyStrategy = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.ConsistencyStrategyPB.deserialize(reader)); + break; + case 276796542: + reader.readMessage(message.privateTransactionConfig, () => message.privateTransactionConfig = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.BesuPrivateTransactionConfigPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RunTransactionRequestPB { + return RunTransactionRequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_response_pb.ts new file mode 100644 index 0000000000..fb91ccf3d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/run_transaction_response_pb.ts @@ -0,0 +1,80 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/run_transaction_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_transaction_receipt_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class RunTransactionResponsePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + transactionReceipt?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("transactionReceipt" in data && data.transactionReceipt != undefined) { + this.transactionReceipt = data.transactionReceipt; + } + } + } + get transactionReceipt() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB, 472834426) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB; + } + set transactionReceipt(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB) { + pb_1.Message.setWrapperField(this, 472834426, value); + } + get has_transactionReceipt() { + return pb_1.Message.getField(this, 472834426) != null; + } + static fromObject(data: { + transactionReceipt?: ReturnType; + }): RunTransactionResponsePB { + const message = new RunTransactionResponsePB({}); + if (data.transactionReceipt != null) { + message.transactionReceipt = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB.fromObject(data.transactionReceipt); + } + return message; + } + toObject() { + const data: { + transactionReceipt?: ReturnType; + } = {}; + if (this.transactionReceipt != null) { + data.transactionReceipt = this.transactionReceipt.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_transactionReceipt) + writer.writeMessage(472834426, this.transactionReceipt, () => this.transactionReceipt.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RunTransactionResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RunTransactionResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 472834426: + reader.readMessage(message.transactionReceipt, () => message.transactionReceipt = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3TransactionReceiptPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RunTransactionResponsePB { + return RunTransactionResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_request_pb.ts new file mode 100644 index 0000000000..42ee672815 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_request_pb.ts @@ -0,0 +1,122 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/sign_transaction_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class SignTransactionRequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + keychainId?: string; + keychainRef?: string; + transactionHash?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("keychainId" in data && data.keychainId != undefined) { + this.keychainId = data.keychainId; + } + if ("keychainRef" in data && data.keychainRef != undefined) { + this.keychainRef = data.keychainRef; + } + if ("transactionHash" in data && data.transactionHash != undefined) { + this.transactionHash = data.transactionHash; + } + } + } + get keychainId() { + return pb_1.Message.getFieldWithDefault(this, 14058372, "") as string; + } + set keychainId(value: string) { + pb_1.Message.setField(this, 14058372, value); + } + get keychainRef() { + return pb_1.Message.getFieldWithDefault(this, 101070193, "") as string; + } + set keychainRef(value: string) { + pb_1.Message.setField(this, 101070193, value); + } + get transactionHash() { + return pb_1.Message.getFieldWithDefault(this, 188901646, "") as string; + } + set transactionHash(value: string) { + pb_1.Message.setField(this, 188901646, value); + } + static fromObject(data: { + keychainId?: string; + keychainRef?: string; + transactionHash?: string; + }): SignTransactionRequestPB { + const message = new SignTransactionRequestPB({}); + if (data.keychainId != null) { + message.keychainId = data.keychainId; + } + if (data.keychainRef != null) { + message.keychainRef = data.keychainRef; + } + if (data.transactionHash != null) { + message.transactionHash = data.transactionHash; + } + return message; + } + toObject() { + const data: { + keychainId?: string; + keychainRef?: string; + transactionHash?: string; + } = {}; + if (this.keychainId != null) { + data.keychainId = this.keychainId; + } + if (this.keychainRef != null) { + data.keychainRef = this.keychainRef; + } + if (this.transactionHash != null) { + data.transactionHash = this.transactionHash; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.keychainId.length) + writer.writeString(14058372, this.keychainId); + if (this.keychainRef.length) + writer.writeString(101070193, this.keychainRef); + if (this.transactionHash.length) + writer.writeString(188901646, this.transactionHash); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SignTransactionRequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SignTransactionRequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 14058372: + message.keychainId = reader.readString(); + break; + case 101070193: + message.keychainRef = reader.readString(); + break; + case 188901646: + message.transactionHash = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SignTransactionRequestPB { + return SignTransactionRequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_response_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_response_pb.ts new file mode 100644 index 0000000000..76f12c2823 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/sign_transaction_response_pb.ts @@ -0,0 +1,76 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/sign_transaction_response_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class SignTransactionResponsePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + signature?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("signature" in data && data.signature != undefined) { + this.signature = data.signature; + } + } + } + get signature() { + return pb_1.Message.getFieldWithDefault(this, 536713401, "") as string; + } + set signature(value: string) { + pb_1.Message.setField(this, 536713401, value); + } + static fromObject(data: { + signature?: string; + }): SignTransactionResponsePB { + const message = new SignTransactionResponsePB({}); + if (data.signature != null) { + message.signature = data.signature; + } + return message; + } + toObject() { + const data: { + signature?: string; + } = {}; + if (this.signature != null) { + data.signature = this.signature; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.signature.length) + writer.writeString(536713401, this.signature); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SignTransactionResponsePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SignTransactionResponsePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 536713401: + message.signature = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SignTransactionResponsePB { + return SignTransactionResponsePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_pb.ts new file mode 100644 index 0000000000..a504480b17 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_pb.ts @@ -0,0 +1,16 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/watch_blocks_v1_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export enum WatchBlocksV1PB { + WatchBlocksV1PB_Subscribe = 0, + WatchBlocksV1PB_Next = 1, + WatchBlocksV1PB_Unsubscribe = 2, + WatchBlocksV1PB_Error = 3, + WatchBlocksV1PB_Complete = 4 + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_progress_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_progress_pb.ts new file mode 100644 index 0000000000..471a164c2f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_progress_pb.ts @@ -0,0 +1,80 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/watch_blocks_v1_progress_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_block_header_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class WatchBlocksV1ProgressPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + blockHeader?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("blockHeader" in data && data.blockHeader != undefined) { + this.blockHeader = data.blockHeader; + } + } + } + get blockHeader() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderPB, 18691451) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderPB; + } + set blockHeader(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderPB) { + pb_1.Message.setWrapperField(this, 18691451, value); + } + get has_blockHeader() { + return pb_1.Message.getField(this, 18691451) != null; + } + static fromObject(data: { + blockHeader?: ReturnType; + }): WatchBlocksV1ProgressPB { + const message = new WatchBlocksV1ProgressPB({}); + if (data.blockHeader != null) { + message.blockHeader = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderPB.fromObject(data.blockHeader); + } + return message; + } + toObject() { + const data: { + blockHeader?: ReturnType; + } = {}; + if (this.blockHeader != null) { + data.blockHeader = this.blockHeader.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_blockHeader) + writer.writeMessage(18691451, this.blockHeader, () => this.blockHeader.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): WatchBlocksV1ProgressPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new WatchBlocksV1ProgressPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 18691451: + reader.readMessage(message.blockHeader, () => message.blockHeader = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): WatchBlocksV1ProgressPB { + return WatchBlocksV1ProgressPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_request_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_request_pb.ts new file mode 100644 index 0000000000..17ac510f3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/watch_blocks_v1_request_pb.ts @@ -0,0 +1,77 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/watch_blocks_v1_request_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./watch_blocks_v1_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class WatchBlocksV1RequestPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + event?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("event" in data && data.event != undefined) { + this.event = data.event; + } + } + } + get event() { + return pb_1.Message.getFieldWithDefault(this, 96891546, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB.WatchBlocksV1PB_Subscribe) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB; + } + set event(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB) { + pb_1.Message.setField(this, 96891546, value); + } + static fromObject(data: { + event?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB; + }): WatchBlocksV1RequestPB { + const message = new WatchBlocksV1RequestPB({}); + if (data.event != null) { + message.event = data.event; + } + return message; + } + toObject() { + const data: { + event?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB; + } = {}; + if (this.event != null) { + data.event = this.event; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.event != dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB.WatchBlocksV1PB_Subscribe) + writer.writeEnum(96891546, this.event); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): WatchBlocksV1RequestPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new WatchBlocksV1RequestPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 96891546: + message.event = reader.readEnum(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): WatchBlocksV1RequestPB { + return WatchBlocksV1RequestPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_pb.ts new file mode 100644 index 0000000000..2a3eeb9f4f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_pb.ts @@ -0,0 +1,379 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_block_header_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_block_header_timestamp_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class Web3BlockHeaderPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + number?: number; + hash?: string; + parentHash?: string; + nonce?: string; + sha3Uncles?: string; + logsBloom?: string; + transactionRoot?: string; + stateRoot?: string; + receiptRoot?: string; + miner?: string; + extraData?: string; + gasLimit?: number; + gasUsed?: number; + timestamp?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("number" in data && data.number != undefined) { + this.number = data.number; + } + if ("hash" in data && data.hash != undefined) { + this.hash = data.hash; + } + if ("parentHash" in data && data.parentHash != undefined) { + this.parentHash = data.parentHash; + } + if ("nonce" in data && data.nonce != undefined) { + this.nonce = data.nonce; + } + if ("sha3Uncles" in data && data.sha3Uncles != undefined) { + this.sha3Uncles = data.sha3Uncles; + } + if ("logsBloom" in data && data.logsBloom != undefined) { + this.logsBloom = data.logsBloom; + } + if ("transactionRoot" in data && data.transactionRoot != undefined) { + this.transactionRoot = data.transactionRoot; + } + if ("stateRoot" in data && data.stateRoot != undefined) { + this.stateRoot = data.stateRoot; + } + if ("receiptRoot" in data && data.receiptRoot != undefined) { + this.receiptRoot = data.receiptRoot; + } + if ("miner" in data && data.miner != undefined) { + this.miner = data.miner; + } + if ("extraData" in data && data.extraData != undefined) { + this.extraData = data.extraData; + } + if ("gasLimit" in data && data.gasLimit != undefined) { + this.gasLimit = data.gasLimit; + } + if ("gasUsed" in data && data.gasUsed != undefined) { + this.gasUsed = data.gasUsed; + } + if ("timestamp" in data && data.timestamp != undefined) { + this.timestamp = data.timestamp; + } + } + } + get number() { + return pb_1.Message.getFieldWithDefault(this, 497493176, 0) as number; + } + set number(value: number) { + pb_1.Message.setField(this, 497493176, value); + } + get hash() { + return pb_1.Message.getFieldWithDefault(this, 3195150, "") as string; + } + set hash(value: string) { + pb_1.Message.setField(this, 3195150, value); + } + get parentHash() { + return pb_1.Message.getFieldWithDefault(this, 245049128, "") as string; + } + set parentHash(value: string) { + pb_1.Message.setField(this, 245049128, value); + } + get nonce() { + return pb_1.Message.getFieldWithDefault(this, 105002991, "") as string; + } + set nonce(value: string) { + pb_1.Message.setField(this, 105002991, value); + } + get sha3Uncles() { + return pb_1.Message.getFieldWithDefault(this, 373514458, "") as string; + } + set sha3Uncles(value: string) { + pb_1.Message.setField(this, 373514458, value); + } + get logsBloom() { + return pb_1.Message.getFieldWithDefault(this, 399161966, "") as string; + } + set logsBloom(value: string) { + pb_1.Message.setField(this, 399161966, value); + } + get transactionRoot() { + return pb_1.Message.getFieldWithDefault(this, 189212898, "") as string; + } + set transactionRoot(value: string) { + pb_1.Message.setField(this, 189212898, value); + } + get stateRoot() { + return pb_1.Message.getFieldWithDefault(this, 475330288, "") as string; + } + set stateRoot(value: string) { + pb_1.Message.setField(this, 475330288, value); + } + get receiptRoot() { + return pb_1.Message.getFieldWithDefault(this, 422939453, "") as string; + } + set receiptRoot(value: string) { + pb_1.Message.setField(this, 422939453, value); + } + get miner() { + return pb_1.Message.getFieldWithDefault(this, 103900799, "") as string; + } + set miner(value: string) { + pb_1.Message.setField(this, 103900799, value); + } + get extraData() { + return pb_1.Message.getFieldWithDefault(this, 253792294, "") as string; + } + set extraData(value: string) { + pb_1.Message.setField(this, 253792294, value); + } + get gasLimit() { + return pb_1.Message.getFieldWithDefault(this, 9229217, 0) as number; + } + set gasLimit(value: number) { + pb_1.Message.setField(this, 9229217, value); + } + get gasUsed() { + return pb_1.Message.getFieldWithDefault(this, 190522826, 0) as number; + } + set gasUsed(value: number) { + pb_1.Message.setField(this, 190522826, value); + } + get timestamp() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB, 55126294) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB; + } + set timestamp(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB) { + pb_1.Message.setWrapperField(this, 55126294, value); + } + get has_timestamp() { + return pb_1.Message.getField(this, 55126294) != null; + } + static fromObject(data: { + number?: number; + hash?: string; + parentHash?: string; + nonce?: string; + sha3Uncles?: string; + logsBloom?: string; + transactionRoot?: string; + stateRoot?: string; + receiptRoot?: string; + miner?: string; + extraData?: string; + gasLimit?: number; + gasUsed?: number; + timestamp?: ReturnType; + }): Web3BlockHeaderPB { + const message = new Web3BlockHeaderPB({}); + if (data.number != null) { + message.number = data.number; + } + if (data.hash != null) { + message.hash = data.hash; + } + if (data.parentHash != null) { + message.parentHash = data.parentHash; + } + if (data.nonce != null) { + message.nonce = data.nonce; + } + if (data.sha3Uncles != null) { + message.sha3Uncles = data.sha3Uncles; + } + if (data.logsBloom != null) { + message.logsBloom = data.logsBloom; + } + if (data.transactionRoot != null) { + message.transactionRoot = data.transactionRoot; + } + if (data.stateRoot != null) { + message.stateRoot = data.stateRoot; + } + if (data.receiptRoot != null) { + message.receiptRoot = data.receiptRoot; + } + if (data.miner != null) { + message.miner = data.miner; + } + if (data.extraData != null) { + message.extraData = data.extraData; + } + if (data.gasLimit != null) { + message.gasLimit = data.gasLimit; + } + if (data.gasUsed != null) { + message.gasUsed = data.gasUsed; + } + if (data.timestamp != null) { + message.timestamp = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.fromObject(data.timestamp); + } + return message; + } + toObject() { + const data: { + number?: number; + hash?: string; + parentHash?: string; + nonce?: string; + sha3Uncles?: string; + logsBloom?: string; + transactionRoot?: string; + stateRoot?: string; + receiptRoot?: string; + miner?: string; + extraData?: string; + gasLimit?: number; + gasUsed?: number; + timestamp?: ReturnType; + } = {}; + if (this.number != null) { + data.number = this.number; + } + if (this.hash != null) { + data.hash = this.hash; + } + if (this.parentHash != null) { + data.parentHash = this.parentHash; + } + if (this.nonce != null) { + data.nonce = this.nonce; + } + if (this.sha3Uncles != null) { + data.sha3Uncles = this.sha3Uncles; + } + if (this.logsBloom != null) { + data.logsBloom = this.logsBloom; + } + if (this.transactionRoot != null) { + data.transactionRoot = this.transactionRoot; + } + if (this.stateRoot != null) { + data.stateRoot = this.stateRoot; + } + if (this.receiptRoot != null) { + data.receiptRoot = this.receiptRoot; + } + if (this.miner != null) { + data.miner = this.miner; + } + if (this.extraData != null) { + data.extraData = this.extraData; + } + if (this.gasLimit != null) { + data.gasLimit = this.gasLimit; + } + if (this.gasUsed != null) { + data.gasUsed = this.gasUsed; + } + if (this.timestamp != null) { + data.timestamp = this.timestamp.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.number != 0) + writer.writeFloat(497493176, this.number); + if (this.hash.length) + writer.writeString(3195150, this.hash); + if (this.parentHash.length) + writer.writeString(245049128, this.parentHash); + if (this.nonce.length) + writer.writeString(105002991, this.nonce); + if (this.sha3Uncles.length) + writer.writeString(373514458, this.sha3Uncles); + if (this.logsBloom.length) + writer.writeString(399161966, this.logsBloom); + if (this.transactionRoot.length) + writer.writeString(189212898, this.transactionRoot); + if (this.stateRoot.length) + writer.writeString(475330288, this.stateRoot); + if (this.receiptRoot.length) + writer.writeString(422939453, this.receiptRoot); + if (this.miner.length) + writer.writeString(103900799, this.miner); + if (this.extraData.length) + writer.writeString(253792294, this.extraData); + if (this.gasLimit != 0) + writer.writeInt32(9229217, this.gasLimit); + if (this.gasUsed != 0) + writer.writeInt32(190522826, this.gasUsed); + if (this.has_timestamp) + writer.writeMessage(55126294, this.timestamp, () => this.timestamp.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Web3BlockHeaderPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Web3BlockHeaderPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 497493176: + message.number = reader.readFloat(); + break; + case 3195150: + message.hash = reader.readString(); + break; + case 245049128: + message.parentHash = reader.readString(); + break; + case 105002991: + message.nonce = reader.readString(); + break; + case 373514458: + message.sha3Uncles = reader.readString(); + break; + case 399161966: + message.logsBloom = reader.readString(); + break; + case 189212898: + message.transactionRoot = reader.readString(); + break; + case 475330288: + message.stateRoot = reader.readString(); + break; + case 422939453: + message.receiptRoot = reader.readString(); + break; + case 103900799: + message.miner = reader.readString(); + break; + case 253792294: + message.extraData = reader.readString(); + break; + case 9229217: + message.gasLimit = reader.readInt32(); + break; + case 190522826: + message.gasUsed = reader.readInt32(); + break; + case 55126294: + reader.readMessage(message.timestamp, () => message.timestamp = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3BlockHeaderTimestampPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Web3BlockHeaderPB { + return Web3BlockHeaderPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_timestamp_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_timestamp_pb.ts new file mode 100644 index 0000000000..d6aed612f7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_block_header_timestamp_pb.ts @@ -0,0 +1,49 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_block_header_timestamp_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class Web3BlockHeaderTimestampPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | {}) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { } + } + static fromObject(data: {}): Web3BlockHeaderTimestampPB { + const message = new Web3BlockHeaderTimestampPB({}); + return message; + } + toObject() { + const data: {} = {}; + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Web3BlockHeaderTimestampPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Web3BlockHeaderTimestampPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Web3BlockHeaderTimestampPB { + return Web3BlockHeaderTimestampPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_cactus_keychain_ref_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_cactus_keychain_ref_pb.ts new file mode 100644 index 0000000000..d1c115b2c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_cactus_keychain_ref_pb.ts @@ -0,0 +1,146 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_signing_credential_cactus_keychain_ref_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_signing_credential_type_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class Web3SigningCredentialCactusKeychainRefPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + keychainEntryKey?: string; + keychainId?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("ethAccount" in data && data.ethAccount != undefined) { + this.ethAccount = data.ethAccount; + } + if ("keychainEntryKey" in data && data.keychainEntryKey != undefined) { + this.keychainEntryKey = data.keychainEntryKey; + } + if ("keychainId" in data && data.keychainId != undefined) { + this.keychainId = data.keychainId; + } + } + } + get type() { + return pb_1.Message.getFieldWithDefault(this, 3575610, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + } + set type(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB) { + pb_1.Message.setField(this, 3575610, value); + } + get ethAccount() { + return pb_1.Message.getFieldWithDefault(this, 528332204, "") as string; + } + set ethAccount(value: string) { + pb_1.Message.setField(this, 528332204, value); + } + get keychainEntryKey() { + return pb_1.Message.getFieldWithDefault(this, 210645395, "") as string; + } + set keychainEntryKey(value: string) { + pb_1.Message.setField(this, 210645395, value); + } + get keychainId() { + return pb_1.Message.getFieldWithDefault(this, 14058372, "") as string; + } + set keychainId(value: string) { + pb_1.Message.setField(this, 14058372, value); + } + static fromObject(data: { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + keychainEntryKey?: string; + keychainId?: string; + }): Web3SigningCredentialCactusKeychainRefPB { + const message = new Web3SigningCredentialCactusKeychainRefPB({}); + if (data.type != null) { + message.type = data.type; + } + if (data.ethAccount != null) { + message.ethAccount = data.ethAccount; + } + if (data.keychainEntryKey != null) { + message.keychainEntryKey = data.keychainEntryKey; + } + if (data.keychainId != null) { + message.keychainId = data.keychainId; + } + return message; + } + toObject() { + const data: { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + keychainEntryKey?: string; + keychainId?: string; + } = {}; + if (this.type != null) { + data.type = this.type; + } + if (this.ethAccount != null) { + data.ethAccount = this.ethAccount; + } + if (this.keychainEntryKey != null) { + data.keychainEntryKey = this.keychainEntryKey; + } + if (this.keychainId != null) { + data.keychainId = this.keychainId; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.type != dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) + writer.writeEnum(3575610, this.type); + if (this.ethAccount.length) + writer.writeString(528332204, this.ethAccount); + if (this.keychainEntryKey.length) + writer.writeString(210645395, this.keychainEntryKey); + if (this.keychainId.length) + writer.writeString(14058372, this.keychainId); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Web3SigningCredentialCactusKeychainRefPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Web3SigningCredentialCactusKeychainRefPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 3575610: + message.type = reader.readEnum(); + break; + case 528332204: + message.ethAccount = reader.readString(); + break; + case 210645395: + message.keychainEntryKey = reader.readString(); + break; + case 14058372: + message.keychainId = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Web3SigningCredentialCactusKeychainRefPB { + return Web3SigningCredentialCactusKeychainRefPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_none_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_none_pb.ts new file mode 100644 index 0000000000..e475a7ae99 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_none_pb.ts @@ -0,0 +1,77 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_signing_credential_none_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_signing_credential_type_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class Web3SigningCredentialNonePB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + } + } + get type() { + return pb_1.Message.getFieldWithDefault(this, 3575610, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + } + set type(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB) { + pb_1.Message.setField(this, 3575610, value); + } + static fromObject(data: { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + }): Web3SigningCredentialNonePB { + const message = new Web3SigningCredentialNonePB({}); + if (data.type != null) { + message.type = data.type; + } + return message; + } + toObject() { + const data: { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + } = {}; + if (this.type != null) { + data.type = this.type; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.type != dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) + writer.writeEnum(3575610, this.type); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Web3SigningCredentialNonePB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Web3SigningCredentialNonePB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 3575610: + message.type = reader.readEnum(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Web3SigningCredentialNonePB { + return Web3SigningCredentialNonePB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_pb.ts new file mode 100644 index 0000000000..c67f531563 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_pb.ts @@ -0,0 +1,172 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_signing_credential_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_signing_credential_cactus_keychain_ref_pb"; +import * as dependency_3 from "./web3_signing_credential_none_pb"; +import * as dependency_4 from "./web3_signing_credential_private_key_hex_pb"; +import * as dependency_5 from "./web3_signing_credential_type_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class Web3SigningCredentialPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + type?: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + keychainEntryKey?: string; + keychainId?: string; + secret?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("ethAccount" in data && data.ethAccount != undefined) { + this.ethAccount = data.ethAccount; + } + if ("keychainEntryKey" in data && data.keychainEntryKey != undefined) { + this.keychainEntryKey = data.keychainEntryKey; + } + if ("keychainId" in data && data.keychainId != undefined) { + this.keychainId = data.keychainId; + } + if ("secret" in data && data.secret != undefined) { + this.secret = data.secret; + } + } + } + get type() { + return pb_1.Message.getFieldWithDefault(this, 3575610, dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) as dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + } + set type(value: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB) { + pb_1.Message.setField(this, 3575610, value); + } + get ethAccount() { + return pb_1.Message.getFieldWithDefault(this, 528332204, "") as string; + } + set ethAccount(value: string) { + pb_1.Message.setField(this, 528332204, value); + } + get keychainEntryKey() { + return pb_1.Message.getFieldWithDefault(this, 210645395, "") as string; + } + set keychainEntryKey(value: string) { + pb_1.Message.setField(this, 210645395, value); + } + get keychainId() { + return pb_1.Message.getFieldWithDefault(this, 14058372, "") as string; + } + set keychainId(value: string) { + pb_1.Message.setField(this, 14058372, value); + } + get secret() { + return pb_1.Message.getFieldWithDefault(this, 369406289, "") as string; + } + set secret(value: string) { + pb_1.Message.setField(this, 369406289, value); + } + static fromObject(data: { + type?: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + keychainEntryKey?: string; + keychainId?: string; + secret?: string; + }): Web3SigningCredentialPB { + const message = new Web3SigningCredentialPB({}); + if (data.type != null) { + message.type = data.type; + } + if (data.ethAccount != null) { + message.ethAccount = data.ethAccount; + } + if (data.keychainEntryKey != null) { + message.keychainEntryKey = data.keychainEntryKey; + } + if (data.keychainId != null) { + message.keychainId = data.keychainId; + } + if (data.secret != null) { + message.secret = data.secret; + } + return message; + } + toObject() { + const data: { + type?: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + keychainEntryKey?: string; + keychainId?: string; + secret?: string; + } = {}; + if (this.type != null) { + data.type = this.type; + } + if (this.ethAccount != null) { + data.ethAccount = this.ethAccount; + } + if (this.keychainEntryKey != null) { + data.keychainEntryKey = this.keychainEntryKey; + } + if (this.keychainId != null) { + data.keychainId = this.keychainId; + } + if (this.secret != null) { + data.secret = this.secret; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.type != dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) + writer.writeEnum(3575610, this.type); + if (this.ethAccount.length) + writer.writeString(528332204, this.ethAccount); + if (this.keychainEntryKey.length) + writer.writeString(210645395, this.keychainEntryKey); + if (this.keychainId.length) + writer.writeString(14058372, this.keychainId); + if (this.secret.length) + writer.writeString(369406289, this.secret); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Web3SigningCredentialPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Web3SigningCredentialPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 3575610: + message.type = reader.readEnum(); + break; + case 528332204: + message.ethAccount = reader.readString(); + break; + case 210645395: + message.keychainEntryKey = reader.readString(); + break; + case 14058372: + message.keychainId = reader.readString(); + break; + case 369406289: + message.secret = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Web3SigningCredentialPB { + return Web3SigningCredentialPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_private_key_hex_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_private_key_hex_pb.ts new file mode 100644 index 0000000000..def9a1f71b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_private_key_hex_pb.ts @@ -0,0 +1,123 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_signing_credential_private_key_hex_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as dependency_2 from "./web3_signing_credential_type_pb"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class Web3SigningCredentialPrivateKeyHexPB extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + secret?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + if ("ethAccount" in data && data.ethAccount != undefined) { + this.ethAccount = data.ethAccount; + } + if ("secret" in data && data.secret != undefined) { + this.secret = data.secret; + } + } + } + get type() { + return pb_1.Message.getFieldWithDefault(this, 3575610, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + } + set type(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB) { + pb_1.Message.setField(this, 3575610, value); + } + get ethAccount() { + return pb_1.Message.getFieldWithDefault(this, 528332204, "") as string; + } + set ethAccount(value: string) { + pb_1.Message.setField(this, 528332204, value); + } + get secret() { + return pb_1.Message.getFieldWithDefault(this, 369406289, "") as string; + } + set secret(value: string) { + pb_1.Message.setField(this, 369406289, value); + } + static fromObject(data: { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + secret?: string; + }): Web3SigningCredentialPrivateKeyHexPB { + const message = new Web3SigningCredentialPrivateKeyHexPB({}); + if (data.type != null) { + message.type = data.type; + } + if (data.ethAccount != null) { + message.ethAccount = data.ethAccount; + } + if (data.secret != null) { + message.secret = data.secret; + } + return message; + } + toObject() { + const data: { + type?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB; + ethAccount?: string; + secret?: string; + } = {}; + if (this.type != null) { + data.type = this.type; + } + if (this.ethAccount != null) { + data.ethAccount = this.ethAccount; + } + if (this.secret != null) { + data.secret = this.secret; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.type != dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.Web3SigningCredentialTypePB.Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF) + writer.writeEnum(3575610, this.type); + if (this.ethAccount.length) + writer.writeString(528332204, this.ethAccount); + if (this.secret.length) + writer.writeString(369406289, this.secret); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Web3SigningCredentialPrivateKeyHexPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Web3SigningCredentialPrivateKeyHexPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 3575610: + message.type = reader.readEnum(); + break; + case 528332204: + message.ethAccount = reader.readString(); + break; + case 369406289: + message.secret = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Web3SigningCredentialPrivateKeyHexPB { + return Web3SigningCredentialPrivateKeyHexPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_type_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_type_pb.ts new file mode 100644 index 0000000000..ae4da26e1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_signing_credential_type_pb.ts @@ -0,0 +1,15 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_signing_credential_type_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export enum Web3SigningCredentialTypePB { + Web3SigningCredentialTypePB_CACTUS_KEYCHAIN_REF = 0, + Web3SigningCredentialTypePB_GETH_KEYCHAIN_PASSWORD = 1, + Web3SigningCredentialTypePB_PRIVATE_KEY_HEX = 2, + Web3SigningCredentialTypePB_NONE = 3 + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_transaction_receipt_pb.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_transaction_receipt_pb.ts new file mode 100644 index 0000000000..5347618eb8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/models/web3_transaction_receipt_pb.ts @@ -0,0 +1,273 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: models/web3_transaction_receipt_pb.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/any"; +import * as pb_1 from "google-protobuf"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu { + export class Web3TransactionReceiptPB extends pb_1.Message { + #one_of_decls: number[][] = [[214641282]]; + constructor(data?: any[] | ({ + status?: boolean; + transactionHash?: string; + transactionIndex?: number; + blockHash?: string; + blockNumber?: number; + gasUsed?: number; + from?: string; + to?: string; + } & (({ + contractAddress?: string; + })))) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("status" in data && data.status != undefined) { + this.status = data.status; + } + if ("transactionHash" in data && data.transactionHash != undefined) { + this.transactionHash = data.transactionHash; + } + if ("transactionIndex" in data && data.transactionIndex != undefined) { + this.transactionIndex = data.transactionIndex; + } + if ("blockHash" in data && data.blockHash != undefined) { + this.blockHash = data.blockHash; + } + if ("blockNumber" in data && data.blockNumber != undefined) { + this.blockNumber = data.blockNumber; + } + if ("gasUsed" in data && data.gasUsed != undefined) { + this.gasUsed = data.gasUsed; + } + if ("contractAddress" in data && data.contractAddress != undefined) { + this.contractAddress = data.contractAddress; + } + if ("from" in data && data.from != undefined) { + this.from = data.from; + } + if ("to" in data && data.to != undefined) { + this.to = data.to; + } + } + } + get status() { + return pb_1.Message.getFieldWithDefault(this, 355610639, false) as boolean; + } + set status(value: boolean) { + pb_1.Message.setField(this, 355610639, value); + } + get transactionHash() { + return pb_1.Message.getFieldWithDefault(this, 188901646, "") as string; + } + set transactionHash(value: string) { + pb_1.Message.setField(this, 188901646, value); + } + get transactionIndex() { + return pb_1.Message.getFieldWithDefault(this, 488538260, 0) as number; + } + set transactionIndex(value: number) { + pb_1.Message.setField(this, 488538260, value); + } + get blockHash() { + return pb_1.Message.getFieldWithDefault(this, 335211324, "") as string; + } + set blockHash(value: string) { + pb_1.Message.setField(this, 335211324, value); + } + get blockNumber() { + return pb_1.Message.getFieldWithDefault(this, 205598263, 0) as number; + } + set blockNumber(value: number) { + pb_1.Message.setField(this, 205598263, value); + } + get gasUsed() { + return pb_1.Message.getFieldWithDefault(this, 190522826, 0) as number; + } + set gasUsed(value: number) { + pb_1.Message.setField(this, 190522826, value); + } + get contractAddress() { + return pb_1.Message.getFieldWithDefault(this, 214641282, "") as string; + } + set contractAddress(value: string) { + pb_1.Message.setOneofField(this, 214641282, this.#one_of_decls[0], value); + } + get has_contractAddress() { + return pb_1.Message.getField(this, 214641282) != null; + } + get from() { + return pb_1.Message.getFieldWithDefault(this, 3151786, "") as string; + } + set from(value: string) { + pb_1.Message.setField(this, 3151786, value); + } + get to() { + return pb_1.Message.getFieldWithDefault(this, 3707, "") as string; + } + set to(value: string) { + pb_1.Message.setField(this, 3707, value); + } + get _contractAddress() { + const cases: { + [index: number]: "none" | "contractAddress"; + } = { + 0: "none", + 214641282: "contractAddress" + }; + return cases[pb_1.Message.computeOneofCase(this, [214641282])]; + } + static fromObject(data: { + status?: boolean; + transactionHash?: string; + transactionIndex?: number; + blockHash?: string; + blockNumber?: number; + gasUsed?: number; + contractAddress?: string; + from?: string; + to?: string; + }): Web3TransactionReceiptPB { + const message = new Web3TransactionReceiptPB({}); + if (data.status != null) { + message.status = data.status; + } + if (data.transactionHash != null) { + message.transactionHash = data.transactionHash; + } + if (data.transactionIndex != null) { + message.transactionIndex = data.transactionIndex; + } + if (data.blockHash != null) { + message.blockHash = data.blockHash; + } + if (data.blockNumber != null) { + message.blockNumber = data.blockNumber; + } + if (data.gasUsed != null) { + message.gasUsed = data.gasUsed; + } + if (data.contractAddress != null) { + message.contractAddress = data.contractAddress; + } + if (data.from != null) { + message.from = data.from; + } + if (data.to != null) { + message.to = data.to; + } + return message; + } + toObject() { + const data: { + status?: boolean; + transactionHash?: string; + transactionIndex?: number; + blockHash?: string; + blockNumber?: number; + gasUsed?: number; + contractAddress?: string; + from?: string; + to?: string; + } = {}; + if (this.status != null) { + data.status = this.status; + } + if (this.transactionHash != null) { + data.transactionHash = this.transactionHash; + } + if (this.transactionIndex != null) { + data.transactionIndex = this.transactionIndex; + } + if (this.blockHash != null) { + data.blockHash = this.blockHash; + } + if (this.blockNumber != null) { + data.blockNumber = this.blockNumber; + } + if (this.gasUsed != null) { + data.gasUsed = this.gasUsed; + } + if (this.contractAddress != null) { + data.contractAddress = this.contractAddress; + } + if (this.from != null) { + data.from = this.from; + } + if (this.to != null) { + data.to = this.to; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.status != false) + writer.writeBool(355610639, this.status); + if (this.transactionHash.length) + writer.writeString(188901646, this.transactionHash); + if (this.transactionIndex != 0) + writer.writeFloat(488538260, this.transactionIndex); + if (this.blockHash.length) + writer.writeString(335211324, this.blockHash); + if (this.blockNumber != 0) + writer.writeFloat(205598263, this.blockNumber); + if (this.gasUsed != 0) + writer.writeFloat(190522826, this.gasUsed); + if (this.has_contractAddress) + writer.writeString(214641282, this.contractAddress); + if (this.from.length) + writer.writeString(3151786, this.from); + if (this.to.length) + writer.writeString(3707, this.to); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Web3TransactionReceiptPB { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Web3TransactionReceiptPB(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 355610639: + message.status = reader.readBool(); + break; + case 188901646: + message.transactionHash = reader.readString(); + break; + case 488538260: + message.transactionIndex = reader.readFloat(); + break; + case 335211324: + message.blockHash = reader.readString(); + break; + case 205598263: + message.blockNumber = reader.readFloat(); + break; + case 190522826: + message.gasUsed = reader.readFloat(); + break; + case 214641282: + message.contractAddress = reader.readString(); + break; + case 3151786: + message.from = reader.readString(); + break; + case 3707: + message.to = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Web3TransactionReceiptPB { + return Web3TransactionReceiptPB.deserialize(bytes); + } + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/besu-grpc-svc-streams.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/besu-grpc-svc-streams.ts new file mode 100644 index 0000000000..b9d22bab85 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/besu-grpc-svc-streams.ts @@ -0,0 +1,57 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: services/besu-grpc-svc-streams.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../models/watch_blocks_v1_progress_pb"; +import * as dependency_2 from "./../models/watch_blocks_v1_request_pb"; +import * as grpc_1 from "@grpc/grpc-js"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.besuservice { + interface GrpcUnaryServiceInterface { + (message: P, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + (message: P, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + (message: P, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + (message: P, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + } + interface GrpcStreamServiceInterface { + (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream; + (message: P, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream; + } + interface GrpWritableServiceInterface { + (metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + (metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + (options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + (callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + } + interface GrpcChunkServiceInterface { + (metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream; + (options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream; + } + interface GrpcPromiseServiceInterface { + (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): Promise; + (message: P, options?: grpc_1.CallOptions): Promise; + } + export abstract class UnimplementedBesuGrpcSvcStreamsService { + static definition = { + WatchBlocksV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.besuservice.BesuGrpcSvcStreams/WatchBlocksV1", + requestStream: true, + responseStream: true, + requestSerialize: (message: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1RequestPB) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1RequestPB.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_1.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1ProgressPB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_1.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1ProgressPB.deserialize(new Uint8Array(bytes)) + } + }; + [method: string]: grpc_1.UntypedHandleCall; + abstract WatchBlocksV1(call: grpc_1.ServerDuplexStream): void; + } + export class BesuGrpcSvcStreamsClient extends grpc_1.makeGenericClientConstructor(UnimplementedBesuGrpcSvcStreamsService.definition, "BesuGrpcSvcStreams", {}) { + constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial) { + super(address, credentials, options); + } + WatchBlocksV1: GrpcChunkServiceInterface = (metadata?: grpc_1.Metadata | grpc_1.CallOptions, options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream => { + return super.WatchBlocksV1(metadata, options); + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts new file mode 100644 index 0000000000..eb183bbef1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/generated/proto/protoc-gen-ts/services/default_service.ts @@ -0,0 +1,969 @@ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.19.1 + * source: services/default_service.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../google/protobuf/empty"; +import * as dependency_2 from "./../models/deploy_contract_solidity_bytecode_v1_request_pb"; +import * as dependency_3 from "./../models/deploy_contract_solidity_bytecode_v1_response_pb"; +import * as dependency_4 from "./../models/get_balance_v1_request_pb"; +import * as dependency_5 from "./../models/get_balance_v1_response_pb"; +import * as dependency_6 from "./../models/get_besu_record_v1_request_pb"; +import * as dependency_7 from "./../models/get_besu_record_v1_response_pb"; +import * as dependency_8 from "./../models/get_block_v1_request_pb"; +import * as dependency_9 from "./../models/get_block_v1_response_pb"; +import * as dependency_10 from "./../models/get_past_logs_v1_request_pb"; +import * as dependency_11 from "./../models/get_past_logs_v1_response_pb"; +import * as dependency_12 from "./../models/get_transaction_v1_request_pb"; +import * as dependency_13 from "./../models/get_transaction_v1_response_pb"; +import * as dependency_14 from "./../models/invoke_contract_v1_request_pb"; +import * as dependency_15 from "./../models/invoke_contract_v1_response_pb"; +import * as dependency_16 from "./../models/run_transaction_request_pb"; +import * as dependency_17 from "./../models/run_transaction_response_pb"; +import * as dependency_18 from "./../models/sign_transaction_request_pb"; +import * as dependency_19 from "./../models/sign_transaction_response_pb"; +import * as pb_1 from "google-protobuf"; +import * as grpc_1 from "@grpc/grpc-js"; +export namespace org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice { + export class DeployContractSolBytecodeV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + deployContractSolidityBytecodeV1RequestPB?: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("deployContractSolidityBytecodeV1RequestPB" in data && data.deployContractSolidityBytecodeV1RequestPB != undefined) { + this.deployContractSolidityBytecodeV1RequestPB = data.deployContractSolidityBytecodeV1RequestPB; + } + } + } + get deployContractSolidityBytecodeV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB, 1) as dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB; + } + set deployContractSolidityBytecodeV1RequestPB(value: dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_deployContractSolidityBytecodeV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + deployContractSolidityBytecodeV1RequestPB?: ReturnType; + }): DeployContractSolBytecodeV1Request { + const message = new DeployContractSolBytecodeV1Request({}); + if (data.deployContractSolidityBytecodeV1RequestPB != null) { + message.deployContractSolidityBytecodeV1RequestPB = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB.fromObject(data.deployContractSolidityBytecodeV1RequestPB); + } + return message; + } + toObject() { + const data: { + deployContractSolidityBytecodeV1RequestPB?: ReturnType; + } = {}; + if (this.deployContractSolidityBytecodeV1RequestPB != null) { + data.deployContractSolidityBytecodeV1RequestPB = this.deployContractSolidityBytecodeV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_deployContractSolidityBytecodeV1RequestPB) + writer.writeMessage(1, this.deployContractSolidityBytecodeV1RequestPB, () => this.deployContractSolidityBytecodeV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DeployContractSolBytecodeV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeployContractSolBytecodeV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.deployContractSolidityBytecodeV1RequestPB, () => message.deployContractSolidityBytecodeV1RequestPB = dependency_2.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): DeployContractSolBytecodeV1Request { + return DeployContractSolBytecodeV1Request.deserialize(bytes); + } + } + export class GetBalanceV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + getBalanceV1RequestPB?: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("getBalanceV1RequestPB" in data && data.getBalanceV1RequestPB != undefined) { + this.getBalanceV1RequestPB = data.getBalanceV1RequestPB; + } + } + } + get getBalanceV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB, 1) as dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB; + } + set getBalanceV1RequestPB(value: dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_getBalanceV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + getBalanceV1RequestPB?: ReturnType; + }): GetBalanceV1Request { + const message = new GetBalanceV1Request({}); + if (data.getBalanceV1RequestPB != null) { + message.getBalanceV1RequestPB = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB.fromObject(data.getBalanceV1RequestPB); + } + return message; + } + toObject() { + const data: { + getBalanceV1RequestPB?: ReturnType; + } = {}; + if (this.getBalanceV1RequestPB != null) { + data.getBalanceV1RequestPB = this.getBalanceV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_getBalanceV1RequestPB) + writer.writeMessage(1, this.getBalanceV1RequestPB, () => this.getBalanceV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBalanceV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBalanceV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.getBalanceV1RequestPB, () => message.getBalanceV1RequestPB = dependency_4.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBalanceV1Request { + return GetBalanceV1Request.deserialize(bytes); + } + } + export class GetBesuRecordV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + getBesuRecordV1RequestPB?: dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("getBesuRecordV1RequestPB" in data && data.getBesuRecordV1RequestPB != undefined) { + this.getBesuRecordV1RequestPB = data.getBesuRecordV1RequestPB; + } + } + } + get getBesuRecordV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB, 1) as dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB; + } + set getBesuRecordV1RequestPB(value: dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_getBesuRecordV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + getBesuRecordV1RequestPB?: ReturnType; + }): GetBesuRecordV1Request { + const message = new GetBesuRecordV1Request({}); + if (data.getBesuRecordV1RequestPB != null) { + message.getBesuRecordV1RequestPB = dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB.fromObject(data.getBesuRecordV1RequestPB); + } + return message; + } + toObject() { + const data: { + getBesuRecordV1RequestPB?: ReturnType; + } = {}; + if (this.getBesuRecordV1RequestPB != null) { + data.getBesuRecordV1RequestPB = this.getBesuRecordV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_getBesuRecordV1RequestPB) + writer.writeMessage(1, this.getBesuRecordV1RequestPB, () => this.getBesuRecordV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBesuRecordV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBesuRecordV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.getBesuRecordV1RequestPB, () => message.getBesuRecordV1RequestPB = dependency_6.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBesuRecordV1Request { + return GetBesuRecordV1Request.deserialize(bytes); + } + } + export class GetBlockV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + getBlockV1RequestPB?: dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("getBlockV1RequestPB" in data && data.getBlockV1RequestPB != undefined) { + this.getBlockV1RequestPB = data.getBlockV1RequestPB; + } + } + } + get getBlockV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB, 1) as dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB; + } + set getBlockV1RequestPB(value: dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_getBlockV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + getBlockV1RequestPB?: ReturnType; + }): GetBlockV1Request { + const message = new GetBlockV1Request({}); + if (data.getBlockV1RequestPB != null) { + message.getBlockV1RequestPB = dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB.fromObject(data.getBlockV1RequestPB); + } + return message; + } + toObject() { + const data: { + getBlockV1RequestPB?: ReturnType; + } = {}; + if (this.getBlockV1RequestPB != null) { + data.getBlockV1RequestPB = this.getBlockV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_getBlockV1RequestPB) + writer.writeMessage(1, this.getBlockV1RequestPB, () => this.getBlockV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetBlockV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetBlockV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.getBlockV1RequestPB, () => message.getBlockV1RequestPB = dependency_8.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetBlockV1Request { + return GetBlockV1Request.deserialize(bytes); + } + } + export class GetOpenApiSpecV1Response extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + data?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + } + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set data(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + data?: string; + }): GetOpenApiSpecV1Response { + const message = new GetOpenApiSpecV1Response({}); + if (data.data != null) { + message.data = data.data; + } + return message; + } + toObject() { + const data: { + data?: string; + } = {}; + if (this.data != null) { + data.data = this.data; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.data.length) + writer.writeString(1, this.data); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetOpenApiSpecV1Response { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetOpenApiSpecV1Response(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.data = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetOpenApiSpecV1Response { + return GetOpenApiSpecV1Response.deserialize(bytes); + } + } + export class GetPastLogsV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + getPastLogsV1RequestPB?: dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("getPastLogsV1RequestPB" in data && data.getPastLogsV1RequestPB != undefined) { + this.getPastLogsV1RequestPB = data.getPastLogsV1RequestPB; + } + } + } + get getPastLogsV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB, 1) as dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB; + } + set getPastLogsV1RequestPB(value: dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_getPastLogsV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + getPastLogsV1RequestPB?: ReturnType; + }): GetPastLogsV1Request { + const message = new GetPastLogsV1Request({}); + if (data.getPastLogsV1RequestPB != null) { + message.getPastLogsV1RequestPB = dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB.fromObject(data.getPastLogsV1RequestPB); + } + return message; + } + toObject() { + const data: { + getPastLogsV1RequestPB?: ReturnType; + } = {}; + if (this.getPastLogsV1RequestPB != null) { + data.getPastLogsV1RequestPB = this.getPastLogsV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_getPastLogsV1RequestPB) + writer.writeMessage(1, this.getPastLogsV1RequestPB, () => this.getPastLogsV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetPastLogsV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetPastLogsV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.getPastLogsV1RequestPB, () => message.getPastLogsV1RequestPB = dependency_10.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetPastLogsV1Request { + return GetPastLogsV1Request.deserialize(bytes); + } + } + export class GetPrometheusMetricsV1Response extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + data?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("data" in data && data.data != undefined) { + this.data = data.data; + } + } + } + get data() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set data(value: string) { + pb_1.Message.setField(this, 1, value); + } + static fromObject(data: { + data?: string; + }): GetPrometheusMetricsV1Response { + const message = new GetPrometheusMetricsV1Response({}); + if (data.data != null) { + message.data = data.data; + } + return message; + } + toObject() { + const data: { + data?: string; + } = {}; + if (this.data != null) { + data.data = this.data; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.data.length) + writer.writeString(1, this.data); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetPrometheusMetricsV1Response { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetPrometheusMetricsV1Response(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.data = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetPrometheusMetricsV1Response { + return GetPrometheusMetricsV1Response.deserialize(bytes); + } + } + export class GetTransactionV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + getTransactionV1RequestPB?: dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("getTransactionV1RequestPB" in data && data.getTransactionV1RequestPB != undefined) { + this.getTransactionV1RequestPB = data.getTransactionV1RequestPB; + } + } + } + get getTransactionV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB, 1) as dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB; + } + set getTransactionV1RequestPB(value: dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_getTransactionV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + getTransactionV1RequestPB?: ReturnType; + }): GetTransactionV1Request { + const message = new GetTransactionV1Request({}); + if (data.getTransactionV1RequestPB != null) { + message.getTransactionV1RequestPB = dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB.fromObject(data.getTransactionV1RequestPB); + } + return message; + } + toObject() { + const data: { + getTransactionV1RequestPB?: ReturnType; + } = {}; + if (this.getTransactionV1RequestPB != null) { + data.getTransactionV1RequestPB = this.getTransactionV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_getTransactionV1RequestPB) + writer.writeMessage(1, this.getTransactionV1RequestPB, () => this.getTransactionV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetTransactionV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetTransactionV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.getTransactionV1RequestPB, () => message.getTransactionV1RequestPB = dependency_12.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): GetTransactionV1Request { + return GetTransactionV1Request.deserialize(bytes); + } + } + export class InvokeContractV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + invokeContractV1RequestPB?: dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("invokeContractV1RequestPB" in data && data.invokeContractV1RequestPB != undefined) { + this.invokeContractV1RequestPB = data.invokeContractV1RequestPB; + } + } + } + get invokeContractV1RequestPB() { + return pb_1.Message.getWrapperField(this, dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB, 1) as dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB; + } + set invokeContractV1RequestPB(value: dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_invokeContractV1RequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + invokeContractV1RequestPB?: ReturnType; + }): InvokeContractV1Request { + const message = new InvokeContractV1Request({}); + if (data.invokeContractV1RequestPB != null) { + message.invokeContractV1RequestPB = dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.fromObject(data.invokeContractV1RequestPB); + } + return message; + } + toObject() { + const data: { + invokeContractV1RequestPB?: ReturnType; + } = {}; + if (this.invokeContractV1RequestPB != null) { + data.invokeContractV1RequestPB = this.invokeContractV1RequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_invokeContractV1RequestPB) + writer.writeMessage(1, this.invokeContractV1RequestPB, () => this.invokeContractV1RequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): InvokeContractV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InvokeContractV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.invokeContractV1RequestPB, () => message.invokeContractV1RequestPB = dependency_14.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1RequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): InvokeContractV1Request { + return InvokeContractV1Request.deserialize(bytes); + } + } + export class RunTransactionV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + runTransactionRequestPB?: dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("runTransactionRequestPB" in data && data.runTransactionRequestPB != undefined) { + this.runTransactionRequestPB = data.runTransactionRequestPB; + } + } + } + get runTransactionRequestPB() { + return pb_1.Message.getWrapperField(this, dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB, 1) as dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB; + } + set runTransactionRequestPB(value: dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_runTransactionRequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + runTransactionRequestPB?: ReturnType; + }): RunTransactionV1Request { + const message = new RunTransactionV1Request({}); + if (data.runTransactionRequestPB != null) { + message.runTransactionRequestPB = dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB.fromObject(data.runTransactionRequestPB); + } + return message; + } + toObject() { + const data: { + runTransactionRequestPB?: ReturnType; + } = {}; + if (this.runTransactionRequestPB != null) { + data.runTransactionRequestPB = this.runTransactionRequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_runTransactionRequestPB) + writer.writeMessage(1, this.runTransactionRequestPB, () => this.runTransactionRequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RunTransactionV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RunTransactionV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.runTransactionRequestPB, () => message.runTransactionRequestPB = dependency_16.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionRequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): RunTransactionV1Request { + return RunTransactionV1Request.deserialize(bytes); + } + } + export class SignTransactionV1Request extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + signTransactionRequestPB?: dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("signTransactionRequestPB" in data && data.signTransactionRequestPB != undefined) { + this.signTransactionRequestPB = data.signTransactionRequestPB; + } + } + } + get signTransactionRequestPB() { + return pb_1.Message.getWrapperField(this, dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB, 1) as dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB; + } + set signTransactionRequestPB(value: dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB) { + pb_1.Message.setWrapperField(this, 1, value); + } + get has_signTransactionRequestPB() { + return pb_1.Message.getField(this, 1) != null; + } + static fromObject(data: { + signTransactionRequestPB?: ReturnType; + }): SignTransactionV1Request { + const message = new SignTransactionV1Request({}); + if (data.signTransactionRequestPB != null) { + message.signTransactionRequestPB = dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB.fromObject(data.signTransactionRequestPB); + } + return message; + } + toObject() { + const data: { + signTransactionRequestPB?: ReturnType; + } = {}; + if (this.signTransactionRequestPB != null) { + data.signTransactionRequestPB = this.signTransactionRequestPB.toObject(); + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.has_signTransactionRequestPB) + writer.writeMessage(1, this.signTransactionRequestPB, () => this.signTransactionRequestPB.serialize(writer)); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SignTransactionV1Request { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SignTransactionV1Request(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.signTransactionRequestPB, () => message.signTransactionRequestPB = dependency_18.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionRequestPB.deserialize(reader)); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): SignTransactionV1Request { + return SignTransactionV1Request.deserialize(bytes); + } + } + interface GrpcUnaryServiceInterface { + (message: P, metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + (message: P, metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + (message: P, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + (message: P, callback: grpc_1.requestCallback): grpc_1.ClientUnaryCall; + } + interface GrpcStreamServiceInterface { + (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream; + (message: P, options?: grpc_1.CallOptions): grpc_1.ClientReadableStream; + } + interface GrpWritableServiceInterface { + (metadata: grpc_1.Metadata, options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + (metadata: grpc_1.Metadata, callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + (options: grpc_1.CallOptions, callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + (callback: grpc_1.requestCallback): grpc_1.ClientWritableStream

; + } + interface GrpcChunkServiceInterface { + (metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream; + (options?: grpc_1.CallOptions): grpc_1.ClientDuplexStream; + } + interface GrpcPromiseServiceInterface { + (message: P, metadata: grpc_1.Metadata, options?: grpc_1.CallOptions): Promise; + (message: P, options?: grpc_1.CallOptions): Promise; + } + export abstract class UnimplementedDefaultServiceService { + static definition = { + DeployContractSolBytecodeV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/DeployContractSolBytecodeV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: DeployContractSolBytecodeV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => DeployContractSolBytecodeV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_3.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, + GetBalanceV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetBalanceV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: GetBalanceV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => GetBalanceV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_5.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, + GetBesuRecordV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetBesuRecordV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: GetBesuRecordV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => GetBesuRecordV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_7.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, + GetBlockV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetBlockV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: GetBlockV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => GetBlockV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_9.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, + GetOpenApiSpecV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetOpenApiSpecV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: dependency_1.google.protobuf.Empty) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => dependency_1.google.protobuf.Empty.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: GetOpenApiSpecV1Response) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => GetOpenApiSpecV1Response.deserialize(new Uint8Array(bytes)) + }, + GetPastLogsV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetPastLogsV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: GetPastLogsV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => GetPastLogsV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_11.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, + GetPrometheusMetricsV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetPrometheusMetricsV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: dependency_1.google.protobuf.Empty) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => dependency_1.google.protobuf.Empty.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: GetPrometheusMetricsV1Response) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => GetPrometheusMetricsV1Response.deserialize(new Uint8Array(bytes)) + }, + GetTransactionV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/GetTransactionV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: GetTransactionV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => GetTransactionV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_13.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, + InvokeContractV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/InvokeContractV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: InvokeContractV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => InvokeContractV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1ResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_15.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1ResponsePB.deserialize(new Uint8Array(bytes)) + }, + RunTransactionV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/RunTransactionV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: RunTransactionV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => RunTransactionV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_17.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionResponsePB.deserialize(new Uint8Array(bytes)) + }, + SignTransactionV1: { + path: "/org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultService/SignTransactionV1", + requestStream: false, + responseStream: false, + requestSerialize: (message: SignTransactionV1Request) => Buffer.from(message.serialize()), + requestDeserialize: (bytes: Buffer) => SignTransactionV1Request.deserialize(new Uint8Array(bytes)), + responseSerialize: (message: dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionResponsePB) => Buffer.from(message.serialize()), + responseDeserialize: (bytes: Buffer) => dependency_19.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionResponsePB.deserialize(new Uint8Array(bytes)) + } + }; + [method: string]: grpc_1.UntypedHandleCall; + abstract DeployContractSolBytecodeV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetBalanceV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetBesuRecordV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetBlockV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetOpenApiSpecV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetPastLogsV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetPrometheusMetricsV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract GetTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract InvokeContractV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract RunTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + abstract SignTransactionV1(call: grpc_1.ServerUnaryCall, callback: grpc_1.sendUnaryData): void; + } + export class DefaultServiceClient extends grpc_1.makeGenericClientConstructor(UnimplementedDefaultServiceService.definition, "DefaultService", {}) { + constructor(address: string, credentials: grpc_1.ChannelCredentials, options?: Partial) { + super(address, credentials, options); + } + DeployContractSolBytecodeV1: GrpcUnaryServiceInterface = (message: DeployContractSolBytecodeV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.DeployContractSolBytecodeV1(message, metadata, options, callback); + }; + GetBalanceV1: GrpcUnaryServiceInterface = (message: GetBalanceV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.GetBalanceV1(message, metadata, options, callback); + }; + GetBesuRecordV1: GrpcUnaryServiceInterface = (message: GetBesuRecordV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.GetBesuRecordV1(message, metadata, options, callback); + }; + GetBlockV1: GrpcUnaryServiceInterface = (message: GetBlockV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.GetBlockV1(message, metadata, options, callback); + }; + GetOpenApiSpecV1: GrpcUnaryServiceInterface = (message: dependency_1.google.protobuf.Empty, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.GetOpenApiSpecV1(message, metadata, options, callback); + }; + GetPastLogsV1: GrpcUnaryServiceInterface = (message: GetPastLogsV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.GetPastLogsV1(message, metadata, options, callback); + }; + GetPrometheusMetricsV1: GrpcUnaryServiceInterface = (message: dependency_1.google.protobuf.Empty, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.GetPrometheusMetricsV1(message, metadata, options, callback); + }; + GetTransactionV1: GrpcUnaryServiceInterface = (message: GetTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.GetTransactionV1(message, metadata, options, callback); + }; + InvokeContractV1: GrpcUnaryServiceInterface = (message: InvokeContractV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.InvokeContractV1(message, metadata, options, callback); + }; + RunTransactionV1: GrpcUnaryServiceInterface = (message: RunTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.RunTransactionV1(message, metadata, options, callback); + }; + SignTransactionV1: GrpcUnaryServiceInterface = (message: SignTransactionV1Request, metadata: grpc_1.Metadata | grpc_1.CallOptions | grpc_1.requestCallback, options?: grpc_1.CallOptions | grpc_1.requestCallback, callback?: grpc_1.requestCallback): grpc_1.ClientUnaryCall => { + return super.SignTransactionV1(message, metadata, options, callback); + }; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts new file mode 100644 index 0000000000..41e58eb51c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-open-api.ts @@ -0,0 +1,226 @@ +import { ServerUnaryCall, sendUnaryData } from "@grpc/grpc-js"; +import { status } from "@grpc/grpc-js"; + +import { google } from "../generated/proto/protoc-gen-ts/google/protobuf/empty"; +import * as deploy_contract_solidity_bytecode_v1_response_pb from "../generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_response_pb"; +import * as get_balance_v1_response_pb from "../generated/proto/protoc-gen-ts/models/get_balance_v1_response_pb"; +import * as get_besu_record_v1_response_pb from "../generated/proto/protoc-gen-ts/models/get_besu_record_v1_response_pb"; +import * as get_block_v1_response_pb from "../generated/proto/protoc-gen-ts/models/get_block_v1_response_pb"; +import * as get_past_logs_v1_response_pb from "../generated/proto/protoc-gen-ts/models/get_past_logs_v1_response_pb"; +import * as get_transaction_v1_response_pb from "../generated/proto/protoc-gen-ts/models/get_transaction_v1_response_pb"; +import * as invoke_contract_v1_response_pb from "../generated/proto/protoc-gen-ts/models/invoke_contract_v1_response_pb"; +import * as run_transaction_response_pb from "../generated/proto/protoc-gen-ts/models/run_transaction_response_pb"; +import * as sign_transaction_response_pb from "../generated/proto/protoc-gen-ts/models/sign_transaction_response_pb"; +import * as default_service from "../generated/proto/protoc-gen-ts/services/default_service"; +import { getBlockV1Grpc } from "../impl/get-block-v1/get-block-v1-grpc"; +import { + LogLevelDesc, + Logger, + LoggerProvider, + createRuntimeErrorWithCause, + safeStringifyException, +} from "@hyperledger/cactus-common"; +import Web3 from "web3"; + +export interface IBesuGrpcSvcOpenApiOptions { + readonly logLevel?: LogLevelDesc; + readonly web3: Web3; +} + +export class BesuGrpcSvcOpenApi extends default_service.org.hyperledger.cacti + .plugin.ledger.connector.besu.services.defaultservice + .UnimplementedDefaultServiceService { + // No choice but to disable the linter here because we need to be able to + // declare fields on the implementation class but the parent class forces to + // only have methods implementations not fields. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [field: string]: any; + + public static readonly CLASS_NAME = "BesuGrpcSvcOpenApi"; + + public get className(): string { + return BesuGrpcSvcOpenApi.CLASS_NAME; + } + + private readonly log: Logger; + + private readonly web3: Web3; + + /** + * The log level that will be used throughout all the methods of this class. + */ + private readonly logLevel: LogLevelDesc; + constructor(public readonly opts: IBesuGrpcSvcOpenApiOptions) { + super(); + this.logLevel = opts.logLevel || "INFO"; + const label = this.className; + this.log = LoggerProvider.getOrCreate({ level: this.logLevel, label }); + this.web3 = opts.web3; + this.log.debug(`Created instance of ${this.className} OK`); + } + + public DeployContractSolBytecodeV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DeployContractSolBytecodeV1Request, + deploy_contract_solidity_bytecode_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.DeployContractSolidityBytecodeV1ResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public GetBalanceV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetBalanceV1Request, + get_balance_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBalanceV1ResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public GetBesuRecordV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetBesuRecordV1Request, + get_besu_record_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBesuRecordV1ResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public GetBlockV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetBlockV1Request, + get_block_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB + >, + callback: sendUnaryData, + ): void { + getBlockV1Grpc({ web3: this.web3, logLevel: this.logLevel }, call.request) + .then((res) => { + callback(null, res); + }) + .catch((cause: unknown) => { + const ex = createRuntimeErrorWithCause("getBlockGrpc() crashed", cause); + const exJson = safeStringifyException(ex); + this.log.debug("getBlockGrpc() crashed with %o", cause); + callback({ + message: "status.INTERNAL - getBlockGrpc() call crashed.", + code: status.INTERNAL, + stack: ex.stack, + name: ex.name, + details: exJson, + }); + }); + } + + public GetOpenApiSpecV1( + call: ServerUnaryCall< + google.protobuf.Empty, + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetOpenApiSpecV1Response + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public GetPastLogsV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetPastLogsV1Request, + get_past_logs_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetPastLogsV1ResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public GetPrometheusMetricsV1( + call: ServerUnaryCall< + google.protobuf.Empty, + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetPrometheusMetricsV1Response + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public GetTransactionV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetTransactionV1Request, + get_transaction_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetTransactionV1ResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public InvokeContractV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.InvokeContractV1Request, + invoke_contract_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.InvokeContractV1ResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public RunTransactionV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.RunTransactionV1Request, + run_transaction_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.RunTransactionResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } + + public SignTransactionV1( + call: ServerUnaryCall< + default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.SignTransactionV1Request, + sign_transaction_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.SignTransactionResponsePB + >, + callback: sendUnaryData, + ): void { + return callback({ + message: "Status.UNIMPLEMENTED", + code: status.UNIMPLEMENTED, + details: "Service endpoint not yet implemented.", + }); + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-streams.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-streams.ts new file mode 100644 index 0000000000..1df238519d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/besu-grpc-svc-streams.ts @@ -0,0 +1,94 @@ +import { ServerDuplexStream } from "@grpc/grpc-js"; +import Web3 from "web3"; +import { BlockHeader } from "web3-eth"; + +import { + LogLevelDesc, + Logger, + LoggerProvider, +} from "@hyperledger/cactus-common"; + +import * as watch_blocks_v1_progress_pb from "../generated/proto/protoc-gen-ts/models/watch_blocks_v1_progress_pb"; +import * as watch_blocks_v1_request_pb from "../generated/proto/protoc-gen-ts/models/watch_blocks_v1_request_pb"; +import * as besu_grpc_svc_streams from "../generated/proto/protoc-gen-ts/services/besu-grpc-svc-streams"; +import { watch_blocks_v1_pb } from "../public-api"; + +const WatchBlocksV1ProgressPB = + watch_blocks_v1_progress_pb.org.hyperledger.cacti.plugin.ledger.connector.besu + .WatchBlocksV1ProgressPB; + +export interface IBesuGrpcSvcStreamsOptions { + readonly logLevel?: LogLevelDesc; + readonly web3: Web3; +} + +export class BesuGrpcSvcStreams extends besu_grpc_svc_streams.org.hyperledger + .cacti.plugin.ledger.connector.besu.services.besuservice + .UnimplementedBesuGrpcSvcStreamsService { + // No choice but to disable the linter here because we need to be able to + // declare fields on the implementation class but the parent class forces to + // only have methods implementations not fields. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [field: string]: any; + + public static readonly CLASS_NAME = "BesuGrpcSvcStreams"; + + public get className(): string { + return BesuGrpcSvcStreams.CLASS_NAME; + } + + private readonly log: Logger; + + private readonly web3: Web3; + + /** + * The log level that will be used throughout all the methods of this class. + */ + private readonly logLevel: LogLevelDesc; + + constructor(public readonly opts: IBesuGrpcSvcStreamsOptions) { + super(); + this.logLevel = opts.logLevel || "INFO"; + const label = this.className; + this.log = LoggerProvider.getOrCreate({ level: this.logLevel, label }); + this.web3 = opts.web3; + this.log.debug(`Created instance of ${this.className} OK`); + } + + WatchBlocksV1( + call: ServerDuplexStream< + watch_blocks_v1_request_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1RequestPB, + watch_blocks_v1_progress_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1ProgressPB + >, + ): void { + this.log.debug("WatchBlocksV1::MAIN_FN="); + + const EVENT = "newBlockHeaders" as const; + + const sub = this.web3.eth.subscribe(EVENT, (ex: Error, bh: BlockHeader) => { + this.log.debug("subscribe_newBlockHeaders::error=%o, bh=%o", ex, bh); + const chunk = new WatchBlocksV1ProgressPB(); + call.write(chunk); + }); + + const WatchBlocksV1PB = + watch_blocks_v1_pb.org.hyperledger.cacti.plugin.ledger.connector.besu + .WatchBlocksV1PB; + + type WatchBlocksV1RequestPB = + watch_blocks_v1_request_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1RequestPB; + + call.on("data", (chunk: WatchBlocksV1RequestPB) => { + this.log.debug("WatchBlocksV1::data=%o", chunk); + if (chunk.event === WatchBlocksV1PB.WatchBlocksV1PB_Unsubscribe) { + this.log.debug("WatchBlocksV1::data=WatchBlocksV1PB_Unsubscribe"); + call.end(); + } + }); + + call.once("close", () => { + this.log.debug("subscribe_newBlockHeaders::event=CLOSE"); + sub.unsubscribe(); + }); + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-credentials-factory.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-credentials-factory.ts new file mode 100644 index 0000000000..f587e18285 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-credentials-factory.ts @@ -0,0 +1,91 @@ +import * as grpc from "@grpc/grpc-js"; + +/** + * Re-exports the underlying `grpc.ServerCredentials.createInsecure()` call + * verbatim. + * Why though? This is necessary because the {grpc.Server} object does an `instanceof` + * validation on credential objects that are passed to it and this check comes back + * negative if you've constructed the credentials object with a different instance + * of the library, **even** if the versions of the library instances are the **same**. + * + * Therefore this is a workaround that allows callers to construct credentials + * objects with the same import of the `@grpc/grpc-js` library that the {ApiServer} + * of this package is using. + * + * @returns {grpc.ServerCredentials} + */ +export function createGrpcInsecureServerCredentials(): grpc.ServerCredentials { + return grpc.ServerCredentials.createInsecure(); +} + +/** + * Re-exports the underlying `grpc.ServerCredentials.createInsecure()` call + * verbatim. + * Why though? This is necessary because the {grpc.Server} object does an `instanceof` + * validation on credential objects that are passed to it and this check comes back + * negative if you've constructed the credentials object with a different instance + * of the library, **even** if the versions of the library instances are the **same**. + * + * Therefore this is a workaround that allows callers to construct credentials + * objects with the same import of the `@grpc/grpc-js` library that the {ApiServer} + * of this package is using. + * + * @returns {grpc.ServerCredentials} + */ +export function createGrpcSslServerCredentials( + rootCerts: Buffer | null, + keyCertPairs: grpc.KeyCertPair[], + checkClientCertificate?: boolean, +): grpc.ServerCredentials { + return grpc.ServerCredentials.createSsl( + rootCerts, + keyCertPairs, + checkClientCertificate, + ); +} + +/** + * Re-exports the underlying `grpc.ServerCredentials.createInsecure()` call + * verbatim. + * Why though? This is necessary because the {grpc.Server} object does an `instanceof` + * validation on credential objects that are passed to it and this check comes back + * negative if you've constructed the credentials object with a different instance + * of the library, **even** if the versions of the library instances are the **same**. + * + * Therefore this is a workaround that allows callers to construct credentials + * objects with the same import of the `@grpc/grpc-js` library that the {ApiServer} + * of this package is using. + * + * @returns {grpc.ChannelCredentials} + */ +export function createGrpcInsecureChannelCredentials(): grpc.ChannelCredentials { + return grpc.ChannelCredentials.createInsecure(); +} + +/** + * Re-exports the underlying `grpc.ServerCredentials.createInsecure()` call + * verbatim. + * Why though? This is necessary because the {grpc.Server} object does an `instanceof` + * validation on credential objects that are passed to it and this check comes back + * negative if you've constructed the credentials object with a different instance + * of the library, **even** if the versions of the library instances are the **same**. + * + * Therefore this is a workaround that allows callers to construct credentials + * objects with the same import of the `@grpc/grpc-js` library that the {ApiServer} + * of this package is using. + * + * @returns {grpc.ChannelCredentials} + */ +export function createGrpcSslChannelCredentials( + rootCerts?: Buffer | null, + privateKey?: Buffer | null, + certChain?: Buffer | null, + verifyOptions?: grpc.VerifyOptions, +): grpc.ChannelCredentials { + return grpc.ChannelCredentials.createSsl( + rootCerts, + privateKey, + certChain, + verifyOptions, + ); +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-server-factory.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-server-factory.ts new file mode 100644 index 0000000000..288bd7ea85 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/grpc-services/common/grpc-server-factory.ts @@ -0,0 +1,21 @@ +import * as grpc from "@grpc/grpc-js"; + +/** + * Re-exports the underlying `new grpc.Server()` call verbatim. + * + * Why though? This is necessary because the {grpc.Server} object does an `instanceof` + * validation on credential objects that are passed to it and this check comes back + * negative if you've constructed the credentials object with a different instance + * of the library, **even** if the versions of the library instances are the **same**. + * + * Therefore this is a workaround that allows callers to construct credentials + * objects/servers with the same import of the `@grpc/grpc-js` library that the + * {ApiServer} of this package is using internally. + * + * @returns {grpc.Server} + */ +export function createGrpcServer( + options?: grpc.ServerOptions | undefined, +): grpc.Server { + return new grpc.Server(options); +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-grpc.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-grpc.ts new file mode 100644 index 0000000000..26b0fe052f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-grpc.ts @@ -0,0 +1,46 @@ +import Web3 from "web3"; + +import { LoggerProvider, LogLevelDesc } from "@hyperledger/cactus-common"; + +import * as get_block_v1_response_pb from "../../generated/proto/protoc-gen-ts/models/get_block_v1_response_pb"; +import * as default_service from "../../generated/proto/protoc-gen-ts/services/default_service"; +import { evm_block_pb, EvmBlock } from "../../public-api"; +import { getBlockV1Impl, isBlockNumber } from "./get-block-v1-impl"; + +export async function getBlockV1Grpc( + ctx: { readonly web3: Web3; readonly logLevel: LogLevelDesc }, + req: default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetBlockV1Request, +): Promise { + const log = LoggerProvider.getOrCreate({ + label: "getBlockGrpc()", + level: ctx.logLevel, + }); + log.debug( + "req.getBlockV1RequestPB.blockHashOrBlockNumber=%o", + req.getBlockV1RequestPB.blockHashOrBlockNumber, + ); + const blockHashOrBlockNumber = Buffer.from( + req.getBlockV1RequestPB.blockHashOrBlockNumber.value, + ).toString("utf-8"); + + log.debug("blockHashOrBlockNumber=%s", blockHashOrBlockNumber); + + if (!isBlockNumber(blockHashOrBlockNumber)) { + throw new Error("Input was not a block number: " + blockHashOrBlockNumber); + } + + const block = await getBlockV1Impl(ctx, blockHashOrBlockNumber); + log.debug("getBlockV1Impl() => block=%o", block); + + const getBlockV1ResponsePb = + new get_block_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB(); + + const evmBlockPb = + evm_block_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.EvmBlockPB.fromObject( + block as EvmBlock, + ); + + getBlockV1ResponsePb.block = evmBlockPb; + + return getBlockV1ResponsePb; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-http.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-http.ts new file mode 100644 index 0000000000..8a5a1a49df --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-http.ts @@ -0,0 +1,15 @@ +import Web3 from "web3"; +import { + GetBlockV1Request, + GetBlockV1Response, +} from "../../generated/openapi/typescript-axios/api"; +import { LogLevelDesc } from "@hyperledger/cactus-common"; +import { getBlockV1Impl } from "./get-block-v1-impl"; + +export async function getBlockV1Http( + ctx: { readonly logLevel: LogLevelDesc; readonly web3: Web3 }, + request: GetBlockV1Request, +): Promise { + const block = await getBlockV1Impl(ctx, request.blockHashOrBlockNumber); + return { block }; +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-impl.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-impl.ts new file mode 100644 index 0000000000..570ae160b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/impl/get-block-v1/get-block-v1-impl.ts @@ -0,0 +1,39 @@ +import Web3 from "web3"; +import { BlockNumber } from "web3-core"; + +import { + LoggerProvider, + LogLevelDesc, + Strings, +} from "@hyperledger/cactus-common"; + +import { EvmBlock } from "../../public-api"; + +export async function getBlockV1Impl( + ctx: { readonly web3: Web3; readonly logLevel: LogLevelDesc }, + blockHashOrBlockNumber: BlockNumber, +): Promise { + const log = LoggerProvider.getOrCreate({ + label: "getBlockV1Impl()", + level: ctx.logLevel, + }); + log.debug("blockHashOrBlockNumber=%s", blockHashOrBlockNumber); + + if (!isBlockNumber(blockHashOrBlockNumber)) { + throw new Error("Input was not a block number: " + blockHashOrBlockNumber); + } + + const block = await ctx.web3.eth.getBlock(blockHashOrBlockNumber, true); + log.debug("block=%o", block); + + return block; +} + +//string | number | BN | BigNumber | 'latest' | 'pending' | 'earliest' | 'genesis' +export function isBlockNumber(x: unknown): x is BlockNumber { + return ( + Strings.isString(x) || + (typeof x === "number" && isFinite(x)) || + typeof x === "bigint" + ); +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts index 34ee9db244..7dfbf7b57f 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts @@ -13,7 +13,6 @@ import OAS from "../json/openapi.json"; import Web3 from "web3"; import type { WebsocketProvider } from "web3-core"; -//import EEAClient, { ICallOptions, IWeb3InstanceExtended } from "web3-eea"; import Web3JsQuorum, { IWeb3Quorum } from "web3js-quorum"; import { Contract, ContractSendMethod } from "web3-eth-contract"; @@ -35,6 +34,8 @@ import { IPluginWebService, ICactusPlugin, ICactusPluginOptions, + IPluginGrpcService, + IGrpcSvcDefAndImplPair, } from "@hyperledger/cactus-core-api"; import { @@ -101,6 +102,11 @@ import { GetOpenApiSpecV1Endpoint, IGetOpenApiSpecV1EndpointOptions, } from "./web-services/get-open-api-spec-v1-endpoint"; +import * as grpc_default_service from "./generated/proto/protoc-gen-ts/services/default_service"; +import * as besu_grpc_svc_streams from "./generated/proto/protoc-gen-ts/services/besu-grpc-svc-streams"; +import { BesuGrpcSvcOpenApi } from "./grpc-services/besu-grpc-svc-open-api"; +import { BesuGrpcSvcStreams } from "./grpc-services/besu-grpc-svc-streams"; +import { getBlockV1Http } from "./impl/get-block-v1/get-block-v1-http"; export const E_KEYCHAIN_NOT_FOUND = "cactus.connector.besu.keychain_not_found"; @@ -122,11 +128,13 @@ export class PluginLedgerConnectorBesu RunTransactionResponse >, ICactusPlugin, + IPluginGrpcService, IPluginWebService { private readonly instanceId: string; public prometheusExporter: PrometheusExporter; private readonly log: Logger; + private readonly logLevel: LogLevelDesc; private readonly web3Provider: WebsocketProvider; private readonly web3: Web3; private web3Quorum: IWeb3Quorum | undefined; @@ -152,9 +160,9 @@ export class PluginLedgerConnectorBesu Checks.truthy(options.pluginRegistry, `${fnTag} options.pluginRegistry`); Checks.truthy(options.instanceId, `${fnTag} options.instanceId`); - const level = this.options.logLevel || "INFO"; + this.logLevel = this.options.logLevel || "INFO"; const label = this.className; - this.log = LoggerProvider.getOrCreate({ level, label }); + this.log = LoggerProvider.getOrCreate({ level: this.logLevel, label }); this.web3Provider = new Web3.providers.WebsocketProvider( this.options.rpcApiWsHost, @@ -217,6 +225,50 @@ export class PluginLedgerConnectorBesu }); return webServices; } + public async createGrpcSvcDefAndImplPairs(): Promise< + IGrpcSvcDefAndImplPair[] + > { + const openApiSvc = await this.createGrpcOpenApiSvcDefAndImplPair(); + const streamsSvc = await this.createGrpcStreamsSvcDefAndImplPair(); + return [openApiSvc, streamsSvc]; + } + + public async createGrpcStreamsSvcDefAndImplPair(): Promise { + const definition = + besu_grpc_svc_streams.org.hyperledger.cacti.plugin.ledger.connector.besu + .services.besuservice.UnimplementedBesuGrpcSvcStreamsService.definition; + + const implementation = new BesuGrpcSvcStreams({ + logLevel: this.logLevel, + web3: this.web3, + }); + + return { definition, implementation }; + } + + /** + * Create a new instance of the service implementation. + * Note: This does not cache the returned objects internally. A new instance + * is created during every invocation. + * + * @returns The gRPC service definition+implementation pair that is backed + * by the code generated by the OpenAPI generator from the openapi.json spec + * of this package. Used by the API server to obtain the service objects dynamically + * at runtime so that the plugin's gRPC services can be exposed in a similar + * fashion how the HTTP REST endpoints are registered as well. + */ + public async createGrpcOpenApiSvcDefAndImplPair(): Promise { + const definition = + grpc_default_service.org.hyperledger.cacti.plugin.ledger.connector.besu + .services.defaultservice.DefaultServiceClient.service; + + const implementation = new BesuGrpcSvcOpenApi({ + logLevel: this.logLevel, + web3: this.web3, + }); + + return { definition, implementation }; + } public async getOrCreateWebServices(): Promise { if (Array.isArray(this.endpoints)) { @@ -994,9 +1046,12 @@ export class PluginLedgerConnectorBesu public async getBlock( request: GetBlockV1Request, ): Promise { - const block = await this.web3.eth.getBlock(request.blockHashOrBlockNumber); - return { block }; + const ctx = { logLevel: this.logLevel, web3: this.web3 }; + const getBlockV1Response = await getBlockV1Http(ctx, request); + this.log.debug("getBlockV1Response=%o", getBlockV1Response); + return getBlockV1Response; } + public async getBesuRecord( request: GetBesuRecordV1Request, ): Promise { diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/public-api.ts b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/public-api.ts index d36a10beb9..8e686fb328 100755 --- a/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/public-api.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/typescript/public-api.ts @@ -20,3 +20,74 @@ export async function createPluginFactory( ): Promise { return new PluginFactoryLedgerConnector(pluginFactoryOptions); } + +export { + IBesuGrpcSvcOpenApiOptions, + BesuGrpcSvcOpenApi, +} from "./grpc-services/besu-grpc-svc-open-api"; + +export { + BesuGrpcSvcStreams, + IBesuGrpcSvcStreamsOptions, +} from "./grpc-services/besu-grpc-svc-streams"; + +export * as google_protobuf_any from "./generated/proto/protoc-gen-ts/google/protobuf/any"; +export * as google_protobuf_empty from "./generated/proto/protoc-gen-ts/google/protobuf/empty"; + +export * as besu_private_transaction_config_pb from "./generated/proto/protoc-gen-ts/models/besu_private_transaction_config_pb"; +export * as besu_transaction_config_pb from "./generated/proto/protoc-gen-ts/models/besu_transaction_config_pb"; +export * as besu_transaction_config_to_pb from "./generated/proto/protoc-gen-ts/models/besu_transaction_config_to_pb"; +export * as consistency_strategy_pb from "./generated/proto/protoc-gen-ts/models/consistency_strategy_pb"; +export * as deploy_contract_solidity_bytecode_v1_request_pb from "./generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_request_pb"; +export * as deploy_contract_solidity_bytecode_v1_response_pb from "./generated/proto/protoc-gen-ts/models/deploy_contract_solidity_bytecode_v1_response_pb"; +export * as eth_contract_invocation_type_pb from "./generated/proto/protoc-gen-ts/models/eth_contract_invocation_type_pb"; +export * as evm_block_pb from "./generated/proto/protoc-gen-ts/models/evm_block_pb"; +export * as evm_log_pb from "./generated/proto/protoc-gen-ts/models/evm_log_pb"; +export * as evm_transaction_pb from "./generated/proto/protoc-gen-ts/models/evm_transaction_pb"; +export * as get_balance_v1_request_pb from "./generated/proto/protoc-gen-ts/models/get_balance_v1_request_pb"; +export * as get_balance_v1_response_pb from "./generated/proto/protoc-gen-ts/models/get_balance_v1_response_pb"; +export * as get_besu_record_v1_request_pb from "./generated/proto/protoc-gen-ts/models/get_besu_record_v1_request_pb"; +export * as get_besu_record_v1_response_pb from "./generated/proto/protoc-gen-ts/models/get_besu_record_v1_response_pb"; +export * as get_block_v1_request_pb from "./generated/proto/protoc-gen-ts/models/get_block_v1_request_pb"; +export * as get_block_v1_response_pb from "./generated/proto/protoc-gen-ts/models/get_block_v1_response_pb"; +export * as get_past_logs_v1_request_pb from "./generated/proto/protoc-gen-ts/models/get_past_logs_v1_request_pb"; +export * as get_past_logs_v1_response_pb from "./generated/proto/protoc-gen-ts/models/get_past_logs_v1_response_pb"; +export * as get_transaction_v1_request_pb from "./generated/proto/protoc-gen-ts/models/get_transaction_v1_request_pb"; +export * as get_transaction_v1_response_pb from "./generated/proto/protoc-gen-ts/models/get_transaction_v1_response_pb"; +export * as invoke_contract_v1_request_pb from "./generated/proto/protoc-gen-ts/models/invoke_contract_v1_request_pb"; +export * as invoke_contract_v1_response_pb from "./generated/proto/protoc-gen-ts/models/invoke_contract_v1_response_pb"; +export * as receipt_type_pb from "./generated/proto/protoc-gen-ts/models/receipt_type_pb"; +export * as run_transaction_request_pb from "./generated/proto/protoc-gen-ts/models/run_transaction_request_pb"; +export * as run_transaction_response_pb from "./generated/proto/protoc-gen-ts/models/run_transaction_response_pb"; +export * as sign_transaction_request_pb from "./generated/proto/protoc-gen-ts/models/sign_transaction_request_pb"; +export * as sign_transaction_response_pb from "./generated/proto/protoc-gen-ts/models/sign_transaction_response_pb"; +export * as web3_block_header_timestamp_pb from "./generated/proto/protoc-gen-ts/models/web3_block_header_timestamp_pb"; +export * as web3_signing_credential_cactus_keychain_ref_pb from "./generated/proto/protoc-gen-ts/models/web3_signing_credential_cactus_keychain_ref_pb"; +export * as web3_signing_credential_none_pb from "./generated/proto/protoc-gen-ts/models/web3_signing_credential_none_pb"; +export * as web3_signing_credential_pb from "./generated/proto/protoc-gen-ts/models/web3_signing_credential_pb"; +export * as web3_signing_credential_private_key_hex_pb from "./generated/proto/protoc-gen-ts/models/web3_signing_credential_private_key_hex_pb"; +export * as web3_signing_credential_type_pb from "./generated/proto/protoc-gen-ts/models/web3_signing_credential_type_pb"; +export * as web3_transaction_receipt_pb from "./generated/proto/protoc-gen-ts/models/web3_transaction_receipt_pb"; + +export * as default_service from "./generated/proto/protoc-gen-ts/services/default_service"; + +export * as besu_grpc_svc_streams from "./generated/proto/protoc-gen-ts/services/besu-grpc-svc-streams"; +export * as watch_blocks_v1_progress_pb from "./generated/proto/protoc-gen-ts/models/watch_blocks_v1_progress_pb"; +export * as watch_blocks_v1_request_pb from "./generated/proto/protoc-gen-ts/models/watch_blocks_v1_request_pb"; +export * as watch_blocks_v1_pb from "./generated/proto/protoc-gen-ts/models/watch_blocks_v1_pb"; + +export { + createGrpcInsecureChannelCredentials, + createGrpcInsecureServerCredentials, + createGrpcSslChannelCredentials, + createGrpcSslServerCredentials, +} from "./grpc-services/common/grpc-credentials-factory"; + +export { createGrpcServer } from "./grpc-services/common/grpc-server-factory"; + +export { getBlockV1Grpc } from "./impl/get-block-v1/get-block-v1-grpc"; +export { getBlockV1Http } from "./impl/get-block-v1/get-block-v1-http"; +export { + getBlockV1Impl, + isBlockNumber, +} from "./impl/get-block-v1/get-block-v1-impl"; diff --git a/packages/cactus-test-plugin-ledger-connector-besu/package.json b/packages/cactus-test-plugin-ledger-connector-besu/package.json index 045f2f1f48..f980a255dd 100644 --- a/packages/cactus-test-plugin-ledger-connector-besu/package.json +++ b/packages/cactus-test-plugin-ledger-connector-besu/package.json @@ -50,6 +50,7 @@ "webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js" }, "dependencies": { + "@grpc/grpc-js": "1.10.3", "@hyperledger/cactus-cmd-api-server": "2.0.0-alpha.2", "@hyperledger/cactus-common": "2.0.0-alpha.2", "@hyperledger/cactus-core": "2.0.0-alpha.2", diff --git a/packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/grpc-services/connector-besu-grpc-services.test.ts b/packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/grpc-services/connector-besu-grpc-services.test.ts new file mode 100644 index 0000000000..cf0954e9b6 --- /dev/null +++ b/packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/grpc-services/connector-besu-grpc-services.test.ts @@ -0,0 +1,278 @@ +import http from "http"; +import { AddressInfo } from "node:net"; + +import "jest-extended"; +import * as grpc from "@grpc/grpc-js"; +import { v4 as uuidv4 } from "uuid"; +import Web3 from "web3"; +import { Account } from "web3-core"; + +import { + LogLevelDesc, + Logger, + LoggerProvider, + Servers, + isGrpcStatusObjectWithCode, +} from "@hyperledger/cactus-common"; +import { + BesuTestLedger, + pruneDockerAllIfGithubAction, +} from "@hyperledger/cactus-test-tooling"; +import { + PluginLedgerConnectorBesu, + createGrpcInsecureChannelCredentials, + besu_grpc_svc_streams, + default_service, + get_block_v1_request_pb, + get_block_v1_response_pb, + google_protobuf_any, + watch_blocks_v1_progress_pb, + watch_blocks_v1_request_pb, + watch_blocks_v1_pb, +} from "@hyperledger/cactus-plugin-ledger-connector-besu"; +import { PluginRegistry } from "@hyperledger/cactus-core"; +import { PluginKeychainMemory } from "@hyperledger/cactus-plugin-keychain-memory"; +import { + ApiServer, + AuthorizationProtocol, + ConfigService, + createGrpcServer, +} from "@hyperledger/cactus-cmd-api-server"; + +const logLevel: LogLevelDesc = "INFO"; + +type WatchBlocksV1ProgressPB = + watch_blocks_v1_progress_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1ProgressPB; + +describe("BesuGrpcSvcOpenApi", () => { + const log: Logger = LoggerProvider.getOrCreate({ + label: "plugin-ledger-connector-besu-grpc-service-test", + level: logLevel, + }); + + let ledger: BesuTestLedger; + let httpServer: http.Server; + let grpcServer: grpc.Server; + let connector: PluginLedgerConnectorBesu; + let grpcClientDefaultSvc: default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultServiceClient; + let grpcClientBesuSvc: besu_grpc_svc_streams.org.hyperledger.cacti.plugin.ledger.connector.besu.services.besuservice.BesuGrpcSvcStreamsClient; + let targetEthAccount: Account; + let apiServer: ApiServer; + let addressInfo: AddressInfo; + + beforeAll(async () => { + log.info("Prune Docker..."); + await pruneDockerAllIfGithubAction({ logLevel }); + + log.info("Start BesuTestLedger..."); + ledger = new BesuTestLedger({}); + await ledger.start(); + + grpcServer = createGrpcServer(); + + httpServer = await Servers.startOnPreferredPort(4050); + addressInfo = httpServer.address() as AddressInfo; + const apiHttpHost = `http://${addressInfo.address}:${addressInfo.port}`; + log.debug("HTTP API host: %s", apiHttpHost); + + const rpcApiHttpHost = await ledger.getRpcApiHttpHost(); + const rpcApiWsHost = await ledger.getRpcApiWsHost(); + log.debug("rpcApiHttpHost:", rpcApiHttpHost); + log.debug("rpcApiWsHost:", rpcApiWsHost); + + // Target account - create new + const web3 = new Web3(rpcApiHttpHost); + targetEthAccount = web3.eth.accounts.create(uuidv4()); + + const keychainEntryKey = uuidv4(); + const keychainEntryValue = targetEthAccount.privateKey; + const keychainPlugin = new PluginKeychainMemory({ + instanceId: uuidv4(), + keychainId: uuidv4(), + // pre-provision keychain with mock backend holding the private key of the + // test account that we'll reference while sending requests with the + // signing credential pointing to this keychain entry. + backend: new Map([[keychainEntryKey, keychainEntryValue]]), + logLevel, + }); + + log.debug("Instantiating PluginLedgerConnectorBesu..."); + + connector = new PluginLedgerConnectorBesu({ + rpcApiHttpHost, + rpcApiWsHost, + logLevel, + instanceId: uuidv4(), + pluginRegistry: new PluginRegistry({ plugins: [keychainPlugin] }), + }); + + const pluginRegistry = new PluginRegistry({ plugins: [] }); + + const cfgSrv = new ConfigService(); + const apiSrvOpts = await cfgSrv.newExampleConfig(); + apiSrvOpts.authorizationProtocol = AuthorizationProtocol.NONE; + apiSrvOpts.logLevel = logLevel; + apiSrvOpts.configFile = ""; + apiSrvOpts.apiCorsDomainCsv = "*"; + apiSrvOpts.apiPort = addressInfo.port; + apiSrvOpts.cockpitPort = 0; + apiSrvOpts.grpcPort = 0; + apiSrvOpts.grpcMtlsEnabled = false; + apiSrvOpts.apiTlsEnabled = false; + const cfg = await cfgSrv.newExampleConfigConvict(apiSrvOpts); + + pluginRegistry.add(keychainPlugin); + pluginRegistry.add(connector); + + apiServer = new ApiServer({ + httpServerApi: httpServer, + grpcServer, + config: cfg.getProperties(), + pluginRegistry, + }); + + const { addressInfoGrpc } = await apiServer.start(); + const grpcPort = addressInfoGrpc.port; + const grpcHost = addressInfoGrpc.address; + const grpcFamily = addressInfo.family; + log.info("gRPC family=%s host=%s port=%s", grpcFamily, grpcHost, grpcPort); + + const grpcChannelCredentials = createGrpcInsecureChannelCredentials(); + const grpcUrl = `${grpcHost}:${grpcPort}`; + grpcClientDefaultSvc = + new default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.DefaultServiceClient( + grpcUrl, + grpcChannelCredentials, + { + "grpc-node.tls_enable_trace": 1, + }, + ); + + grpcClientBesuSvc = + new besu_grpc_svc_streams.org.hyperledger.cacti.plugin.ledger.connector.besu.services.besuservice.BesuGrpcSvcStreamsClient( + grpcUrl, + grpcChannelCredentials, + { + "grpc-node.tls_enable_trace": 1, + }, + ); + + log.debug("Created gRPC client OK."); + }); + + test("gRPC - getBlockV1() returns arbitrary ledger block", async () => { + const blockHashOrBlockNumberData = Buffer.from("latest", "utf-8"); + const blockHashOrBlockNumber = + new google_protobuf_any.google.protobuf.Any(); + + blockHashOrBlockNumber.value = blockHashOrBlockNumberData; + + const getBlockV1RequestPB = + new get_block_v1_request_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1RequestPB( + { blockHashOrBlockNumber }, + ); + + const req1 = + new default_service.org.hyperledger.cacti.plugin.ledger.connector.besu.services.defaultservice.GetBlockV1Request( + { getBlockV1RequestPB }, + ); + + const metadata1 = new grpc.Metadata(); + + const res1Promise = + new Promise( + (resolve, reject) => { + const call = grpcClientDefaultSvc.GetBlockV1( + req1, + metadata1, + ( + err: grpc.ServiceError | null, + value?: get_block_v1_response_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.GetBlockV1ResponsePB, + ) => { + log.debug("Received callback from gRPC service: ", err, value); + if (err) { + reject(err); + } else if (value) { + resolve(value); + } else { + reject(new Error("Received no gRPC error nor response value.")); + } + }, + ); + log.debug("gRPC call object: ", call); + expect(call).toBeTruthy(); + }, + ); + + expect(res1Promise).toResolve(); + const res1 = await res1Promise; + expect(res1).toBeTruthy(); + expect(res1).toBeObject(); + + const block = res1.block.toObject(); + expect(block).toBeTruthy(); + expect(block).toBeObject(); + expect(block).not.toBeEmptyObject(); + expect(block.number).toBeTruthy(); + expect(block.hash).toBeTruthy(); + expect(block.transactions).toBeArray(); + }); + + test("gRPC - watchBlocksV1() streams ledger blocks as they are created", async () => { + const reqMetadata = new grpc.Metadata(); + const stream = grpcClientBesuSvc.WatchBlocksV1(reqMetadata); + + const msgs: Array = []; + const MSG_COUNT_SUCCESS = 3; + + const streamDoneAsync = new Promise((resolve, reject) => { + stream.on("data", (chunk: WatchBlocksV1ProgressPB) => { + msgs.push(chunk); + log.debug("WatchBlocksV1::data=%o, msg.length=%o", chunk, msgs.length); + if (msgs.length >= MSG_COUNT_SUCCESS) { + const reqUnsubscribe = + new watch_blocks_v1_request_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1RequestPB(); + + reqUnsubscribe.event = + watch_blocks_v1_pb.org.hyperledger.cacti.plugin.ledger.connector.besu.WatchBlocksV1PB.WatchBlocksV1PB_Unsubscribe; + + stream.write(reqUnsubscribe); + } + }); + + stream.on("status", (status: unknown) => { + log.debug("WatchBlocksV1::status=%o", status); + if ( + isGrpcStatusObjectWithCode(status) && + status.code === grpc.status.OK + ) { + resolve(); + } else { + const statusJson = JSON.stringify(status); + reject(new Error(`Received non-OK grpc status code: ${statusJson}`)); + } + }); + + stream.on("error", (error: unknown) => { + log.debug("WatchBlocksV1::error=%o", error); + reject(error); + }); + + stream.on("close", () => { + log.debug("WatchBlocksV1::close="); + resolve(); + }); + }); + + await expect(streamDoneAsync).toResolve(); + }, 15000); + + afterAll(async () => { + if (apiServer) { + await apiServer.shutdown(); + } + await ledger.stop(); + await ledger.destroy(); + await pruneDockerAllIfGithubAction({ logLevel }); + }); +}); diff --git a/yarn.lock b/yarn.lock index 3c96fadfce..b9f6a0b648 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8525,15 +8525,18 @@ __metadata: version: 0.0.0-use.local resolution: "@hyperledger/cactus-plugin-ledger-connector-besu@workspace:packages/cactus-plugin-ledger-connector-besu" dependencies: + "@grpc/grpc-js": "npm:1.10.3" "@hyperledger/cactus-common": "npm:2.0.0-alpha.2" "@hyperledger/cactus-core": "npm:2.0.0-alpha.2" "@hyperledger/cactus-core-api": "npm:2.0.0-alpha.2" "@hyperledger/cactus-plugin-keychain-memory": "npm:2.0.0-alpha.2" "@hyperledger/cactus-test-tooling": "npm:2.0.0-alpha.2" + "@openapitools/openapi-generator-cli": "npm:2.7.0" "@types/benchmark": "npm:2.1.5" "@types/body-parser": "npm:1.19.4" "@types/express": "npm:4.17.21" "@types/fs-extra": "npm:9.0.13" + "@types/google-protobuf": "npm:3.15.5" "@types/http-errors": "npm:2.0.4" "@types/uuid": "npm:9.0.8" axios: "npm:1.6.0" @@ -8541,9 +8544,14 @@ __metadata: body-parser: "npm:1.20.2" express: "npm:4.19.2" fs-extra: "npm:10.1.0" + google-protobuf: "npm:3.21.2" + grpc-tools: "npm:1.12.4" + grpc_tools_node_protoc_ts: "npm:5.3.3" http-errors: "npm:2.0.0" + http-errors-enhanced-cjs: "npm:2.0.1" joi: "npm:17.9.1" key-encoder: "npm:2.0.3" + npm-run-all2: "npm:6.1.2" openapi-types: "npm:12.1.3" prom-client: "npm:13.2.0" protobufjs: "npm:7.2.5" @@ -9200,6 +9208,7 @@ __metadata: version: 0.0.0-use.local resolution: "@hyperledger/cactus-test-plugin-ledger-connector-besu@workspace:packages/cactus-test-plugin-ledger-connector-besu" dependencies: + "@grpc/grpc-js": "npm:1.10.3" "@hyperledger/cactus-cmd-api-server": "npm:2.0.0-alpha.2" "@hyperledger/cactus-common": "npm:2.0.0-alpha.2" "@hyperledger/cactus-core": "npm:2.0.0-alpha.2"