Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
decodedRequest: ['getLnd', 'getPrices', ({getLnd, getPrices}, cbk) => {
return decodePaymentRequest({
lnd: getLnd.lnd,
request: getPrices.request,
},
cbk);
}],
to: ['validate', ({}, cbk) => {
if (!!args.destination) {
return cbk(null, {destination: args.destination, routes: []});
}
if (!args.request) {
return cbk([400, 'PayRequestOrDestinationRequiredToInitiateProbe']);
}
return decodePaymentRequest({lnd: args.lnd, request: args.request}, cbk);
}],
decodeExecutionRequest: ['initiateSwap', ({initiateSwap}, cbk) => {
if (!!args.recovery) {
return cbk();
}
return decodePaymentRequest({
lnd: args.lnd,
request: initiateSwap.swap_execute_request,
},
cbk);
}],