diff --git a/src/__tests__/api/master/sendMany.test.ts b/src/__tests__/api/master/sendMany.test.ts index 0218baf..d599fa3 100644 --- a/src/__tests__/api/master/sendMany.test.ts +++ b/src/__tests__/api/master/sendMany.test.ts @@ -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; + sendManyArgs.should.have.property('type', 'transfer'); + walletGetNock.done(); keychainGetNock.done(); sinon.assert.calledOnce(sendManyStub); diff --git a/src/masterBitgoExpress/handlers/handleSendMany.ts b/src/masterBitgoExpress/handlers/handleSendMany.ts index e5fdaa5..9253bea 100644 --- a/src/masterBitgoExpress/handlers/handleSendMany.ts +++ b/src/masterBitgoExpress/handlers/handleSendMany.ts @@ -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, diff --git a/src/masterBitgoExpress/routers/sendManyRoute.ts b/src/masterBitgoExpress/routers/sendManyRoute.ts index 77bda70..608acdf 100644 --- a/src/masterBitgoExpress/routers/sendManyRoute.ts +++ b/src/masterBitgoExpress/routers/sendManyRoute.ts @@ -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,