Skip to content

Commit 12456cf

Browse files
authored
Merge pull request #7204 from BitGo/WP-5423-refactor-wallet-signtx
feat(express): added type from public types
2 parents 1086c31 + 53fe28b commit 12456cf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/express/src/clientRoutes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,8 @@ async function handleV2AcceptWalletShare(req: express.Request) {
710710
*/
711711
async function handleV2SignTxWallet(req: ExpressApiRouteRequest<'express.v2.wallet.signtx', 'post'>) {
712712
const bitgo = req.bitgo;
713-
const coin = bitgo.coin(req.params.coin);
714-
const wallet = await coin.wallets().get({ id: req.params.id });
713+
const coin = bitgo.coin(req.decoded.coin);
714+
const wallet = await coin.wallets().get({ id: req.decoded.id });
715715
try {
716716
return await wallet.signTransaction(createSendParams(req));
717717
} catch (error) {

modules/express/src/typedRoutes/api/v2/walletSignTx.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as t from 'io-ts';
22
import { httpRoute, httpRequest, optional } from '@api-ts/io-ts-http';
3-
import { TransactionRequest as TxRequestResponse } from '@bitgo/public-types';
3+
import { TransactionRequest as TxRequestResponse, TransactionRequestApiVersion } from '@bitgo/public-types';
44
import { BitgoExpressError } from '../../schemas/error';
55

66
/**
@@ -58,7 +58,7 @@ export const WalletSignTxBody = {
5858
/** Wallet passphrase for TSS wallets */
5959
walletPassphrase: optional(t.string),
6060
/** API version: 'lite' or 'full' */
61-
apiVersion: optional(t.union([t.literal('lite'), t.literal('full')])),
61+
apiVersion: optional(TransactionRequestApiVersion),
6262
/** Multisig type version */
6363
multisigTypeVersion: optional(t.literal('MPCv2')),
6464
/** Gas limit for ETH transactions */

0 commit comments

Comments
 (0)