From 6cb41d32e79e8e198becfc8829c8945255e79bb6 Mon Sep 17 00:00:00 2001 From: JCNoguera Date: Fri, 19 Jan 2024 16:52:30 +0100 Subject: [PATCH] chore: rename `stardustTangleHelper` to `stardustApiService` --- api/src/initServices.ts | 6 +++--- api/src/routes/stardust/address/balance/get.ts | 6 +++--- api/src/routes/stardust/address/outputs/alias/get.ts | 6 +++--- api/src/routes/stardust/address/outputs/basic/get.ts | 6 +++--- api/src/routes/stardust/address/outputs/nft/get.ts | 6 +++--- api/src/routes/stardust/alias/foundries/get.ts | 6 +++--- api/src/routes/stardust/alias/get.ts | 6 +++--- api/src/routes/stardust/block/get.ts | 6 +++--- api/src/routes/stardust/block/metadata/get.ts | 6 +++--- api/src/routes/stardust/foundry/get.ts | 6 +++--- api/src/routes/stardust/milestone/get.ts | 6 +++--- api/src/routes/stardust/nft/get.ts | 6 +++--- api/src/routes/stardust/output/get.ts | 6 +++--- api/src/routes/stardust/output/tagged/get.ts | 8 ++++---- api/src/routes/stardust/participation/events/get.ts | 6 +++--- api/src/routes/stardust/search.ts | 6 +++--- api/src/routes/stardust/transaction/get.ts | 6 +++--- .../stardust/stardustApiService.ts} | 12 ++++++------ api/src/utils/stardust/searchExecutor.ts | 6 +++--- 19 files changed, 61 insertions(+), 61 deletions(-) rename api/src/{utils/stardust/stardustTangleHelper.ts => services/stardust/stardustApiService.ts} (97%) diff --git a/api/src/initServices.ts b/api/src/initServices.ts index f78c07bc8..921371b39 100644 --- a/api/src/initServices.ts +++ b/api/src/initServices.ts @@ -24,8 +24,8 @@ import { ChronicleService } from "./services/stardust/chronicleService"; import { StardustFeed } from "./services/stardust/feed/stardustFeed"; import { InfluxDBService } from "./services/stardust/influx/influxDbService"; import { NodeInfoService } from "./services/stardust/nodeInfoService"; +import { StardustApiService } from "./services/stardust/stardustApiService"; import { StardustStatsService } from "./services/stardust/stats/stardustStatsService"; -import { StardustTangleHelper } from "./utils/stardust/stardustTangleHelper"; const CURRENCY_UPDATE_INTERVAL_MS = 5 * 60000; @@ -158,8 +158,8 @@ function initStardustServices(networkConfig: INetwork): void { const stardustClient = new StardustClient(stardustClientParams); ServiceFactory.register(`client-${networkConfig.network}`, () => stardustClient); - const tangleHelper = new StardustTangleHelper(networkConfig); - ServiceFactory.register(`tangle-helper-${networkConfig.network}`, () => tangleHelper); + const stardustApiService = new StardustApiService(networkConfig); + ServiceFactory.register(`api-service-${networkConfig.network}`, () => stardustApiService); // eslint-disable-next-line no-void void NodeInfoService.build(networkConfig).then((nodeInfoService) => { diff --git a/api/src/routes/stardust/address/balance/get.ts b/api/src/routes/stardust/address/balance/get.ts index 67eccf23b..74110051e 100644 --- a/api/src/routes/stardust/address/balance/get.ts +++ b/api/src/routes/stardust/address/balance/get.ts @@ -4,7 +4,7 @@ import IAddressDetailsWithBalance from "../../../../models/api/stardust/IAddress import { IConfiguration } from "../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../services/networkService"; -import { StardustTangleHelper } from "../../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../../utils/validationHelper"; /** @@ -24,6 +24,6 @@ export async function get(config: IConfiguration, request: IAddressBalanceReques return undefined; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.addressDetails(request.address); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.addressDetails(request.address); } diff --git a/api/src/routes/stardust/address/outputs/alias/get.ts b/api/src/routes/stardust/address/outputs/alias/get.ts index f08664df0..aeb9aa652 100644 --- a/api/src/routes/stardust/address/outputs/alias/get.ts +++ b/api/src/routes/stardust/address/outputs/alias/get.ts @@ -4,7 +4,7 @@ import { IAddressDetailsResponse } from "../../../../../models/api/stardust/IAdd import { IConfiguration } from "../../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../../services/networkService"; -import { StardustTangleHelper } from "../../../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../../../utils/validationHelper"; /** @@ -24,6 +24,6 @@ export async function get(config: IConfiguration, request: IAddressDetailsReques return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.aliasOutputDetailsByAddress(request.address); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.aliasOutputDetailsByAddress(request.address); } diff --git a/api/src/routes/stardust/address/outputs/basic/get.ts b/api/src/routes/stardust/address/outputs/basic/get.ts index 94fdc6365..69565d796 100644 --- a/api/src/routes/stardust/address/outputs/basic/get.ts +++ b/api/src/routes/stardust/address/outputs/basic/get.ts @@ -4,7 +4,7 @@ import { IAddressDetailsResponse } from "../../../../../models/api/stardust/IAdd import { IConfiguration } from "../../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../../services/networkService"; -import { StardustTangleHelper } from "../../../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../../../utils/validationHelper"; /** @@ -24,6 +24,6 @@ export async function get(config: IConfiguration, request: IAddressDetailsReques return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.basicOutputDetailsByAddress(request.address); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.basicOutputDetailsByAddress(request.address); } diff --git a/api/src/routes/stardust/address/outputs/nft/get.ts b/api/src/routes/stardust/address/outputs/nft/get.ts index 61c6fb080..f738f656d 100644 --- a/api/src/routes/stardust/address/outputs/nft/get.ts +++ b/api/src/routes/stardust/address/outputs/nft/get.ts @@ -4,7 +4,7 @@ import { IAddressDetailsResponse } from "../../../../../models/api/stardust/IAdd import { IConfiguration } from "../../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../../services/networkService"; -import { StardustTangleHelper } from "../../../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../../../utils/validationHelper"; /** @@ -24,6 +24,6 @@ export async function get(config: IConfiguration, request: IAddressDetailsReques return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.nftOutputDetailsByAddress(request.address); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.nftOutputDetailsByAddress(request.address); } diff --git a/api/src/routes/stardust/alias/foundries/get.ts b/api/src/routes/stardust/alias/foundries/get.ts index 6af77f208..3417d25d0 100644 --- a/api/src/routes/stardust/alias/foundries/get.ts +++ b/api/src/routes/stardust/alias/foundries/get.ts @@ -4,7 +4,7 @@ import { IFoundriesResponse } from "../../../../models/api/stardust/foundry/IFou import { IConfiguration } from "../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../services/networkService"; -import { StardustTangleHelper } from "../../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(config: IConfiguration, request: IFoundriesRequest): P return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.aliasFoundries(request.aliasAddress); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.aliasFoundries(request.aliasAddress); } diff --git a/api/src/routes/stardust/alias/get.ts b/api/src/routes/stardust/alias/get.ts index 66ef60890..f2ab84a87 100644 --- a/api/src/routes/stardust/alias/get.ts +++ b/api/src/routes/stardust/alias/get.ts @@ -4,7 +4,7 @@ import { IAliasResponse } from "../../../models/api/stardust/IAliasResponse"; import { IConfiguration } from "../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../models/db/protocolVersion"; import { NetworkService } from "../../../services/networkService"; -import { StardustTangleHelper } from "../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(config: IConfiguration, request: IAliasRequest): Promi return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.aliasDetails(request.aliasId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.aliasDetails(request.aliasId); } diff --git a/api/src/routes/stardust/block/get.ts b/api/src/routes/stardust/block/get.ts index 07cafcd21..d5b912976 100644 --- a/api/src/routes/stardust/block/get.ts +++ b/api/src/routes/stardust/block/get.ts @@ -4,7 +4,7 @@ import { IBlockResponse } from "../../../models/api/stardust/IBlockResponse"; import { IConfiguration } from "../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../models/db/protocolVersion"; import { NetworkService } from "../../../services/networkService"; -import { StardustTangleHelper } from "../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(_: IConfiguration, request: IBlockRequest): Promise(`tangle-helper-${networkConfig.network}`); - return tangleHelper.block(request.blockId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.block(request.blockId); } diff --git a/api/src/routes/stardust/block/metadata/get.ts b/api/src/routes/stardust/block/metadata/get.ts index fd0fbc9aa..6efb937e6 100644 --- a/api/src/routes/stardust/block/metadata/get.ts +++ b/api/src/routes/stardust/block/metadata/get.ts @@ -4,7 +4,7 @@ import { IBlockRequest } from "../../../../models/api/stardust/IBlockRequest"; import { IConfiguration } from "../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../services/networkService"; -import { StardustTangleHelper } from "../../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(_: IConfiguration, request: IBlockRequest): Promise(`tangle-helper-${networkConfig.network}`); - return tangleHelper.blockDetails(request.blockId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.blockDetails(request.blockId); } diff --git a/api/src/routes/stardust/foundry/get.ts b/api/src/routes/stardust/foundry/get.ts index 92282fccf..e5233dd83 100644 --- a/api/src/routes/stardust/foundry/get.ts +++ b/api/src/routes/stardust/foundry/get.ts @@ -4,7 +4,7 @@ import { IFoundryResponse } from "../../../models/api/stardust/foundry/IFoundryR import { IConfiguration } from "../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../models/db/protocolVersion"; import { NetworkService } from "../../../services/networkService"; -import { StardustTangleHelper } from "../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(config: IConfiguration, request: IFoundryRequest): Pro return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.foundryDetails(request.foundryId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.foundryDetails(request.foundryId); } diff --git a/api/src/routes/stardust/milestone/get.ts b/api/src/routes/stardust/milestone/get.ts index 0e4684838..9d3c52992 100644 --- a/api/src/routes/stardust/milestone/get.ts +++ b/api/src/routes/stardust/milestone/get.ts @@ -4,7 +4,7 @@ import { IMilestoneDetailsResponse } from "../../../models/api/stardust/mileston import { IConfiguration } from "../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../models/db/protocolVersion"; import { NetworkService } from "../../../services/networkService"; -import { StardustTangleHelper } from "../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../utils/validationHelper"; /** @@ -25,8 +25,8 @@ export async function get(config: IConfiguration, request: IMilestoneDetailsRequ return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - const milestoneDetails = await tangleHelper.milestoneDetailsByIndex(Number(request.milestoneIndex)); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + const milestoneDetails = await stardustApiService.milestoneDetailsByIndex(Number(request.milestoneIndex)); return milestoneDetails; } diff --git a/api/src/routes/stardust/nft/get.ts b/api/src/routes/stardust/nft/get.ts index 1b5eb7d01..88b04bc3a 100644 --- a/api/src/routes/stardust/nft/get.ts +++ b/api/src/routes/stardust/nft/get.ts @@ -4,7 +4,7 @@ import { INftDetailsResponse } from "../../../models/api/stardust/nft/INftDetail import { IConfiguration } from "../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../models/db/protocolVersion"; import { NetworkService } from "../../../services/networkService"; -import { StardustTangleHelper } from "../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(config: IConfiguration, request: INftDetailsRequest): return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.nftDetails(request.nftId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.nftDetails(request.nftId); } diff --git a/api/src/routes/stardust/output/get.ts b/api/src/routes/stardust/output/get.ts index e8dc18b68..413d87c20 100644 --- a/api/src/routes/stardust/output/get.ts +++ b/api/src/routes/stardust/output/get.ts @@ -4,7 +4,7 @@ import { IOutputDetailsResponse } from "../../../models/api/stardust/IOutputDeta import { IConfiguration } from "../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../models/db/protocolVersion"; import { NetworkService } from "../../../services/networkService"; -import { StardustTangleHelper } from "../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(config: IConfiguration, request: IOutputDetailsRequest return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.outputDetails(request.outputId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.outputDetails(request.outputId); } diff --git a/api/src/routes/stardust/output/tagged/get.ts b/api/src/routes/stardust/output/tagged/get.ts index f602daa4b..cf96cc4f3 100644 --- a/api/src/routes/stardust/output/tagged/get.ts +++ b/api/src/routes/stardust/output/tagged/get.ts @@ -5,8 +5,8 @@ import { INftOutputsResponse } from "../../../../models/api/stardust/nft/INftOut import { IConfiguration } from "../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../services/networkService"; +import { StardustApiService } from "../../../../services/stardust/stardustApiService"; import { Converter } from "../../../../utils/convertUtils"; -import { StardustTangleHelper } from "../../../../utils/stardust/stardustTangleHelper"; import { ValidationHelper } from "../../../../utils/validationHelper"; /** @@ -29,12 +29,12 @@ export async function get(_: IConfiguration, request: ITaggedOutputsRequest): Pr } const tagHex = Converter.utf8ToHex(request.tag, true); - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); if (request.outputType === "basic") { - return tangleHelper.taggedBasicOutputs(tagHex, 10, request.cursor); + return stardustApiService.taggedBasicOutputs(tagHex, 10, request.cursor); } else if (request.outputType === "nft") { - return tangleHelper.taggedNftOutputs(tagHex, 10, request.cursor); + return stardustApiService.taggedNftOutputs(tagHex, 10, request.cursor); } return { error: "Unsupported output type" }; diff --git a/api/src/routes/stardust/participation/events/get.ts b/api/src/routes/stardust/participation/events/get.ts index 40c0d2d8b..8de22a1bb 100644 --- a/api/src/routes/stardust/participation/events/get.ts +++ b/api/src/routes/stardust/participation/events/get.ts @@ -4,7 +4,7 @@ import { IParticipationEventResponse } from "../../../../models/api/stardust/par import { IConfiguration } from "../../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../../models/db/protocolVersion"; import { NetworkService } from "../../../../services/networkService"; -import { StardustTangleHelper } from "../../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../../utils/validationHelper"; /** @@ -24,6 +24,6 @@ export async function get(config: IConfiguration, request: IParticipationEventRe return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.participationEventDetails(request.eventId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.participationEventDetails(request.eventId); } diff --git a/api/src/routes/stardust/search.ts b/api/src/routes/stardust/search.ts index 843bf11aa..e19a88113 100644 --- a/api/src/routes/stardust/search.ts +++ b/api/src/routes/stardust/search.ts @@ -4,7 +4,7 @@ import { ISearchResponse } from "../../models/api/stardust/ISearchResponse"; import { IConfiguration } from "../../models/configuration/IConfiguration"; import { STARDUST } from "../../models/db/protocolVersion"; import { NetworkService } from "../../services/networkService"; -import { StardustTangleHelper } from "../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function search(_: IConfiguration, request: ISearchRequest): Promis return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.search(request.query); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.search(request.query); } diff --git a/api/src/routes/stardust/transaction/get.ts b/api/src/routes/stardust/transaction/get.ts index 42f2b6c41..a559badeb 100644 --- a/api/src/routes/stardust/transaction/get.ts +++ b/api/src/routes/stardust/transaction/get.ts @@ -4,7 +4,7 @@ import { ITransactionDetailsResponse } from "../../../models/api/stardust/ITrans import { IConfiguration } from "../../../models/configuration/IConfiguration"; import { STARDUST } from "../../../models/db/protocolVersion"; import { NetworkService } from "../../../services/networkService"; -import { StardustTangleHelper } from "../../../utils/stardust/stardustTangleHelper"; +import { StardustApiService } from "../../../services/stardust/stardustApiService"; import { ValidationHelper } from "../../../utils/validationHelper"; /** @@ -25,6 +25,6 @@ export async function get(config: IConfiguration, request: ITransactionDetailsRe return {}; } - const tangleHelper = ServiceFactory.get(`tangle-helper-${networkConfig.network}`); - return tangleHelper.transactionIncludedBlock(request.transactionId); + const stardustApiService = ServiceFactory.get(`api-service-${networkConfig.network}`); + return stardustApiService.transactionIncludedBlock(request.transactionId); } diff --git a/api/src/utils/stardust/stardustTangleHelper.ts b/api/src/services/stardust/stardustApiService.ts similarity index 97% rename from api/src/utils/stardust/stardustTangleHelper.ts rename to api/src/services/stardust/stardustApiService.ts index 3ad739b9e..0295e98b0 100644 --- a/api/src/utils/stardust/stardustTangleHelper.ts +++ b/api/src/services/stardust/stardustApiService.ts @@ -1,8 +1,6 @@ /* eslint-disable no-warning-comments */ import { OutputResponse, Client, IOutputsResponse, HexEncodedString, Utils, NftQueryParameter } from "@iota/sdk"; -import { SearchExecutor } from "./searchExecutor"; -import { SearchQueryBuilder, SearchQuery } from "./searchQueryBuilder"; -import { addressBalance, blockIdFromMilestonePayload } from "./utils"; +import { NodeInfoService } from "./nodeInfoService"; import { ServiceFactory } from "../../factories/serviceFactory"; import logger from "../../logger"; import { IBasicOutputsResponse } from "../../models/api/stardust/basic/IBasicOutputsResponse"; @@ -24,13 +22,15 @@ import { IParticipationEventInfo } from "../../models/api/stardust/participation import { IParticipationEventResponse } from "../../models/api/stardust/participation/IParticipationEventResponse"; import { IParticipationEventStatus } from "../../models/api/stardust/participation/IParticipationEventStatus"; import { INetwork } from "../../models/db/INetwork"; -import { NodeInfoService } from "../../services/stardust/nodeInfoService"; -import { HexHelper } from "../hexHelper"; +import { HexHelper } from "../../utils/hexHelper"; +import { SearchExecutor } from "../../utils/stardust/searchExecutor"; +import { SearchQuery, SearchQueryBuilder } from "../../utils/stardust/searchQueryBuilder"; +import { addressBalance, blockIdFromMilestonePayload } from "../../utils/stardust/utils"; /** * Helper functions for use with tangle. */ -export class StardustTangleHelper { +export class StardustApiService { /** * The network in context. */ diff --git a/api/src/utils/stardust/searchExecutor.ts b/api/src/utils/stardust/searchExecutor.ts index f2c7ac136..b7765f617 100644 --- a/api/src/utils/stardust/searchExecutor.ts +++ b/api/src/utils/stardust/searchExecutor.ts @@ -1,8 +1,8 @@ import { SearchQuery } from "./searchQueryBuilder"; -import { StardustTangleHelper } from "./stardustTangleHelper"; import { ServiceFactory } from "../../factories/serviceFactory"; import { ISearchResponse } from "../../models/api/stardust/ISearchResponse"; import { INetwork } from "../../models/db/INetwork"; +import { StardustApiService } from "../../services/stardust/stardustApiService"; /** * Performs the search from a SearchQuery object on a Stardust network. @@ -13,11 +13,11 @@ export class SearchExecutor { */ private readonly query: SearchQuery; - private readonly tangleHelper: StardustTangleHelper; + private readonly tangleHelper: StardustApiService; constructor(network: INetwork, query: SearchQuery) { this.query = query; - this.tangleHelper = ServiceFactory.get(`tangle-helper-${network.network}`); + this.tangleHelper = ServiceFactory.get(`api-service-${network.network}`); } public async run(): Promise {