From a904c683a7591ab5ed0f9929b62d97186653f07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Vitor=20de=20Lima=20Matos?= Date: Wed, 15 Jul 2020 18:44:40 -0300 Subject: [PATCH] cli: implement /contracts interface (spec-undocumented) --- raiden-cli/src/routes/api.v1.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/raiden-cli/src/routes/api.v1.ts b/raiden-cli/src/routes/api.v1.ts index 5235d9c355..ab82a74052 100644 --- a/raiden-cli/src/routes/api.v1.ts +++ b/raiden-cli/src/routes/api.v1.ts @@ -19,15 +19,24 @@ export function makeApiV1Router(this: Cli): Router { router.use('/testing', makeTestingRouter.call(this)); router.get('/version', (_request: Request, response: Response) => { + response.json({ version: Raiden.version }); + }); + + router.get('/contracts', (_request: Request, response: Response) => { + const contracts = this.raiden.contractsInfo; response.json({ - version: Raiden.version, + contracts_version: Raiden.contractVersion, + token_network_registry_address: contracts.TokenNetworkRegistry.address, + secret_registry_address: contracts.SecretRegistry.address, + service_registry_address: contracts.ServiceRegistry.address, + user_deposit_address: contracts.UserDeposit.address, + monitoring_service_address: contracts.MonitoringService.address, + one_to_n_address: '', }); }); router.get('/address', (_request: Request, response: Response) => { - response.json({ - our_address: this.raiden.address, - }); + response.json({ our_address: this.raiden.address }); }); router.get('/status', (_request: Request, response: Response) => {