Skip to content

Commit 299d380

Browse files
feat(mbe): fix comments
1 parent 1c75ea2 commit 299d380

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

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
@@ -112,9 +112,7 @@ export const ConsolidateRequest = {
112112

113113
// Response type for /consolidate endpoint
114114
const ConsolidateResponse: HttpResponse = {
115-
// TODO: Get type from public types repo / Wallet Platform
116115
200: t.any,
117-
202: t.any, // Partial success
118116
400: t.any, // All failed
119117
500: t.type({
120118
error: t.string,
@@ -154,9 +152,8 @@ export const ConsolidateUnspentsRequest = {
154152
pubkey: t.string,
155153
source: t.union([t.literal('user'), t.literal('backup')]),
156154
walletPassphrase: t.union([t.undefined, t.string]),
157-
xprv: t.union([t.undefined, t.string]),
158-
feeRate: t.union([t.undefined, t.union([t.string, t.number])]),
159-
maxFeeRate: t.union([t.undefined, t.union([t.string, t.number])]),
155+
feeRate: t.union([t.undefined, t.number]),
156+
maxFeeRate: t.union([t.undefined, t.number]),
160157
maxFeePercentage: t.union([t.undefined, t.number]),
161158
feeTxConfirmTarget: t.union([t.undefined, t.number]),
162159
bulk: t.union([t.undefined, t.boolean]),
@@ -172,8 +169,10 @@ export const ConsolidateUnspentsRequest = {
172169
};
173170

174171
const ConsolidateUnspentsResponse: HttpResponse = {
175-
200: t.any,
176-
202: t.any,
172+
200: t.type({
173+
tx: t.string,
174+
txid: t.string,
175+
}),
177176
400: t.any,
178177
500: t.type({
179178
error: t.string,

0 commit comments

Comments
 (0)