From e8700b2e59ed50204afcbb3051c6bc9e6e3c34f0 Mon Sep 17 00:00:00 2001 From: Lokesh Chandra Date: Wed, 15 Oct 2025 19:44:23 +0530 Subject: [PATCH] refactor(express): changed route path as per openapi Ticket: WP-6367 --- modules/express/src/typedRoutes/api/v1/consolidateUnspents.ts | 2 +- .../src/typedRoutes/api/v1/constructPendingApprovalTx.ts | 2 +- modules/express/src/typedRoutes/api/v1/fanoutUnspents.ts | 2 +- modules/express/src/typedRoutes/api/v2/coinSignTx.ts | 2 +- modules/express/src/typedRoutes/api/v2/lightningInitWallet.ts | 2 +- modules/express/src/typedRoutes/api/v2/walletRecoverToken.ts | 2 +- modules/express/src/typedRoutes/api/v2/walletSignTx.ts | 2 +- modules/express/src/typedRoutes/api/v2/walletTxSignTSS.ts | 2 +- modules/express/test/unit/typedRoutes/coinSignTx.ts | 2 +- modules/express/test/unit/typedRoutes/consolidateUnspents.ts | 2 +- .../express/test/unit/typedRoutes/constructPendingApprovalTx.ts | 2 +- modules/express/test/unit/typedRoutes/fanoutUnspents.ts | 2 +- modules/express/test/unit/typedRoutes/walletRecoverToken.ts | 2 +- modules/express/test/unit/typedRoutes/walletSignTx.ts | 2 +- modules/express/test/unit/typedRoutes/walletTxSignTSS.ts | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/express/src/typedRoutes/api/v1/consolidateUnspents.ts b/modules/express/src/typedRoutes/api/v1/consolidateUnspents.ts index 3f48390030..96525c58ca 100644 --- a/modules/express/src/typedRoutes/api/v1/consolidateUnspents.ts +++ b/modules/express/src/typedRoutes/api/v1/consolidateUnspents.ts @@ -75,7 +75,7 @@ export const ConsolidateUnspentsResponse = t.array( * @operationId express.v1.wallet.consolidateunspents */ export const PutConsolidateUnspents = httpRoute({ - path: '/api/v1/wallet/:id/consolidateunspents', + path: '/api/v1/wallet/{id}/consolidateunspents', method: 'PUT', request: httpRequest({ params: ConsolidateUnspentsRequestParams, diff --git a/modules/express/src/typedRoutes/api/v1/constructPendingApprovalTx.ts b/modules/express/src/typedRoutes/api/v1/constructPendingApprovalTx.ts index 880522147f..bbdbfb8af3 100644 --- a/modules/express/src/typedRoutes/api/v1/constructPendingApprovalTx.ts +++ b/modules/express/src/typedRoutes/api/v1/constructPendingApprovalTx.ts @@ -63,7 +63,7 @@ export const ConstructPendingApprovalTxResponse = t.type({ * @operationId express.v1.pendingapproval.constructTx */ export const PutConstructPendingApprovalTx = httpRoute({ - path: '/api/v1/pendingapprovals/:id/constructTx', + path: '/api/v1/pendingapprovals/{id}/constructTx', method: 'PUT', request: httpRequest({ params: ConstructPendingApprovalTxRequestParams, diff --git a/modules/express/src/typedRoutes/api/v1/fanoutUnspents.ts b/modules/express/src/typedRoutes/api/v1/fanoutUnspents.ts index 576b5e4a89..0c57342280 100644 --- a/modules/express/src/typedRoutes/api/v1/fanoutUnspents.ts +++ b/modules/express/src/typedRoutes/api/v1/fanoutUnspents.ts @@ -63,7 +63,7 @@ export const FanoutUnspentsResponse = t.type({ * @operationId express.v1.wallet.fanoutunspents */ export const PutFanoutUnspents = httpRoute({ - path: '/api/v1/wallet/:id/fanoutunspents', + path: '/api/v1/wallet/{id}/fanoutunspents', method: 'PUT', request: httpRequest({ params: FanoutUnspentsRequestParams, diff --git a/modules/express/src/typedRoutes/api/v2/coinSignTx.ts b/modules/express/src/typedRoutes/api/v2/coinSignTx.ts index 85c2c68c84..fb69678dc5 100644 --- a/modules/express/src/typedRoutes/api/v2/coinSignTx.ts +++ b/modules/express/src/typedRoutes/api/v2/coinSignTx.ts @@ -141,7 +141,7 @@ export const CoinSignTxResponse = { * @operationId express.v2.coin.signtx */ export const PostCoinSignTx = httpRoute({ - path: '/api/v2/:coin/signtx', + path: '/api/v2/{coin}/signtx', method: 'POST', request: httpRequest({ params: CoinSignTxParams, diff --git a/modules/express/src/typedRoutes/api/v2/lightningInitWallet.ts b/modules/express/src/typedRoutes/api/v2/lightningInitWallet.ts index d8ed0a64fb..da67f9a20c 100644 --- a/modules/express/src/typedRoutes/api/v2/lightningInitWallet.ts +++ b/modules/express/src/typedRoutes/api/v2/lightningInitWallet.ts @@ -40,7 +40,7 @@ export const LightningInitWalletResponse = { * @operationId express.lightning.initWallet */ export const PostLightningInitWallet = httpRoute({ - path: '/api/v2/:coin/wallet/:walletId/initwallet', + path: '/api/v2/{coin}/wallet/{walletId}/initwallet', method: 'POST', request: httpRequest({ params: LightningInitWalletParams, body: LightningInitWalletBody }), response: LightningInitWalletResponse, diff --git a/modules/express/src/typedRoutes/api/v2/walletRecoverToken.ts b/modules/express/src/typedRoutes/api/v2/walletRecoverToken.ts index 9525633528..872a6adaa8 100644 --- a/modules/express/src/typedRoutes/api/v2/walletRecoverToken.ts +++ b/modules/express/src/typedRoutes/api/v2/walletRecoverToken.ts @@ -67,7 +67,7 @@ export const RecoverTokenResponse = t.type({ * @operationId express.v2.wallet.recovertoken */ export const PostWalletRecoverToken = httpRoute({ - path: '/api/v2/:coin/wallet/:id/recovertoken', + path: '/api/v2/{coin}/wallet/{id}/recovertoken', method: 'POST', request: httpRequest({ params: RecoverTokenParams, diff --git a/modules/express/src/typedRoutes/api/v2/walletSignTx.ts b/modules/express/src/typedRoutes/api/v2/walletSignTx.ts index d7d9c5553d..6b78b48b4b 100644 --- a/modules/express/src/typedRoutes/api/v2/walletSignTx.ts +++ b/modules/express/src/typedRoutes/api/v2/walletSignTx.ts @@ -159,7 +159,7 @@ export const WalletSignTxResponse = { * @operationId express.v2.wallet.signtx */ export const PostWalletSignTx = httpRoute({ - path: '/api/v2/:coin/wallet/:id/signtx', + path: '/api/v2/{coin}/wallet/{id}/signtx', method: 'POST', request: httpRequest({ params: WalletSignTxParams, diff --git a/modules/express/src/typedRoutes/api/v2/walletTxSignTSS.ts b/modules/express/src/typedRoutes/api/v2/walletTxSignTSS.ts index 5c874ba15b..c66ec29e92 100644 --- a/modules/express/src/typedRoutes/api/v2/walletTxSignTSS.ts +++ b/modules/express/src/typedRoutes/api/v2/walletTxSignTSS.ts @@ -161,7 +161,7 @@ export const WalletTxSignTSSResponse = { * @operationId express.v2.wallet.signtxtss */ export const PostWalletTxSignTSS = httpRoute({ - path: '/api/v2/:coin/wallet/:id/signtxtss', + path: '/api/v2/{coin}/wallet/{id}/signtxtss', method: 'POST', request: httpRequest({ params: WalletTxSignTSSParams, diff --git a/modules/express/test/unit/typedRoutes/coinSignTx.ts b/modules/express/test/unit/typedRoutes/coinSignTx.ts index 6a59928ee2..ce77afa031 100644 --- a/modules/express/test/unit/typedRoutes/coinSignTx.ts +++ b/modules/express/test/unit/typedRoutes/coinSignTx.ts @@ -980,7 +980,7 @@ describe('CoinSignTx codec tests', function () { describe('PostCoinSignTx route definition', function () { it('should have the correct path', function () { - assert.strictEqual(PostCoinSignTx.path, '/api/v2/:coin/signtx'); + assert.strictEqual(PostCoinSignTx.path, '/api/v2/{coin}/signtx'); }); it('should have the correct HTTP method', function () { diff --git a/modules/express/test/unit/typedRoutes/consolidateUnspents.ts b/modules/express/test/unit/typedRoutes/consolidateUnspents.ts index a1e5bbe9c2..186f0753e9 100644 --- a/modules/express/test/unit/typedRoutes/consolidateUnspents.ts +++ b/modules/express/test/unit/typedRoutes/consolidateUnspents.ts @@ -640,7 +640,7 @@ describe('ConsolidateUnspents codec tests', function () { describe('PutConsolidateUnspents route definition', function () { it('should have the correct path', function () { - assert.strictEqual(PutConsolidateUnspents.path, '/api/v1/wallet/:id/consolidateunspents'); + assert.strictEqual(PutConsolidateUnspents.path, '/api/v1/wallet/{id}/consolidateunspents'); }); it('should have the correct HTTP method', function () { diff --git a/modules/express/test/unit/typedRoutes/constructPendingApprovalTx.ts b/modules/express/test/unit/typedRoutes/constructPendingApprovalTx.ts index 21a59dd8d9..26f5b43e54 100644 --- a/modules/express/test/unit/typedRoutes/constructPendingApprovalTx.ts +++ b/modules/express/test/unit/typedRoutes/constructPendingApprovalTx.ts @@ -284,7 +284,7 @@ describe('ConstructPendingApprovalTx codec tests', function () { describe('PutConstructPendingApprovalTx route definition', function () { it('should have the correct path', function () { - assert.strictEqual(PutConstructPendingApprovalTx.path, '/api/v1/pendingapprovals/:id/constructTx'); + assert.strictEqual(PutConstructPendingApprovalTx.path, '/api/v1/pendingapprovals/{id}/constructTx'); }); it('should have the correct HTTP method', function () { diff --git a/modules/express/test/unit/typedRoutes/fanoutUnspents.ts b/modules/express/test/unit/typedRoutes/fanoutUnspents.ts index f1436f312f..4be3452b5b 100644 --- a/modules/express/test/unit/typedRoutes/fanoutUnspents.ts +++ b/modules/express/test/unit/typedRoutes/fanoutUnspents.ts @@ -373,7 +373,7 @@ describe('FanoutUnspents codec tests', function () { describe('PutFanoutUnspents route definition', function () { it('should have the correct path', function () { - assert.strictEqual(PutFanoutUnspents.path, '/api/v1/wallet/:id/fanoutunspents'); + assert.strictEqual(PutFanoutUnspents.path, '/api/v1/wallet/{id}/fanoutunspents'); }); it('should have the correct HTTP method', function () { diff --git a/modules/express/test/unit/typedRoutes/walletRecoverToken.ts b/modules/express/test/unit/typedRoutes/walletRecoverToken.ts index 30de0a0ab9..8bd41ba07f 100644 --- a/modules/express/test/unit/typedRoutes/walletRecoverToken.ts +++ b/modules/express/test/unit/typedRoutes/walletRecoverToken.ts @@ -563,7 +563,7 @@ describe('WalletRecoverToken codec tests', function () { describe('PostWalletRecoverToken route definition', function () { it('should have the correct path', function () { - assert.strictEqual(PostWalletRecoverToken.path, '/api/v2/:coin/wallet/:id/recovertoken'); + assert.strictEqual(PostWalletRecoverToken.path, '/api/v2/{coin}/wallet/{id}/recovertoken'); }); it('should have the correct HTTP method', function () { diff --git a/modules/express/test/unit/typedRoutes/walletSignTx.ts b/modules/express/test/unit/typedRoutes/walletSignTx.ts index cf29792e6d..f648563e1b 100644 --- a/modules/express/test/unit/typedRoutes/walletSignTx.ts +++ b/modules/express/test/unit/typedRoutes/walletSignTx.ts @@ -664,7 +664,7 @@ describe('WalletSignTx codec tests', function () { describe('PostWalletSignTx route definition', function () { it('should have the correct path', function () { - assert.strictEqual(PostWalletSignTx.path, '/api/v2/:coin/wallet/:id/signtx'); + assert.strictEqual(PostWalletSignTx.path, '/api/v2/{coin}/wallet/{id}/signtx'); }); it('should have the correct HTTP method', function () { diff --git a/modules/express/test/unit/typedRoutes/walletTxSignTSS.ts b/modules/express/test/unit/typedRoutes/walletTxSignTSS.ts index de3943c821..5b74455270 100644 --- a/modules/express/test/unit/typedRoutes/walletTxSignTSS.ts +++ b/modules/express/test/unit/typedRoutes/walletTxSignTSS.ts @@ -1451,7 +1451,7 @@ describe('WalletTxSignTSS codec tests', function () { describe('PostWalletTxSignTSS route definition', function () { it('should have the correct path', function () { - assert.strictEqual(PostWalletTxSignTSS.path, '/api/v2/:coin/wallet/:id/signtxtss'); + assert.strictEqual(PostWalletTxSignTSS.path, '/api/v2/{coin}/wallet/{id}/signtxtss'); }); it('should have the correct HTTP method', function () {