Skip to content

Commit 39e807a

Browse files
feat(mbe): fix comments
1 parent 3f67e16 commit 39e807a

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/api/master/handlers/handleConsolidate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RequestTracer, KeyIndices } from '@bitgo/sdk-core';
1+
import { RequestTracer, KeyIndices, CustomSigningFunction } from '@bitgo/sdk-core';
22
import logger from '../../../logger';
33
import { MasterApiSpecRouteRequest } from '../routers/masterApiSpec';
44

@@ -43,7 +43,7 @@ export async function handleConsolidate(
4343

4444
try {
4545
// Create custom signing function that delegates to EBE
46-
const customSigningFunction = async (signParams: any) => {
46+
const customSigningFunction: CustomSigningFunction = async (signParams) => {
4747
const signedTx = await enclavedExpressClient.signMultisig({
4848
txPrebuild: signParams.txPrebuild,
4949
source: params.source,

src/api/master/handlers/handleConsolidateUnspents.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RequestTracer, KeyIndices } from '@bitgo/sdk-core';
1+
import { RequestTracer, KeyIndices, CustomSigningFunction } from '@bitgo/sdk-core';
22
import logger from '../../../logger';
33
import { MasterApiSpecRouteRequest } from '../routers/masterApiSpec';
44

@@ -8,9 +8,9 @@ export async function handleConsolidateUnspents(
88
const enclavedExpressClient = req.enclavedExpressClient;
99
const reqId = new RequestTracer();
1010
const bitgo = req.bitgo;
11-
const baseCoin = bitgo.coin((req as any).params.coin);
12-
const params = (req as any).decoded;
13-
const walletId = (req as any).params.walletId;
11+
const baseCoin = bitgo.coin(req.params.coin);
12+
const params = req.decoded;
13+
const walletId = req.params.walletId;
1414
const wallet = await baseCoin.wallets().get({ id: walletId, reqId });
1515

1616
if (!wallet) {
@@ -33,7 +33,7 @@ export async function handleConsolidateUnspents(
3333

3434
try {
3535
// Create custom signing function that delegates to EBE
36-
const customSigningFunction = async (signParams: any) => {
36+
const customSigningFunction: CustomSigningFunction = async (signParams) => {
3737
const signedTx = await enclavedExpressClient.signMultisig({
3838
txPrebuild: signParams.txPrebuild,
3939
source: params.source,

src/api/master/routers/masterApiSpec.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ export const ConsolidateRequest = {
9999

100100
// Response type for /consolidate endpoint
101101
const ConsolidateResponse: HttpResponse = {
102-
// TODO: Get type from public types repo / Wallet Platform
103102
200: t.any,
104-
202: t.any, // Partial success
105103
400: t.any, // All failed
106104
500: t.type({
107105
error: t.string,
@@ -141,9 +139,8 @@ export const ConsolidateUnspentsRequest = {
141139
pubkey: t.string,
142140
source: t.union([t.literal('user'), t.literal('backup')]),
143141
walletPassphrase: t.union([t.undefined, t.string]),
144-
xprv: t.union([t.undefined, t.string]),
145-
feeRate: t.union([t.undefined, t.union([t.string, t.number])]),
146-
maxFeeRate: t.union([t.undefined, t.union([t.string, t.number])]),
142+
feeRate: t.union([t.undefined, t.number]),
143+
maxFeeRate: t.union([t.undefined, t.number]),
147144
maxFeePercentage: t.union([t.undefined, t.number]),
148145
feeTxConfirmTarget: t.union([t.undefined, t.number]),
149146
bulk: t.union([t.undefined, t.boolean]),
@@ -159,8 +156,10 @@ export const ConsolidateUnspentsRequest = {
159156
};
160157

161158
const ConsolidateUnspentsResponse: HttpResponse = {
162-
200: t.any,
163-
202: t.any,
159+
200: t.type({
160+
tx: t.string,
161+
txid: t.string,
162+
}),
164163
400: t.any,
165164
500: t.type({
166165
error: t.string,

0 commit comments

Comments
 (0)