Skip to content
Merged
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
8 changes: 4 additions & 4 deletions modules/express/src/clientRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,11 @@ async function handleV2SendOne(req: express.Request) {
* handle send many
* @param req
*/
async function handleV2SendMany(req: express.Request) {
async function handleV2SendMany(req: ExpressApiRouteRequest<'express.v2.wallet.sendmany', 'post'>) {
const bitgo = req.bitgo;
const coin = bitgo.coin(req.params.coin);
const coin = bitgo.coin(req.decoded.coin);
const reqId = new RequestTracer();
const wallet = await coin.wallets().get({ id: req.params.id, reqId });
const wallet = await coin.wallets().get({ id: req.decoded.id, reqId });
req.body.reqId = reqId;
let result;
try {
Expand Down Expand Up @@ -1641,7 +1641,7 @@ export function setupAPIRoutes(app: express.Application, config: Config): void {

// send transaction
app.post('/api/v2/:coin/wallet/:id/sendcoins', parseBody, prepareBitGo(config), promiseWrapper(handleV2SendOne));
app.post('/api/v2/:coin/wallet/:id/sendmany', parseBody, prepareBitGo(config), promiseWrapper(handleV2SendMany));
router.post('express.v2.wallet.sendmany', [prepareBitGo(config), typedPromiseWrapper(handleV2SendMany)]);
router.post('express.v2.wallet.prebuildandsigntransaction', [
prepareBitGo(config),
typedPromiseWrapper(handleV2PrebuildAndSignTransaction),
Expand Down
9 changes: 9 additions & 0 deletions modules/express/src/typedRoutes/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { PostWalletTxSignTSS } from './v2/walletTxSignTSS';
import { PostShareWallet } from './v2/shareWallet';
import { PutExpressWalletUpdate } from './v2/expressWalletUpdate';
import { PostFanoutUnspents } from './v2/fanoutUnspents';
import { PostSendMany } from './v2/sendmany';
import { PostConsolidateUnspents } from './v2/consolidateunspents';
import { PostPrebuildAndSignTransaction } from './v2/prebuildAndSignTransaction';
import { PostCoinSign } from './v2/coinSign';
Expand Down Expand Up @@ -161,6 +162,12 @@ export const ExpressV2WalletCreateAddressApiSpec = apiSpec({
},
});

export const ExpressV2WalletSendManyApiSpec = apiSpec({
'express.v2.wallet.sendmany': {
post: PostSendMany,
},
});

export const ExpressKeychainLocalApiSpec = apiSpec({
'express.keychain.local': {
post: PostKeychainLocal,
Expand Down Expand Up @@ -256,6 +263,7 @@ export type ExpressApi = typeof ExpressPingApiSpec &
typeof ExpressLightningGetStateApiSpec &
typeof ExpressLightningInitWalletApiSpec &
typeof ExpressLightningUnlockWalletApiSpec &
typeof ExpressV2WalletSendManyApiSpec &
typeof ExpressOfcSignPayloadApiSpec &
typeof ExpressWalletRecoverTokenApiSpec &
typeof ExpressCoinSigningApiSpec &
Expand Down Expand Up @@ -286,6 +294,7 @@ export const ExpressApi: ExpressApi = {
...ExpressLightningGetStateApiSpec,
...ExpressLightningInitWalletApiSpec,
...ExpressLightningUnlockWalletApiSpec,
...ExpressV2WalletSendManyApiSpec,
...ExpressOfcSignPayloadApiSpec,
...ExpressWalletRecoverTokenApiSpec,
...ExpressCoinSigningApiSpec,
Expand Down
Loading