-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(xcm-api): Rename some node query endpoints 🔧
- Loading branch information
1 parent
6d02218
commit 00a1654
Showing
11 changed files
with
158 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,44 @@ | ||
import { Controller, Get, Param, Req, Request } from '@nestjs/common'; | ||
import { Controller, Get, Param, Query, Req, Request } from '@nestjs/common'; | ||
import { NodeConfigsService } from './node-configs.service.js'; | ||
import { AnalyticsService } from '../analytics/analytics.service.js'; | ||
import { EventName } from '../analytics/EventName.js'; | ||
|
||
@Controller() | ||
@Controller('nodes') | ||
export class NodeConfigsController { | ||
constructor( | ||
private service: NodeConfigsService, | ||
private analyticsService: AnalyticsService, | ||
) {} | ||
|
||
@Get('nodes') | ||
@Get() | ||
getNodeNames(@Req() req: Request) { | ||
this.analyticsService.track(EventName.GET_NODE_NAMES, req); | ||
return this.service.getNodeNames(); | ||
} | ||
|
||
@Get('ws-endpoints/:node') | ||
@Get(':node/ws-endpoints') | ||
getWsEndpoints(@Param('node') node: string, @Req() req: Request) { | ||
this.analyticsService.track(EventName.GET_NODE_NAMES, req); | ||
return this.service.getWsEndpoints(node); | ||
} | ||
|
||
@Get(':node/para-id') | ||
getParaId(@Param('node') node: string, @Req() req: Request) { | ||
this.analyticsService.track(EventName.GET_PARA_ID, req, { | ||
node, | ||
}); | ||
return this.service.getParaId(node); | ||
} | ||
|
||
@Get(':paraId') | ||
getAssetsObject( | ||
@Param('paraId') paraId: string, | ||
@Query('ecosystem') ecosystem: string | undefined, | ||
@Req() req: Request, | ||
) { | ||
this.analyticsService.track(EventName.GET_NODE_BY_PARA_ID, req, { | ||
paraId, | ||
}); | ||
return this.service.getNodeByParaId(Number(paraId), ecosystem); | ||
} | ||
} |
Oops, something went wrong.