Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/__tests__/api/master/sendMany.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ describe('POST /api/v1/:coin/advancedwallet/:walletId/sendMany', () => {
response.body.should.have.property('txid', 'test-tx-id');
response.body.should.have.property('tx', 'signed-transaction');

// Verify that type defaults to 'transfer' for TSS wallets when not provided
const sendManyArgs = sendManyStub.firstCall.args[0] as Record<string, unknown>;
sendManyArgs.should.have.property('type', 'transfer');

walletGetNock.done();
keychainGetNock.done();
sinon.assert.calledOnce(sendManyStub);
Expand Down
4 changes: 4 additions & 0 deletions src/masterBitgoExpress/handlers/handleSendMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ export async function handleSendMany(req: MasterApiSpecRouteRequest<'v1.wallet.s
if (signingKeychain.source === 'backup') {
throw new BadRequestError('Backup MPC signing not supported for sendMany');
}
// TSS wallets require type to be set; default to 'transfer' if not provided
if (!params.type) {
params.type = 'transfer';
}
const mpcSendParams = await createMPCSendParamsWithCustomSigningFns(
req,
awmClient,
Expand Down
2 changes: 1 addition & 1 deletion src/masterBitgoExpress/routers/sendManyRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const SendManyRequest = {
*/
source: t.union([t.literal('user'), t.literal('backup')]),
/**
* Required for transactions from MPC wallets.
* Required for transactions from MPC wallets. Defaults to 'transfer' for TSS wallets if not provided.
*/
type: t.union([
t.undefined,
Expand Down
Loading