From 53fe28bf2f6e193174d72a3bafc0544eead9ea5c Mon Sep 17 00:00:00 2001 From: Lokesh Chandra Date: Fri, 10 Oct 2025 11:13:11 +0530 Subject: [PATCH] feat(express): added type from public types Ticket: WP-5423 --- modules/express/src/clientRoutes.ts | 4 ++-- modules/express/src/typedRoutes/api/v2/walletSignTx.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/express/src/clientRoutes.ts b/modules/express/src/clientRoutes.ts index c50e6e133d..9dd865861f 100755 --- a/modules/express/src/clientRoutes.ts +++ b/modules/express/src/clientRoutes.ts @@ -710,8 +710,8 @@ async function handleV2AcceptWalletShare(req: express.Request) { */ async function handleV2SignTxWallet(req: ExpressApiRouteRequest<'express.v2.wallet.signtx', 'post'>) { const bitgo = req.bitgo; - const coin = bitgo.coin(req.params.coin); - const wallet = await coin.wallets().get({ id: req.params.id }); + const coin = bitgo.coin(req.decoded.coin); + const wallet = await coin.wallets().get({ id: req.decoded.id }); try { return await wallet.signTransaction(createSendParams(req)); } catch (error) { diff --git a/modules/express/src/typedRoutes/api/v2/walletSignTx.ts b/modules/express/src/typedRoutes/api/v2/walletSignTx.ts index 5cae7e1233..c378f7970b 100644 --- a/modules/express/src/typedRoutes/api/v2/walletSignTx.ts +++ b/modules/express/src/typedRoutes/api/v2/walletSignTx.ts @@ -1,6 +1,6 @@ import * as t from 'io-ts'; import { httpRoute, httpRequest, optional } from '@api-ts/io-ts-http'; -import { TransactionRequest as TxRequestResponse } from '@bitgo/public-types'; +import { TransactionRequest as TxRequestResponse, TransactionRequestApiVersion } from '@bitgo/public-types'; import { BitgoExpressError } from '../../schemas/error'; /** @@ -58,7 +58,7 @@ export const WalletSignTxBody = { /** Wallet passphrase for TSS wallets */ walletPassphrase: optional(t.string), /** API version: 'lite' or 'full' */ - apiVersion: optional(t.union([t.literal('lite'), t.literal('full')])), + apiVersion: optional(TransactionRequestApiVersion), /** Multisig type version */ multisigTypeVersion: optional(t.literal('MPCv2')), /** Gas limit for ETH transactions */