Skip to content

Commit b328e3e

Browse files
feat(mbe): fix comments
1 parent 2032f20 commit b328e3e

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

114114
// Response type for /consolidate endpoint
115115
const ConsolidateResponse: HttpResponse = {
116-
// TODO: Get type from public types repo / Wallet Platform
117116
200: t.any,
118-
202: t.any, // Partial success
119117
400: t.any, // All failed
120118
500: t.type({
121119
error: t.string,
@@ -168,9 +166,8 @@ export const ConsolidateUnspentsRequest = {
168166
pubkey: t.string,
169167
source: t.union([t.literal('user'), t.literal('backup')]),
170168
walletPassphrase: t.union([t.undefined, t.string]),
171-
xprv: t.union([t.undefined, t.string]),
172-
feeRate: t.union([t.undefined, t.union([t.string, t.number])]),
173-
maxFeeRate: t.union([t.undefined, t.union([t.string, t.number])]),
169+
feeRate: t.union([t.undefined, t.number]),
170+
maxFeeRate: t.union([t.undefined, t.number]),
174171
maxFeePercentage: t.union([t.undefined, t.number]),
175172
feeTxConfirmTarget: t.union([t.undefined, t.number]),
176173
bulk: t.union([t.undefined, t.boolean]),
@@ -186,8 +183,10 @@ export const ConsolidateUnspentsRequest = {
186183
};
187184

188185
const ConsolidateUnspentsResponse: HttpResponse = {
189-
200: t.any,
190-
202: t.any,
186+
200: t.type({
187+
tx: t.string,
188+
txid: t.string,
189+
}),
191190
400: t.any,
192191
500: t.type({
193192
error: t.string,

0 commit comments

Comments
 (0)