From e05392b9c6dd6ecca805d39199f6b886206de06f Mon Sep 17 00:00:00 2001 From: Rafael Belchior Date: Sat, 23 Mar 2024 20:37:17 +0200 Subject: [PATCH] build(ubiquity): remove ubiquity connector plugin Signed-off-by: Rafael Belchior --- .github/workflows/ci.yaml | 28 -- CODEOWNERS | 1 - .../.env.example | 1 - .../.gitignore | 1 - .../CHANGELOG.md | 29 -- .../README.md | 43 --- .../openapitools.json | 7 - .../package.json | 106 ------ .../src/main/json/openapi.json | 60 ---- .../transaction/get-transactions-endpoint.ts | 109 ------ .../typescript-axios/.openapi-generator/FILES | 5 - .../.openapi-generator/VERSION | 1 - .../generated/openapi/typescript-axios/api.ts | 152 -------- .../openapi/typescript-axios/base.ts | 72 ---- .../openapi/typescript-axios/common.ts | 150 -------- .../openapi/typescript-axios/configuration.ts | 101 ------ .../openapi/typescript-axios/index.ts | 18 - .../main/typescript/helpers/api-parameters.ts | 19 - .../src/main/typescript/index.ts | 1 - .../src/main/typescript/index.web.ts | 1 - .../plugin-ledger-connector-ubiquity.ts | 244 ------------- .../prometheus-exporter/data-fetcher.ts | 7 - .../typescript/prometheus-exporter/metrics.ts | 10 - .../prometheus-exporter.ts | 40 --- .../prometheus-exporter/response.type.ts | 3 - .../src/main/typescript/public-api.ts | 5 - .../test/typescript/integration/init.test.ts | 51 --- .../integration/obtain-all-txs.test.ts | 82 ----- .../test/typescript/unit/api-surface.test.ts | 6 - .../tsconfig.json | 29 -- tsconfig.json | 3 - yarn.lock | 331 ++---------------- 32 files changed, 25 insertions(+), 1691 deletions(-) delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/.env.example delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/.gitignore delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/CHANGELOG.md delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/README.md delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/package.json delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/json/openapi.json delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/endpoints/transaction/get-transactions-endpoint.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/configuration.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/index.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/helpers/api-parameters.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.ts delete mode 100755 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.web.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/plugin-ledger-connector-ubiquity.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/data-fetcher.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/metrics.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/prometheus-exporter.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/response.type.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/public-api.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/init.test.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/obtain-all-txs.test.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/unit/api-surface.test.ts delete mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/tsconfig.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index af9be0c7fc..edcdfc825b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1730,34 +1730,6 @@ jobs: # restore-keys: | # ${{ runner.os }}-yarn- # - run: ./tools/ci.sh - cactus-plugin-connector-ubiquity: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - UBIQUITY_AUTH_TOKEN: ${{ secrets.UBIQUITY_AUTH_TOKEN }} - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.2 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.1 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.1 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - env: - UBIQUITY_AUTH_TOKEN: ${{ secrets.UBIQUITY_AUTH_TOKEN }} cactus-test-api-client: continue-on-error: false env: diff --git a/CODEOWNERS b/CODEOWNERS index 0edaa921e0..eba468f56e 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,7 +1,6 @@ * @petermetz @takeutak @izuru0 @jagpreetsinghsasan @vramakrishna @sandeepnRES @outSH packages/cactus-plugin-satp-hermes @RafaelAPB -packages/cactus-plugin-ledger-connector-ubiquity @RafaelAPB examples/cactus-example-cbdc-bridging @RafaelAPB examples/cactus-example-cbdc-bridging-backend @RafaelAPB examples/cactus-example-cbdc-bridging-frontend @RafaelAPB diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/.env.example b/packages/cactus-plugin-ledger-connector-ubiquity/.env.example deleted file mode 100644 index 0ea9cdedbc..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/.env.example +++ /dev/null @@ -1 +0,0 @@ -UBIQUITY_AUTH_TOKEN=xpto \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/.gitignore b/packages/cactus-plugin-ledger-connector-ubiquity/.gitignore deleted file mode 100644 index 4c49bd78f1..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.env diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/CHANGELOG.md b/packages/cactus-plugin-ledger-connector-ubiquity/CHANGELOG.md deleted file mode 100644 index 93c95144f8..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/CHANGELOG.md +++ /dev/null @@ -1,29 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [2.0.0-alpha.2](https://github.com/hyperledger/cacti/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2023-09-27) - -### Bug Fixes - -* use common conventions: tsconfig.json, package.json ([50f5c02](https://github.com/hyperledger/cacti/commit/50f5c02190ba28b77492c09e81f5d5ba6578e862)), closes [#2216](https://github.com/hyperledger/cacti/issues/2216) - -### Features - -* **openapi:** upgrade to 6.3.0 phase1 ([a094614](https://github.com/hyperledger/cacti/commit/a094614877d6043a6e3e8c0b3e95203eed7d6203)), closes [#2298](https://github.com/hyperledger/cacti/issues/2298) -* **plugin-persistence-fabric:** add new fabric persistence plugin ([47a64ee](https://github.com/hyperledger/cacti/commit/47a64ee17446db8102e2ca95f16b26f8778175a4)), closes [#2259](https://github.com/hyperledger/cacti/issues/2259) [#2265](https://github.com/hyperledger/cacti/issues/2265) - -# [2.0.0-alpha.1](https://github.com/hyperledger/cacti/compare/v2.0.0-alpha-prerelease...v2.0.0-alpha.1) (2023-05-19) - -**Note:** Version bump only for package @hyperledger/cactus-plugin-ledger-connector-ubiquity - -# [2.0.0-alpha-prerelease](https://github.com/hyperledger/cacti/compare/v1.2.0...v2.0.0-alpha-prerelease) (2023-05-11) - -**Note:** Version bump only for package @hyperledger/cactus-plugin-ledger-connector-ubiquity - -# [1.2.0](https://github.com/hyperledger/cactus/compare/v1.1.3...v1.2.0) (2023-03-28) - -### Features - -* **connector-ubiquity:** initial implementation ([7c59790](https://github.com/hyperledger/cactus/commit/7c597907910bd5cac919c855a3bfa9e533b6d5dd)) diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/README.md b/packages/cactus-plugin-ledger-connector-ubiquity/README.md deleted file mode 100644 index 2f61f6c9f0..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# `@hyperledger/cactus-plugin-ledger-connector-ubiquity -This plugin defines interfaces for developers to use a wrapped version of the Ubiquity SDK. Ubiquity is a high performance, multi-chain API for accessing blockchain data, i.e., provides one API to access multiple protocols: https://ubiquity.docs.blockdaemon.com/swagger-ui - -This API complements Cactus current connector offering by allowing to connect seamlessly to a multitude of public blockchains. Although it can be considered a ledger connector, for now - -## Supported Functionality --Read from smart contracts and addresses from 10+ different blockchains. - -## Usage -TBD - -## Installation - -**npm** - -```sh -npm install @hyperledger/cactus-plugin-ledger-connector-ubiquity -``` - -**yarn** - -```sh -yarn add @hyperledger/cactus-plugin-ledger-connector-ubiquity -``` - -Rename .env.example to .env and poopulate the environment variables. Alternatively, setup the AUTH_TOKEN environment variable (will be used to set up the auth token for the Ubiquity client). - -### Using as a Library -TBD - -## TODO -- Implement IPluginLedgerConnectorInterface with perhaps State pattern -- Containerize the plugin -- Add unit and integration tests -- Support full historical data across all Ubiquity supported protocols. -- Deploy public blockchain nodes on-the-go - -## License - -This distribution is published under the Apache License Version 2.0 found in the [LICENSE](../../LICENSE) file. - -## Acknowledgments -The development of this plugin is supported by Blockdaemon \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json b/packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json deleted file mode 100644 index 225ff1aaae..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/openapitools.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "6.6.0" - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/package.json b/packages/cactus-plugin-ledger-connector-ubiquity/package.json deleted file mode 100644 index b6ba1ee910..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "@hyperledger/cactus-plugin-ledger-connector-ubiquity", - "version": "2.0.0-alpha.2", - "description": "Allows Cacti nodes to connect to a set of public blockchains.", - "keywords": [ - "Hyperledger", - "Cactus", - "Integration", - "Blockchain", - "Distributed Ledger Technology", - "Ubiquity" - ], - "homepage": "https://github.com/hyperledger/cacti#readme", - "bugs": { - "url": "https://github.com/hyperledger/cacti/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/hyperledger/cacti.git" - }, - "license": "Apache-2.0", - "author": { - "name": "Hyperledger Cactus Contributors", - "email": "cactus@lists.hyperledger.org", - "url": "https://www.hyperledger.org/use/cacti" - }, - "contributors": [ - { - "name": "Please add yourself to the list of contributors", - "email": "your.name@example.com", - "url": "https://example.com" - }, - { - "name": "Rafael Belchior", - "email": "rbelchior@blockdaemon.com", - "url": "https://blockdaemon.com" - } - ], - "main": "dist/lib/main/typescript/index.js", - "module": "dist/lib/main/typescript/index.js", - "browser": "dist/cactus-plugin-ledger-connector-ubiquity.web.umd.js", - "types": "dist/lib/main/typescript/index.d.ts", - "files": [ - "dist/*" - ], - "scripts": { - "codegen": "run-p 'codegen:*'", - "codegen:openapi": "npm run generate-sdk", - "generate-sdk": "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", - "tsc": "tsc --project ./tsconfig.json", - "watch": "npm-watch", - "webpack": "npm-run-all webpack:dev", - "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", - "webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js", - "webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js" - }, - "dependencies": { - "@hyperledger/cactus-core": "2.0.0-alpha.2", - "@hyperledger/cactus-core-api": "2.0.0-alpha.2", - "axios": "1.6.0", - "dotenv": "16.0.1", - "node-fetch": "2.7.0", - "prom-client": "13.2.0", - "typescript-optional": "2.0.1", - "ubiquity-ts-client-renovated": "1.0.0", - "uuid": "9.0.1" - }, - "devDependencies": { - "@hyperledger/cactus-common": "2.0.0-alpha.2", - "@hyperledger/cactus-test-tooling": "2.0.0-alpha.2", - "@types/express": "4.17.19", - "@types/uuid": "9.0.8" - }, - "engines": { - "node": ">=18", - "npm": ">=8" - }, - "publishConfig": { - "access": "public" - }, - "browserMinified": "dist/cactus-plugin-ledger-connector-ubiquity.web.umd.min.js", - "mainMinified": "dist/cactus-plugin-ledger-connector-ubiquity.node.umd.min.js", - "watch": { - "codegen:openapi": { - "patterns": [ - "./src/main/json/openapi.json" - ] - }, - "tsc": { - "patterns": [ - "src/", - "src/*/json/**/openapi*" - ], - "ignore": [ - "src/**/generated/*" - ], - "extensions": [ - "ts", - "json" - ], - "quiet": true, - "verbose": false, - "runOnChangeOnly": true - } - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/json/openapi.json b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/json/openapi.json deleted file mode 100644 index 141da458cc..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/json/openapi.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "openapi": "3.0.3", - "info": { - "title": "Hyperledger Cactus Plugin - Ubiquity", - "description": "Ubiquity wrapper for Hyperledger Cactus", - "version": "v2.0.0-alpha.2", - "license": { - "name": "Apache-2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "components": { - "schemas": { - "GetTransactionsByAddressEndpoint": { - "type": "object", - "description": "Gets transactions that an address was involved with, from newest to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress", - "properties": { - "protocol": { - "type": "string" - }, - "network": { - "type": "string" - }, - "address": { - "type": "string" - } - }, - "required": ["protocol", "network", "address"] - } - } - }, - "paths": { - "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress": { - "post": { - "x-hyperledger-cacti": { - "http": { - "verbLowerCase": "post", - "path": "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress" - } - }, - "operationId": "GetTransactionByAddressV1", - "description": "", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetTransactionsByAddressEndpoint" - } - } - } - }, - "responses": { - "200": { - "description": "OK" - } - } - } - } - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/endpoints/transaction/get-transactions-endpoint.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/endpoints/transaction/get-transactions-endpoint.ts deleted file mode 100644 index 25405bf713..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/endpoints/transaction/get-transactions-endpoint.ts +++ /dev/null @@ -1,109 +0,0 @@ -import type { Express, Request, Response } from "express"; - -import { - IWebServiceEndpoint, - IExpressRequestHandler, - IEndpointAuthzOptions, -} from "@hyperledger/cactus-core-api"; -import { - Logger, - Checks, - LogLevelDesc, - LoggerProvider, - IAsyncProvider, -} from "@hyperledger/cactus-common"; - -import { registerWebServiceEndpoint } from "@hyperledger/cactus-core"; - -import { PluginLedgerConnectorUbiquity } from "../../plugin-ledger-connector-ubiquity"; - -import OAS from "../../../json/openapi.json"; - -export interface IGetTransactionsByAddressEndpointOptions { - logLevel?: LogLevelDesc; - ubiquity: PluginLedgerConnectorUbiquity; -} - -export class GetTransactionsByAddressEndpoint implements IWebServiceEndpoint { - public static readonly CLASS_NAME = "GetTransactionsByAddressEndpointOptions"; - - private readonly log: Logger; - - public get className(): string { - return GetTransactionsByAddressEndpoint.CLASS_NAME; - } - - constructor( - public readonly options: IGetTransactionsByAddressEndpointOptions, - ) { - const fnTag = `${this.className}#constructor()`; - Checks.truthy(options, `${fnTag} arg options`); - Checks.truthy(options.ubiquity, `${fnTag} arg options.connector`); - - const level = this.options.logLevel || "INFO"; - const label = this.className; - this.log = LoggerProvider.getOrCreate({ level, label }); - } - - public getPath(): string { - const apiPath = - OAS.paths[ - "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress" - ]; - return apiPath.post["x-hyperledger-cacti"].http.path; - } - - public getVerbLowerCase(): string { - const apiPath = - OAS.paths[ - "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress" - ]; - return apiPath.post["x-hyperledger-cacti"].http.verbLowerCase; - } - - public getOperationId(): string { - return OAS.paths[ - "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress" - ].post.operationId; - } - - getAuthorizationOptionsProvider(): IAsyncProvider { - // TODO: make this an injectable dependency in the constructor - return { - get: async () => ({ - isProtected: true, - requiredRoles: [], - }), - }; - } - - public async registerExpress( - expressApp: Express, - ): Promise { - await registerWebServiceEndpoint(expressApp, this); - return this; - } - - public getExpressRequestHandler(): IExpressRequestHandler { - return this.handleRequest.bind(this); - } - - public async handleRequest(req: Request, res: Response): Promise { - const reqTag = `${this.getVerbLowerCase()} - ${this.getPath()}`; - this.log.debug(reqTag); - try { - await this.options.ubiquity.getTxsByAddress( - req.body.protocol, - req.body.network, - req.body.address, - ); - res.status(200).json("OK"); - } catch (ex) { - this.log.error(`Crash while serving ${reqTag}`, ex); - res.status(500).json({ - message: "Internal Server Error", - error: ex?.stack || ex?.message, - }); - } - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES deleted file mode 100644 index 53250c0269..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/FILES +++ /dev/null @@ -1,5 +0,0 @@ -api.ts -base.ts -common.ts -configuration.ts -index.ts diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION deleted file mode 100644 index cd802a1ec4..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts deleted file mode 100644 index b0f46ee846..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/api.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Hyperledger Cactus Plugin - Ubiquity - * Ubiquity wrapper for Hyperledger Cactus - * - * The version of the OpenAPI document: v2.0.0-alpha.2 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from './configuration'; -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; -import type { RequestArgs } from './base'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base'; - -/** - * Gets transactions that an address was involved with, from newest to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress - * @export - * @interface GetTransactionsByAddressEndpoint - */ -export interface GetTransactionsByAddressEndpoint { - /** - * - * @type {string} - * @memberof GetTransactionsByAddressEndpoint - */ - 'protocol': string; - /** - * - * @type {string} - * @memberof GetTransactionsByAddressEndpoint - */ - 'network': string; - /** - * - * @type {string} - * @memberof GetTransactionsByAddressEndpoint - */ - 'address': string; -} - -/** - * DefaultApi - axios parameter creator - * @export - */ -export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @param {GetTransactionsByAddressEndpoint} [getTransactionsByAddressEndpoint] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByAddressV1: async (getTransactionsByAddressEndpoint?: GetTransactionsByAddressEndpoint, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(getTransactionsByAddressEndpoint, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DefaultApi - functional programming interface - * @export - */ -export const DefaultApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) - return { - /** - * - * @param {GetTransactionsByAddressEndpoint} [getTransactionsByAddressEndpoint] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getTransactionByAddressV1(getTransactionsByAddressEndpoint?: GetTransactionsByAddressEndpoint, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getTransactionByAddressV1(getTransactionsByAddressEndpoint, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - } -}; - -/** - * DefaultApi - factory interface - * @export - */ -export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DefaultApiFp(configuration) - return { - /** - * - * @param {GetTransactionsByAddressEndpoint} [getTransactionsByAddressEndpoint] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getTransactionByAddressV1(getTransactionsByAddressEndpoint?: GetTransactionsByAddressEndpoint, options?: any): AxiosPromise { - return localVarFp.getTransactionByAddressV1(getTransactionsByAddressEndpoint, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DefaultApi - object-oriented interface - * @export - * @class DefaultApi - * @extends {BaseAPI} - */ -export class DefaultApi extends BaseAPI { - /** - * - * @param {GetTransactionsByAddressEndpoint} [getTransactionsByAddressEndpoint] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getTransactionByAddressV1(getTransactionsByAddressEndpoint?: GetTransactionsByAddressEndpoint, options?: AxiosRequestConfig) { - return DefaultApiFp(this.configuration).getTransactionByAddressV1(getTransactionsByAddressEndpoint, options).then((request) => request(this.axios, this.basePath)); - } -} - - diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts deleted file mode 100644 index 60c72ba837..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/base.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Hyperledger Cactus Plugin - Ubiquity - * Ubiquity wrapper for Hyperledger Cactus - * - * The version of the OpenAPI document: v2.0.0-alpha.2 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from './configuration'; -// Some imports not used depending on template conditions -// @ts-ignore -import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; - -export const BASE_PATH = "http://localhost".replace(/\/+$/, ""); - -/** - * - * @export - */ -export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -}; - -/** - * - * @export - * @interface RequestArgs - */ -export interface RequestArgs { - url: string; - options: AxiosRequestConfig; -} - -/** - * - * @export - * @class BaseAPI - */ -export class BaseAPI { - protected configuration: Configuration | undefined; - - constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { - if (configuration) { - this.configuration = configuration; - this.basePath = configuration.basePath || this.basePath; - } - } -}; - -/** - * - * @export - * @class RequiredError - * @extends {Error} - */ -export class RequiredError extends Error { - constructor(public field: string, msg?: string) { - super(msg); - this.name = "RequiredError" - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts deleted file mode 100644 index 75fd225f33..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/common.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Hyperledger Cactus Plugin - Ubiquity - * Ubiquity wrapper for Hyperledger Cactus - * - * The version of the OpenAPI document: v2.0.0-alpha.2 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from "./configuration"; -import type { RequestArgs } from "./base"; -import type { AxiosInstance, AxiosResponse } from 'axios'; -import { RequiredError } from "./base"; - -/** - * - * @export - */ -export const DUMMY_BASE_URL = 'https://example.com' - -/** - * - * @throws {RequiredError} - * @export - */ -export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } -} - -/** - * - * @export - */ -export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } -} - -/** - * - * @export - */ -export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } -} - -/** - * - * @export - */ -export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } -} - -/** - * - * @export - */ -export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } -} - -function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { - if (parameter == null) return; - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); - } - else { - Object.keys(parameter).forEach(currentKey => - setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) - ); - } - } - else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter); - } - else { - urlSearchParams.set(key, parameter); - } - } -} - -/** - * - * @export - */ -export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search); - setFlattenedQueryParams(searchParams, objects); - url.search = searchParams.toString(); -} - -/** - * - * @export - */ -export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { - const nonString = typeof value !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers['Content-Type']) - : nonString; - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : (value || ""); -} - -/** - * - * @export - */ -export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash -} - -/** - * - * @export - */ -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); - }; -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/configuration.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/configuration.ts deleted file mode 100644 index 7e062ecf0b..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/configuration.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Hyperledger Cactus Plugin - Ubiquity - * Ubiquity wrapper for Hyperledger Cactus - * - * The version of the OpenAPI document: v2.0.0-alpha.2 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface ConfigurationParameters { - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - username?: string; - password?: string; - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - basePath?: string; - baseOptions?: any; - formDataCtor?: new () => any; -} - -export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string; - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string; - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string; - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any; - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any; - - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.baseOptions = param.baseOptions; - this.formDataCtor = param.formDataCtor; - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/index.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/index.ts deleted file mode 100644 index 2d012b4adb..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/generated/openapi/typescript-axios/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Hyperledger Cactus Plugin - Ubiquity - * Ubiquity wrapper for Hyperledger Cactus - * - * The version of the OpenAPI document: v2.0.0-alpha.2 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export * from "./api"; -export * from "./configuration"; - diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/helpers/api-parameters.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/helpers/api-parameters.ts deleted file mode 100644 index d77be434cc..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/helpers/api-parameters.ts +++ /dev/null @@ -1,19 +0,0 @@ -export type PROTOCOL_TYPE = - | "algorand" - | "bitcoin" - | "bitcoincash" - | "celo" - | "diem" - | "dogecoin" - | "ethereum" - | "litecoin" - | "near" - | "oasis" - | "polkadot" - | "xrp" - | "solana" - | "stellar" - | "terra" - | "tezos"; - -export type NETWORK_TYPE = "mainnet" | "testnet" | "ropsten"; diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.ts deleted file mode 100644 index 87cb558397..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./public-api"; diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.web.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.web.ts deleted file mode 100755 index cb0ff5c3b5..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/index.web.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/plugin-ledger-connector-ubiquity.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/plugin-ledger-connector-ubiquity.ts deleted file mode 100644 index cfc0aaeb04..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/plugin-ledger-connector-ubiquity.ts +++ /dev/null @@ -1,244 +0,0 @@ -import type { Express } from "express"; -import { - Logger, - Checks, - LogLevelDesc, - LoggerProvider, -} from "@hyperledger/cactus-common"; -import { PrometheusExporter } from "./prometheus-exporter/prometheus-exporter"; -import { v4 as uuidV4 } from "uuid"; -import type { AxiosResponse } from "axios"; -import fetch from "node-fetch"; -import dotenv from "dotenv"; -import path from "path"; - -import type { Response } from "node-fetch"; -import OAS from "../json/openapi.json"; - -import { NETWORK_TYPE, PROTOCOL_TYPE } from "./helpers/api-parameters"; -import { - ConsensusAlgorithmFamily, - ICactusPlugin, - IPluginLedgerConnector, - IPluginWebService, - IWebServiceEndpoint, -} from "@hyperledger/cactus-core-api"; -import { GetTransactionsByAddressEndpoint } from "./endpoints/transaction/get-transactions-endpoint"; -import { - UbiquityClient, - TxPage, - BalanceV1, - Tx, -} from "ubiquity-ts-client-renovated"; - -export interface IPluginLedgerConnectorUbiquity { - logLevel?: LogLevelDesc; - authToken: string; - instanceId?: string; - basePath?: string; - prometheusExporter?: PrometheusExporter; -} - -/** - * Note: The plugin connector interface methods are not provided by the initial - * implementation, and because of that the generic type parameters are set to - * `never` - */ - -export class PluginLedgerConnectorUbiquity - implements - IPluginLedgerConnector, - ICactusPlugin, - IPluginWebService -{ - public static readonly CLASS_NAME = "PluginLedgerConnectorUbiquity"; - private readonly instanceId: string; - private readonly log: Logger; - private client: UbiquityClient; - private authToken: string; - public prometheusExporter: PrometheusExporter; - private endpoints: IWebServiceEndpoint[] | undefined; - - public get className(): string { - return PluginLedgerConnectorUbiquity.CLASS_NAME; - } - - constructor(public readonly opts: IPluginLedgerConnectorUbiquity) { - const fnTag = `${this.className}#constructor()`; - const envPath = path.join(__dirname, "../.env"); - dotenv.config({ path: envPath }); - expect(process.env.UBIQUITY_AUTH_TOKEN).toBeTruthy(); - const authToken = process.env.UBIQUITY_AUTH_TOKEN; - if (!authToken) { - throw new Error("Auth token not defined"); - } - this.authToken = authToken; - Checks.truthy(opts, `${fnTag} arg options`); - Checks.truthy(opts.authToken, `${fnTag} options.authToken`); - Checks.truthy(opts.logLevel, `${fnTag} options.logLevel`); - Checks.truthy(opts.instanceId, `${fnTag} options.instanceId`); - this.log = LoggerProvider.getOrCreate({ - label: this.className, - level: opts.logLevel, - }); - - this.instanceId = opts.instanceId || uuidV4(); - this.log.debug("Initialized"); - this.client = new UbiquityClient( - opts.authToken, - opts.basePath || "https://ubiquity.api.blockdaemon.com/v1", - ); - this.prometheusExporter = - opts.prometheusExporter || - new PrometheusExporter({ pollingIntervalInMin: 1 }); - - this.prometheusExporter.startMetricsCollection(); - } - deployContract(options?: string): Promise { - throw new Error(`Method not implemented. ${options}`); - } - transact(options?: string): Promise { - throw new Error(`Method not implemented. ${options}`); - } - getConsensusAlgorithmFamily(): Promise { - throw new Error("Method not implemented."); - } - - async hasTransactionFinality(): Promise { - return false; - } - - // Documentation: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress - public async getTxsByAddress( - protocol: PROTOCOL_TYPE, - network: NETWORK_TYPE, - address: string, - continuation?: string, - limit?: number, - ): Promise { - const fnTag = `${this.className}:GetTxsByAddress`; - this.log.debug("enter ", fnTag); - const response = await this.client.accountsApi.getTxsByAddress( - protocol, - network, - address, - "asc", - continuation, - limit, - ); - this.prometheusExporter.addMethodCall(); - return response.data; - } - - // Documentation: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetBalancesByAddresses - public getBalancesByAddresses( - protocol: PROTOCOL_TYPE, - network: NETWORK_TYPE, - address: string, - ): Promise> { - const fnTag = `${this.className}:GetBalancesByAddresses`; - this.log.debug("enter ", fnTag); - const accounts = this.client.accountsApi.getListOfBalancesByAddress( - protocol, - network, - address, - ); - this.prometheusExporter.addMethodCall(); - return accounts; - } - - // Documentation: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Transactions/V2GetTx - public getTx( - protocol: PROTOCOL_TYPE, - network: NETWORK_TYPE, - id: string, - ): Promise> { - const fnTag = `${this.className}:GetTx`; - this.log.debug("enter ", fnTag); - - const transactions = this.client.transactionsApi.getTx( - protocol, - network, - id, - ); - this.prometheusExporter.addMethodCall(); - return transactions; - } - - // Documentation: https://ethereum.org/en/developers/docs/apis/json-rpc/ - public async nativeGetTx( - protocol: PROTOCOL_TYPE, - network: NETWORK_TYPE, - ): Promise { - const fnTag = `${this.className}:NativeGetTx`; - this.log.debug("enter ", fnTag); - const ethereumUrl = `https://svc.blockdaemon.com/${protocol}/${network}/native`; - - const body = ""; - const resp = fetch(ethereumUrl, { - method: "POST", - body: JSON.stringify(body), - headers: { - Authorization: this.authToken, - "Content-Type": "application/json", - }, - }); - - const data = await (await resp).text(); - this.log.debug(data); - this.prometheusExporter.addMethodCall(); - return resp; - } - - public getInstanceId(): string { - return this.instanceId; - } - - public getPackageName(): string { - return `@hyperledger/cactus-plugin-ledger-connector-ubiquity`; - } - - public async shutdown(): Promise { - return; - } - - public getPrometheusExporter(): PrometheusExporter { - return this.prometheusExporter; - } - - public async getPrometheusExporterMetrics(): Promise { - const res: string = await this.prometheusExporter.getPrometheusMetrics(); - this.log.debug(`getPrometheusExporterMetrics() response: %o`, res); - return res; - } - - public async onPluginInit(): Promise { - return; - } - - async registerWebServices(app: Express): Promise { - const webServices = await this.getOrCreateWebServices(); - await Promise.all(webServices.map((ws) => ws.registerExpress(app))); - return webServices; - } - - public async getOrCreateWebServices(): Promise { - if (Array.isArray(this.endpoints)) { - return this.endpoints; - } - - // Server endpoints - const getTransactionsByAddressEndpoint = - new GetTransactionsByAddressEndpoint({ - logLevel: "DEBUG", - ubiquity: this, - }); - - this.endpoints = [getTransactionsByAddressEndpoint]; - return this.endpoints; - } - - public getOpenApiSpec(): unknown { - return OAS; - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/data-fetcher.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/data-fetcher.ts deleted file mode 100644 index 47cca225a1..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/data-fetcher.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Calls } from "./response.type"; - -import { totalTxCount, K_CACTUS_UBIQUITY_TOTAL_METHOD_CALLS } from "./metrics"; - -export async function collectMetrics(calls: Calls): Promise { - totalTxCount.labels(K_CACTUS_UBIQUITY_TOTAL_METHOD_CALLS).set(calls.counter); -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/metrics.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/metrics.ts deleted file mode 100644 index 992cb30fa6..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/metrics.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Gauge } from "prom-client"; - -export const K_CACTUS_UBIQUITY_TOTAL_METHOD_CALLS = - "ubiquity_total_method_calls"; - -export const totalTxCount = new Gauge({ - name: K_CACTUS_UBIQUITY_TOTAL_METHOD_CALLS, - help: "Total method calls", - labelNames: ["type"], -}); diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/prometheus-exporter.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/prometheus-exporter.ts deleted file mode 100644 index f32247cb1b..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/prometheus-exporter.ts +++ /dev/null @@ -1,40 +0,0 @@ -import promClient, { Registry } from "prom-client"; -import { Calls } from "./response.type"; -import { totalTxCount, K_CACTUS_UBIQUITY_TOTAL_METHOD_CALLS } from "./metrics"; - -export interface IPrometheusExporterOptions { - pollingIntervalInMin?: number; -} - -export class PrometheusExporter { - public readonly metricsPollingIntervalInMin: number; - public readonly calls: Calls = { counter: 0 }; - public readonly registry: Registry; - - constructor( - public readonly prometheusExporterOptions: IPrometheusExporterOptions, - ) { - this.metricsPollingIntervalInMin = - prometheusExporterOptions.pollingIntervalInMin || 1; - this.registry = new Registry(); - } - - public addMethodCall(): void { - this.calls.counter++; - totalTxCount - .labels(K_CACTUS_UBIQUITY_TOTAL_METHOD_CALLS) - .set(this.calls.counter); - } - - public async getPrometheusMetrics(): Promise { - const result = await this.registry.getSingleMetricAsString( - K_CACTUS_UBIQUITY_TOTAL_METHOD_CALLS, - ); - return result; - } - - public startMetricsCollection(): void { - this.registry.registerMetric(totalTxCount); - promClient.collectDefaultMetrics({ register: this.registry }); - } -} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/response.type.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/response.type.ts deleted file mode 100644 index 3076519779..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/prometheus-exporter/response.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type Calls = { - counter: number; -}; diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/public-api.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/public-api.ts deleted file mode 100644 index e66304cc20..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/typescript/public-api.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { - PluginLedgerConnectorUbiquity, - IPluginLedgerConnectorUbiquity, -} from "./plugin-ledger-connector-ubiquity"; -export * from "./generated/openapi/typescript-axios/index"; diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/init.test.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/init.test.ts deleted file mode 100644 index 658573acbc..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/init.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import dotenv from "dotenv"; -import path from "path"; -const envPath = path.join(__dirname, "../../../../.env"); -dotenv.config({ path: envPath }); - -import "jest-extended"; -import { v4 as uuidv4 } from "uuid"; -import { - Containers, - pruneDockerAllIfGithubAction, -} from "@hyperledger/cactus-test-tooling"; -import { LogLevelDesc, Checks } from "@hyperledger/cactus-common"; - -import { - PluginLedgerConnectorUbiquity, - IPluginLedgerConnectorUbiquity, -} from "../../../main/typescript/public-api"; - -const testCase = "initialize ubiquity plugin"; -const logLevel: LogLevelDesc = "TRACE"; -expect(process.env.UBIQUITY_AUTH_TOKEN).toBeTruthy(); -const authToken = process.env.UBIQUITY_AUTH_TOKEN; -if (!authToken) { - throw new Error("Auth token not defined"); -} - -describe(testCase, () => { - beforeAll(async () => { - const pruning = pruneDockerAllIfGithubAction({ logLevel }); - await expect(pruning).resolves.toBeTruthy(); - }); - - afterAll(async () => { - await Containers.logDiagnostics({ logLevel }); - }); - - afterAll(async () => { - const pruning = pruneDockerAllIfGithubAction({ logLevel }); - await expect(pruning).resolves.toBeTruthy(); - }); - - test(testCase, async () => { - const options: IPluginLedgerConnectorUbiquity = { - logLevel: logLevel, - authToken: authToken, - instanceId: uuidv4(), - }; - const api = new PluginLedgerConnectorUbiquity(options); - Checks.truthy(api); - }); -}); diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/obtain-all-txs.test.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/obtain-all-txs.test.ts deleted file mode 100644 index c751088624..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/integration/obtain-all-txs.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -import "jest-extended"; -import dotenv from "dotenv"; -import path from "path"; -const envPath = path.join(__dirname, "../../../../.env"); -dotenv.config({ path: envPath }); -import { v4 as uuidv4 } from "uuid"; -import { - Containers, - pruneDockerAllIfGithubAction, -} from "@hyperledger/cactus-test-tooling"; -import { LogLevelDesc, Checks } from "@hyperledger/cactus-common"; - -import { - PluginLedgerConnectorUbiquity, - IPluginLedgerConnectorUbiquity, -} from "../../../main/typescript/public-api"; - -const testCase = "obtain all txs"; -const logLevel: LogLevelDesc = "TRACE"; -expect(process.env.UBIQUITY_AUTH_TOKEN).toBeTruthy(); -const authToken = process.env.UBIQUITY_AUTH_TOKEN; -if (!authToken) { - throw new Error( - "Auth token not defined. Please generate a token at https://app.blockdaemon.com/", - ); -} - -describe(testCase, () => { - beforeAll(async () => { - const pruning = pruneDockerAllIfGithubAction({ logLevel }); - await expect(pruning).resolves.toBeTruthy(); - }); - - afterAll(async () => { - await Containers.logDiagnostics({ logLevel }); - }); - - afterAll(async () => { - const pruning = pruneDockerAllIfGithubAction({ logLevel }); - await expect(pruning).resolves.toBeTruthy(); - }); - - const options: IPluginLedgerConnectorUbiquity = { - logLevel: logLevel, - authToken: authToken, - instanceId: uuidv4(), - basePath: "https://svc.blockdaemon.com/universal/v1/", - }; - - const api = new PluginLedgerConnectorUbiquity(options); - Checks.truthy(api); - - // Rainbow bridge ethereum custodian contract - const address = "0x6BFaD42cFC4EfC96f529D786D643Ff4A8B89FA52"; - - test("GetTxsByAddress", async () => { - const transactions = await api.getTxsByAddress( - "ethereum", - "mainnet", - address, - ); - Checks.truthy(transactions); - Checks.truthy(transactions.total === 25); - - const tx = await api.getTx( - "ethereum", - "mainnet", - "0x78df45ed70b64e08105dea46f762faa5680342a40259eb29006f1ab6ca38f05a", - ); - Checks.truthy(tx); - Checks.truthy(tx.data); - }); - - test("GetBalancesByAddresses", async () => { - const response = await api.getBalancesByAddresses( - "ethereum", - "mainnet", - address, - ); - Checks.truthy(response); - }); -}); diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/unit/api-surface.test.ts b/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/unit/api-surface.test.ts deleted file mode 100644 index 34aba3a0ae..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/src/test/typescript/unit/api-surface.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as apiSurface from "../../../main/typescript/public-api"; -import "jest-extended"; - -test("Library can be loaded", async () => { - expect(apiSurface).toBeTruthy(); -}); diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/tsconfig.json b/packages/cactus-plugin-ledger-connector-ubiquity/tsconfig.json deleted file mode 100644 index 3bed67f1e5..0000000000 --- a/packages/cactus-plugin-ledger-connector-ubiquity/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./dist/lib/", - "declarationDir": "dist/lib", - "resolveJsonModule": true, - "rootDir": "./src", - "tsBuildInfoFile": "../../.build-cache/cactus-plugin-ledger-connector-ubiquity.tsbuildinfo" - }, - "include": [ - "./src", - "src/**/*.json" - ], - "references": [ - { - "path": "../cactus-common/tsconfig.json" - }, - { - "path": "../cactus-test-tooling/tsconfig.json" - }, - { - "path": "../cactus-core-api/tsconfig.json" - }, - { - "path": "../cactus-core/tsconfig.json" - } - ] - } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index d53718a03c..880dddb651 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -169,9 +169,6 @@ { "path": "./extensions/cactus-plugin-htlc-coordinator-besu/tsconfig.json" }, - { - "path": "./packages/cactus-plugin-ledger-connector-ubiquity/tsconfig.json" - }, { "path": "./packages/cactus-plugin-persistence-fabric/tsconfig.json" } diff --git a/yarn.lock b/yarn.lock index d9e977d097..f239e4ea79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8755,26 +8755,6 @@ __metadata: languageName: unknown linkType: soft -"@hyperledger/cactus-plugin-ledger-connector-ubiquity@workspace:packages/cactus-plugin-ledger-connector-ubiquity": - version: 0.0.0-use.local - resolution: "@hyperledger/cactus-plugin-ledger-connector-ubiquity@workspace:packages/cactus-plugin-ledger-connector-ubiquity" - dependencies: - "@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-test-tooling": "npm:2.0.0-alpha.2" - "@types/express": "npm:4.17.19" - "@types/uuid": "npm:9.0.8" - axios: "npm:1.6.0" - dotenv: "npm:16.0.1" - node-fetch: "npm:2.7.0" - prom-client: "npm:13.2.0" - typescript-optional: "npm:2.0.1" - ubiquity-ts-client-renovated: "npm:1.0.0" - uuid: "npm:9.0.1" - languageName: unknown - linkType: soft - "@hyperledger/cactus-plugin-ledger-connector-xdai@npm:2.0.0-alpha.2, @hyperledger/cactus-plugin-ledger-connector-xdai@workspace:packages/cactus-plugin-ledger-connector-xdai": version: 0.0.0-use.local resolution: "@hyperledger/cactus-plugin-ledger-connector-xdai@workspace:packages/cactus-plugin-ledger-connector-xdai" @@ -9956,15 +9936,6 @@ __metadata: languageName: node linkType: hard -"@jest/schemas@npm:^29.6.3": - version: 29.6.3 - resolution: "@jest/schemas@npm:29.6.3" - dependencies: - "@sinclair/typebox": "npm:^0.27.8" - checksum: 10/910040425f0fc93cd13e68c750b7885590b8839066dfa0cd78e7def07bbb708ad869381f725945d66f2284de5663bbecf63e8fdd856e2ae6e261ba30b1687e93 - languageName: node - linkType: hard - "@jest/source-map@npm:^27.5.1": version: 27.5.1 resolution: "@jest/source-map@npm:27.5.1" @@ -18722,13 +18693,6 @@ __metadata: languageName: node linkType: hard -"bech32@npm:=2.0.0": - version: 2.0.0 - resolution: "bech32@npm:2.0.0" - checksum: 10/fa15acb270b59aa496734a01f9155677b478987b773bf701f465858bf1606c6a970085babd43d71ce61895f1baa594cb41a2cd1394bd2c6698f03cc2d811300e - languageName: node - linkType: hard - "becke-ch--regex--s0-0-v1--base--pl--lib@npm:^1.2.0": version: 1.4.0 resolution: "becke-ch--regex--s0-0-v1--base--pl--lib@npm:1.4.0" @@ -18793,13 +18757,6 @@ __metadata: languageName: node linkType: hard -"bigi@npm:^1.1.0, bigi@npm:^1.4.2": - version: 1.4.2 - resolution: "bigi@npm:1.4.2" - checksum: 10/e8165beb2ad113add286f81a066653295737a3edc6287effae7b72c2d7695be19d36774069e80a977df7187857c9e2c4a9517f6ec966bb887e097ea8d36cc2e0 - languageName: node - linkType: hard - "bigint-crypto-utils@npm:^3.0.23": version: 3.2.2 resolution: "bigint-crypto-utils@npm:3.2.2" @@ -18863,35 +18820,6 @@ __metadata: languageName: node linkType: hard -"bip-schnorr@npm:=0.6.4": - version: 0.6.4 - resolution: "bip-schnorr@npm:0.6.4" - dependencies: - bigi: "npm:^1.4.2" - ecurve: "npm:^1.0.6" - js-sha256: "npm:^0.9.0" - randombytes: "npm:^2.1.0" - safe-buffer: "npm:^5.2.1" - checksum: 10/913859c57264e51505b57706616949fae23a9c0546f5d414dfd72b62b87fb8b9fcfe7b2006ae3dd52f9a9f78cfb1dc30b0c2d5414dcced266fc074aaea01c146 - languageName: node - linkType: hard - -"bitcore-lib@npm:10.0.11": - version: 10.0.11 - resolution: "bitcore-lib@npm:10.0.11" - dependencies: - bech32: "npm:=2.0.0" - bip-schnorr: "npm:=0.6.4" - bn.js: "npm:=4.11.8" - bs58: "npm:^4.0.1" - buffer-compare: "npm:=1.1.1" - elliptic: "npm:^6.5.3" - inherits: "npm:=2.0.1" - lodash: "npm:^4.17.20" - checksum: 10/db1e15dafea95a88bebe3f81b4c284872405c2d23984891d91ff94ca312b644bfe6948d69edef187d57a12483d62f6ec1442957eb91d27db22768252405bc003 - languageName: node - linkType: hard - "bl@npm:5.0.0": version: 5.0.0 resolution: "bl@npm:5.0.0" @@ -18977,13 +18905,6 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:=4.11.8": - version: 4.11.8 - resolution: "bn.js@npm:4.11.8" - checksum: 10/b498be9c0914dfe8e9892c1bb924a920ef8b5d4eeec3c9b670c92f55d6f20ba6342df0f6dc127da8a9917676f86edf1963c6048daa567aae53fde0356e1fabbf - languageName: node - linkType: hard - "bn.js@npm:^5.0.0, bn.js@npm:^5.1.1, bn.js@npm:^5.1.2, bn.js@npm:^5.2.0": version: 5.2.0 resolution: "bn.js@npm:5.2.0" @@ -19459,13 +19380,6 @@ __metadata: languageName: node linkType: hard -"buffer-compare@npm:=1.1.1": - version: 1.1.1 - resolution: "buffer-compare@npm:1.1.1" - checksum: 10/dc5adc7406a25059ae9d2088d455bfaffeabad2c1540ad7d6d432ec257efa06ff8efc3e87d887ed46a042ac448fb1dba37e559e602753b63e097fdeac732369e - languageName: node - linkType: hard - "buffer-crc32@npm:~0.2.3": version: 0.2.13 resolution: "buffer-crc32@npm:0.2.13" @@ -23474,13 +23388,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^29.6.3": - version: 29.6.3 - resolution: "diff-sequences@npm:29.6.3" - checksum: 10/179daf9d2f9af5c57ad66d97cb902a538bcf8ed64963fa7aa0c329b3de3665ce2eb6ffdc2f69f29d445fa4af2517e5e55e5b6e00c00a9ae4f43645f97f7078cb - languageName: node - linkType: hard - "diff@npm:3.5.0, diff@npm:^3.0.0, diff@npm:^3.1.0, diff@npm:^3.5.0": version: 3.5.0 resolution: "diff@npm:3.5.0" @@ -23963,16 +23870,6 @@ __metadata: languageName: node linkType: hard -"ecurve@npm:^1.0.6": - version: 1.0.6 - resolution: "ecurve@npm:1.0.6" - dependencies: - bigi: "npm:^1.1.0" - safe-buffer: "npm:^5.0.1" - checksum: 10/5f738e564ad956acbcd743239b0b9e144d1fca999b6018370d86084545bf03ac5b63229918ab0b2ff87f676e85c23dedabc0f1ad6ea2eef160da70cb3119924b - languageName: node - linkType: hard - "ee-first@npm:1.1.1": version: 1.1.1 resolution: "ee-first@npm:1.1.1" @@ -30386,13 +30283,6 @@ __metadata: languageName: node linkType: hard -"inherits@npm:=2.0.1": - version: 2.0.1 - resolution: "inherits@npm:2.0.1" - checksum: 10/37165f42e53627edc18d815654a79e7407e356adf480aab77db3a12c978e597f3af632cf0459472dd5a088bc21ee911020f544c0d3c23b45bcfd1cd92fe9e404 - languageName: node - linkType: hard - "ini@npm:1.3.8, ini@npm:^1.3.4, ini@npm:^1.3.5, ini@npm:~1.3.0": version: 1.3.8 resolution: "ini@npm:1.3.8" @@ -31938,21 +31828,21 @@ __metadata: languageName: node linkType: hard -"isomorphic-ws@npm:5.0.0, isomorphic-ws@npm:^5.0.0": - version: 5.0.0 - resolution: "isomorphic-ws@npm:5.0.0" +"isomorphic-ws@npm:^4.0.1": + version: 4.0.1 + resolution: "isomorphic-ws@npm:4.0.1" peerDependencies: ws: "*" - checksum: 10/e20eb2aee09ba96247465fda40c6d22c1153394c0144fa34fe6609f341af4c8c564f60ea3ba762335a7a9c306809349f9b863c8beedf2beea09b299834ad5398 + checksum: 10/d7190eadefdc28bdb93d67b5f0c603385aaf87724fa2974abb382ac1ec9756ed2cfb27065cbe76122879c2d452e2982bc4314317f3d6c737ddda6c047328771a languageName: node linkType: hard -"isomorphic-ws@npm:^4.0.1": - version: 4.0.1 - resolution: "isomorphic-ws@npm:4.0.1" +"isomorphic-ws@npm:^5.0.0": + version: 5.0.0 + resolution: "isomorphic-ws@npm:5.0.0" peerDependencies: ws: "*" - checksum: 10/d7190eadefdc28bdb93d67b5f0c603385aaf87724fa2974abb382ac1ec9756ed2cfb27065cbe76122879c2d452e2982bc4314317f3d6c737ddda6c047328771a + checksum: 10/e20eb2aee09ba96247465fda40c6d22c1153394c0144fa34fe6609f341af4c8c564f60ea3ba762335a7a9c306809349f9b863c8beedf2beea09b299834ad5398 languageName: node linkType: hard @@ -32591,18 +32481,6 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^29.2.0": - version: 29.7.0 - resolution: "jest-diff@npm:29.7.0" - dependencies: - chalk: "npm:^4.0.0" - diff-sequences: "npm:^29.6.3" - jest-get-type: "npm:^29.6.3" - pretty-format: "npm:^29.7.0" - checksum: 10/6f3a7eb9cd9de5ea9e5aa94aed535631fa6f80221832952839b3cb59dd419b91c20b73887deb0b62230d06d02d6b6cf34ebb810b88d904bb4fe1e2e4f0905c98 - languageName: node - linkType: hard - "jest-docblock@npm:^27.5.1": version: 27.5.1 resolution: "jest-docblock@npm:27.5.1" @@ -32719,13 +32597,6 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^29.6.3": - version: 29.6.3 - resolution: "jest-get-type@npm:29.6.3" - checksum: 10/88ac9102d4679d768accae29f1e75f592b760b44277df288ad76ce5bf038c3f5ce3719dea8aa0f035dac30e9eb034b848ce716b9183ad7cc222d029f03e92205 - languageName: node - linkType: hard - "jest-haste-map@npm:^27.5.1": version: 27.5.1 resolution: "jest-haste-map@npm:27.5.1" @@ -33337,16 +33208,6 @@ __metadata: languageName: node linkType: hard -"jest-websocket-mock@npm:2.5.0": - version: 2.5.0 - resolution: "jest-websocket-mock@npm:2.5.0" - dependencies: - jest-diff: "npm:^29.2.0" - mock-socket: "npm:^9.3.0" - checksum: 10/99585445503ef5ab391052243643dc1afa1abf9dfa65a39f4bd55b9b0918cc6c486847c9d059fdefb337370eb06fef269c1ca0e76fd755abcfd3e73bf4c2bd87 - languageName: node - linkType: hard - "jest-worker@npm:^26.2.1": version: 26.6.2 resolution: "jest-worker@npm:26.6.2" @@ -33483,7 +33344,7 @@ __metadata: languageName: node linkType: hard -"js-sha256@npm:0.9.0, js-sha256@npm:^0.9.0": +"js-sha256@npm:0.9.0": version: 0.9.0 resolution: "js-sha256@npm:0.9.0" checksum: 10/4dc16be74bf4e60d8ee2a482cc822c4d4f5cd060d9f92a060fe3ab1f143cd0946edda552cd274459251c279073df15872a5df47fc4bff054bbc3812e396e990b @@ -36857,7 +36718,7 @@ __metadata: languageName: node linkType: hard -"mock-socket@npm:^9.2.1, mock-socket@npm:^9.3.0": +"mock-socket@npm:^9.2.1": version: 9.3.1 resolution: "mock-socket@npm:9.3.1" checksum: 10/c5c07568f2859db6926d79cb61580c07e67958b5cd6b52d1270fdfa17ae066d7f74a18a4208fc4386092eea4e1ee001aa23f015c88a1774265994e4fae34d18e @@ -37571,20 +37432,6 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.7.0, node-fetch@npm:^2.6.8, node-fetch@npm:^2.6.9": - version: 2.7.0 - resolution: "node-fetch@npm:2.7.0" - dependencies: - whatwg-url: "npm:^5.0.0" - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - checksum: 10/b24f8a3dc937f388192e59bcf9d0857d7b6940a2496f328381641cb616efccc9866e89ec43f2ec956bbd6c3d3ee05524ce77fe7b29ccd34692b3a16f237d6676 - languageName: node - linkType: hard - "node-fetch@npm:3.0.0-beta.9": version: 3.0.0-beta.9 resolution: "node-fetch@npm:3.0.0-beta.9" @@ -37609,6 +37456,20 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:^2.6.8, node-fetch@npm:^2.6.9": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" + dependencies: + whatwg-url: "npm:^5.0.0" + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: 10/b24f8a3dc937f388192e59bcf9d0857d7b6940a2496f328381641cb616efccc9866e89ec43f2ec956bbd6c3d3ee05524ce77fe7b29ccd34692b3a16f237d6676 + languageName: node + linkType: hard + "node-fetch@npm:^3.2.10": version: 3.3.1 resolution: "node-fetch@npm:3.3.1" @@ -41708,17 +41569,6 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.7.0": - version: 29.7.0 - resolution: "pretty-format@npm:29.7.0" - dependencies: - "@jest/schemas": "npm:^29.6.3" - ansi-styles: "npm:^5.0.0" - react-is: "npm:^18.0.0" - checksum: 10/dea96bc83c83cd91b2bfc55757b6b2747edcaac45b568e46de29deee80742f17bc76fe8898135a70d904f4928eafd8bb693cd1da4896e8bdd3c5e82cadf1d2bb - languageName: node - linkType: hard - "printj@npm:~1.3.1": version: 1.3.1 resolution: "printj@npm:1.3.1" @@ -48983,20 +48833,6 @@ __metadata: languageName: node linkType: hard -"ubiquity-ts-client-renovated@npm:1.0.0": - version: 1.0.0 - resolution: "ubiquity-ts-client-renovated@npm:1.0.0" - dependencies: - axios: "npm:1.5.1" - bitcore-lib: "npm:10.0.11" - isomorphic-ws: "npm:5.0.0" - jest-websocket-mock: "npm:2.5.0" - web3: "npm:4.2.0" - ws: "npm:8.14.2" - checksum: 10/a428981309c0fe0f542f1e993609ea4f0f26c4ec22a0d249095637395f2ecd59dec35f504f14a5d779bf46b407477911c39155e093cc544d80232c39b4bd31be - languageName: node - linkType: hard - "uglify-js@npm:^3.1.4": version: 3.15.1 resolution: "uglify-js@npm:3.15.1" @@ -50626,25 +50462,6 @@ __metadata: languageName: node linkType: hard -"web3-core@npm:^4.3.1": - version: 4.3.1 - resolution: "web3-core@npm:4.3.1" - dependencies: - web3-errors: "npm:^1.1.4" - web3-eth-iban: "npm:^4.0.7" - web3-providers-http: "npm:^4.1.0" - web3-providers-ipc: "npm:^4.0.7" - web3-providers-ws: "npm:^4.0.7" - web3-types: "npm:^1.3.1" - web3-utils: "npm:^4.0.7" - web3-validator: "npm:^2.0.3" - dependenciesMeta: - web3-providers-ipc: - optional: true - checksum: 10/60e0a7959963bb828867bdbebd24b28d85251dc9d04c19bfae243d7a6012470416030e12e8a89688499e25bdd10bd1311ffb75dfd07148b6587ff67b91e778ac - languageName: node - linkType: hard - "web3-core@npm:^4.3.2": version: 4.3.2 resolution: "web3-core@npm:4.3.2" @@ -50796,19 +50613,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-abi@npm:^4.1.3": - version: 4.1.3 - resolution: "web3-eth-abi@npm:4.1.3" - dependencies: - abitype: "npm:0.7.1" - web3-errors: "npm:^1.1.3" - web3-types: "npm:^1.3.0" - web3-utils: "npm:^4.0.7" - web3-validator: "npm:^2.0.3" - checksum: 10/a9b61bb7b3d5f6db4a5bd507dccc5216837e9ab52cc7767939f758ca3843e9124b7fe1c3e272530d766ba6b3c336586ab927c4b64d450b9d149ae5fc07d2ad54 - languageName: node - linkType: hard - "web3-eth-abi@npm:^4.1.4": version: 4.1.4 resolution: "web3-eth-abi@npm:4.1.4" @@ -51133,21 +50937,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-contract@npm:^4.1.1": - version: 4.1.3 - resolution: "web3-eth-contract@npm:4.1.3" - dependencies: - web3-core: "npm:^4.3.1" - web3-errors: "npm:^1.1.4" - web3-eth: "npm:^4.3.1" - web3-eth-abi: "npm:^4.1.4" - web3-types: "npm:^1.3.1" - web3-utils: "npm:^4.0.7" - web3-validator: "npm:^2.0.3" - checksum: 10/193c86b5fbeebed8bef144c3a4eabd4746b968aaa05186b77cf262cdc946fbea596a308d6ea2b805e65a03bf84e0553a629dec0d2731467086502ac218d9263f - languageName: node - linkType: hard - "web3-eth-contract@npm:^4.1.2": version: 4.1.2 resolution: "web3-eth-contract@npm:4.1.2" @@ -51276,23 +51065,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-ens@npm:^4.0.7": - version: 4.0.7 - resolution: "web3-eth-ens@npm:4.0.7" - dependencies: - "@adraffy/ens-normalize": "npm:^1.8.8" - web3-core: "npm:^4.3.0" - web3-errors: "npm:^1.1.3" - web3-eth: "npm:^4.3.0" - web3-eth-contract: "npm:^4.1.1" - web3-net: "npm:^4.0.7" - web3-types: "npm:^1.3.0" - web3-utils: "npm:^4.0.7" - web3-validator: "npm:^2.0.3" - checksum: 10/de028a1f73a9f071897344b19f498a31ddad3e24d9bef6a4c3c0a6bfb0c4b23b70dd28d2d8b777d4a92f6c4a0383ce0baa5d854e94adfe6fac5ef587c52057af - languageName: node - linkType: hard - "web3-eth-ens@npm:^4.0.8": version: 4.0.8 resolution: "web3-eth-ens@npm:4.0.8" @@ -51492,20 +51264,6 @@ __metadata: languageName: node linkType: hard -"web3-eth-personal@npm:^4.0.7": - version: 4.0.7 - resolution: "web3-eth-personal@npm:4.0.7" - dependencies: - web3-core: "npm:^4.3.0" - web3-eth: "npm:^4.3.0" - web3-rpc-methods: "npm:^1.1.3" - web3-types: "npm:^1.3.0" - web3-utils: "npm:^4.0.7" - web3-validator: "npm:^2.0.3" - checksum: 10/5e9be4826a4174d9537372557660a8fd8f3bfad88870cd13231d144ee2a1de0e96a036191fc2b95464e976c00f3b04c7a97cac0beaef4a932c046b78949a5199 - languageName: node - linkType: hard - "web3-eth-personal@npm:^4.0.8": version: 4.0.8 resolution: "web3-eth-personal@npm:4.0.8" @@ -51678,7 +51436,7 @@ __metadata: languageName: node linkType: hard -"web3-eth@npm:^4.3.0, web3-eth@npm:^4.3.1": +"web3-eth@npm:^4.3.1": version: 4.3.1 resolution: "web3-eth@npm:4.3.1" dependencies: @@ -52552,30 +52310,6 @@ __metadata: languageName: node linkType: hard -"web3@npm:4.2.0": - version: 4.2.0 - resolution: "web3@npm:4.2.0" - dependencies: - web3-core: "npm:^4.3.0" - web3-errors: "npm:^1.1.3" - web3-eth: "npm:^4.3.0" - web3-eth-abi: "npm:^4.1.3" - web3-eth-accounts: "npm:^4.1.0" - web3-eth-contract: "npm:^4.1.1" - web3-eth-ens: "npm:^4.0.7" - web3-eth-iban: "npm:^4.0.7" - web3-eth-personal: "npm:^4.0.7" - web3-net: "npm:^4.0.7" - web3-providers-http: "npm:^4.1.0" - web3-providers-ws: "npm:^4.0.7" - web3-rpc-methods: "npm:^1.1.3" - web3-types: "npm:^1.3.0" - web3-utils: "npm:^4.0.7" - web3-validator: "npm:^2.0.3" - checksum: 10/5a2ab80374a7ae4359892d7e69b45560d115016285f3ae496382c453b9a0ec246bbc19b034375d7966bd5315c9ebf2591103b197eae09bb08ff58aee452005ee - languageName: node - linkType: hard - "web3@npm:4.4.0": version: 4.4.0 resolution: "web3@npm:4.4.0" @@ -53727,21 +53461,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.14.2": - version: 8.14.2 - resolution: "ws@npm:8.14.2" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 10/815ff01d9bc20a249b2228825d9739268a03a4408c2e0b14d49b0e2ae89d7f10847e813b587ba26992bdc33e9d03bed131e4cae73ff996baf789d53e99c31186 - languageName: node - linkType: hard - "ws@npm:8.2.3, ws@npm:~8.2.3": version: 8.2.3 resolution: "ws@npm:8.2.3"