How to use the bitgo/dist/src/v2/internal/util.RequestTracer function in bitgo

To help you get started, we’ve selected a few bitgo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BitGo / BitGoJS / modules / express / src / clientRoutes.ts View on Github external
async function handleV2SendOne(req: express.Request) {
  const bitgo = req.bitgo;
  const coin = bitgo.coin(req.params.coin);
  const reqId = new RequestTracer();
  const wallet = await coin.wallets().get({ id: req.params.id, reqId });
  req.body.reqId = reqId;

  let result;
  try {
    result = await wallet.send(req.body);
  } catch (err) {
    err.status = 400;
    throw err;
  }
  if (result.status === 'pendingApproval') {
    throw apiResponse(202, result);
  }
  return result;
}
github BitGo / BitGoJS / modules / express / src / clientRoutes.ts View on Github external
async function handleV2SendMany(req: express.Request) {
  const bitgo = req.bitgo;
  const coin = bitgo.coin(req.params.coin);
  const reqId = new RequestTracer();
  const wallet = await coin.wallets().get({ id: req.params.id, reqId });
  req.body.reqId = reqId;
  let result;
  try {
    result = await wallet.sendMany(req.body);
  } catch (err) {
    err.status = 400;
    throw err;
  }
  if (result.status === 'pendingApproval') {
    throw apiResponse(202, result);
  }
  return result;
}