logger.log({level:'DEBUG',fileName:'Channels',msg:'Forwarding History Response: ' +JSON.stringify(body)});
logger.log({level:'DEBUG',fileName:'Channels',msg:'Forwarding History Response',data:body});
if(!body||body.error){
logger.log({level:'ERROR',fileName:'Channels',msg:'Forwarding History Error: ' +((!body||!body.error)?'Error From Server!':JSON.stringify(body.error))});
logger.log({level:'ERROR',fileName:'Channels',msg:'Forwarding History Error',error:body.error});
logger.log({level:'ERROR',fileName:'GetInfo',msg:'Eclair Get info failed due to missing or wrong password!'});
logger.log({level:'ERROR',fileName:'GetInfo',msg:'Eclair Get info failed due to missing or wrong password!', error:{error:'Missing or wrong password.'}});
res.status(502).json({
message:"Fetching Info Failed!",
error:"Missing Or Wrong Password"
});
}else{
request.post(options).then((body)=>{
logger.log({level:'DEBUG',fileName:'GetInfo',msg:'Get Info Response: ' +JSON.stringify(body)});
logger.log({level:'DEBUG',fileName:'GetInfo',msg:'Get Info Response',data:body});
logger.log({level:'DEBUG',fileName:'Channels',msg:'Channel Open Response: ' +JSON.stringify(body)});
logger.log({level:'DEBUG',fileName:'Channels',msg:'Channel Open Response',data:body});
if(!body||body.error){
logger.log({level:'ERROR',fileName:'Channels',msg:'Open New Channel Error: ' +((!body||!body.error)?'Error From Server!':JSON.stringify(body.error))});
logger.log({level:'ERROR',fileName:'Channels',msg:'Open New Channel Error',error:body.error});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Backup Verify Error: Channel backup to verify does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Backup Verify Error. Channel backup to verify does not Exist!',error:{error:'Channel backup to verify does not Exist.'}});
res.status(404).json({message:'Channels backup to verify does not Exist!'});
}
}else{
verify_backup='';
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Backup Verify Error: Channel backup to verify does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Backup Verify Error. Channel backup to verify does not Exist!',error:{error:'Channel backup to verify does not Exist.'}});
res.status(404).json({message:'Channels backup to verify does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Backup Verify Error: Channel backup to verify does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Backup Verify Error. Channel backup to verify does not Exist!',error:{error:'Channel backup to verify does not Exist.'}});
res.status(404).json({message:'Channel backup to verify does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error: Channels backup to restore does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error.Channels backup to restore does not Exist!',error:{error:'Channel backup to restore does not Exist.'}});
res.status(404).json({message:'Channels backup to restore does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error: Channels backup to restore does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error. Channels backup to restore does not Exist!',error:{error:'Channel backup to restore does not Exist.'}});
res.status(404).json({message:'Channels backup to restore does not Exist!'});
}
}else{
restore_backup='';
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error: Channels backup to restore does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error. Channels backup to restore does not Exist!',error:{error:'Channel backup to restore does not Exist.'}});
res.status(404).json({message:'Channels backup to restore does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error: Channels backup to restore does not Exist!'});
logger.log({level:'ERROR',fileName:'ChannelBackup',msg:'Channel Restore Error. Channels backup to restore does not Exist!',error:{error:'Channel backup to restore does not Exist.'}});
res.status(404).json({message:'Channel backup to restore does not Exist!'});
logger.log({level:'ERROR',fileName:'Authenticate',msg:'SSO Authentication Failed! Access key too short or does not match.'});
logger.log({level:'ERROR',fileName:'Authenticate',msg:'SSO Authentication Failed! Access key too short or does not match.', error:{error:'Access key too short or does not match.'}});
res.status(406).json({
message:"SSO Authentication Failed!",
error:"SSO failed. Access key too short or does not match."
if(options.url===''){returnres.status(500).json({message:"Boltz Get Info Failed!",error:{message:'Boltz Server URL is missing in the configuration.'}});}
options.url=options.url+'/v1/info';
request(options).then(function(body){
logger.log({level:'INFO',fileName:'Boltz',msg:'Boltz Information Received.'});
logger.log({level:'DEBUG',fileName:'Boltz',msg:'Boltz Get Info: ' +JSON.stringify(body)});
logger.log({level:'INFO',fileName:'Boltz',msg:'Boltz Information Received'});
logger.log({level:'DEBUG',fileName:'Boltz',msg:'Boltz Get Info',data:body});
logger.log({level:'INFO',fileName:'Boltz',msg:'Getting Service Information...'});
logger.log({level:'INFO',fileName:'Boltz',msg:'Getting Service Information..'});
options=common.getBoltzServerOptions();
if(options.url===''){returnres.status(500).json({message:"Boltz Get Service Info Failed!",error:{message:'Boltz Server URL is missing in the configuration.'}});}
options.url=options.url+'/v1/serviceinfo';
request(options).then(function(body){
logger.log({level:'INFO',fileName:'Boltz',msg:'Service Information Received.'});
logger.log({level:'DEBUG',fileName:'Boltz',msg:'Boltz Get Service Info: ' +JSON.stringify(body)});
logger.log({level:'INFO',fileName:'Boltz',msg:'Service Information Received'});
logger.log({level:'DEBUG',fileName:'Boltz',msg:'Boltz Get Service Info',data:body});
logger.log({level:'INFO',fileName:'Boltz',msg:'Getting List Swaps...'});
logger.log({level:'INFO',fileName:'Boltz',msg:'Getting List Swaps..'});
options=common.getBoltzServerOptions();
if(options.url===''){returnres.status(500).json({message:"Boltz List Swaps Failed!",error:{message:'Boltz Server URL is missing in the configuration.'}});}
options.url=options.url+'/v1/listswaps';
request(options).then(function(body){
logger.log({level:'DEBUG',fileName:'Boltz',msg:'Boltz List Swaps Info: ' +JSON.stringify(body)});
logger.log({level:'DEBUG',fileName:'Boltz',msg:'Boltz List Swaps Info',data:body});
if(options.url===''){returnres.status(500).json({message:"Boltz Swap Info Failed!",error:{message:'Boltz Server URL is missing in the configuration.'}});}
if(options.url===''){returnres.status(500).json({message:"Create Reverse Swap Failed!",error:{message:'Boltz Server URL is missing in the configuration.'}});}
if(options.url===''){returnres.status(500).json({message:"Create Channel Failed!",error:{message:'Boltz Server URL is missing in the configuration.'}});}
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop Out Terms...'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop Out Terms..'});
options=common.getSwapServerOptions();
if(options.url===''){returnres.status(500).json({message:"Loop Out Terms Failed!",error:{message:'Loop Server URL is missing in the configuration.'}});}
options.url=options.url+'/v1/loop/out/terms';
request(options).then(function(body){
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop Out Terms: ' +JSON.stringify(body)});
logger.log({level:'INFO',fileName:'Loop',msg:'Loop Out Terms Received.'});
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop Out Terms',data:body});
logger.log({level:'INFO',fileName:'Loop',msg:'Loop Out Terms Received'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop Out Quotes...'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop Out Quotes..'});
options=common.getSwapServerOptions();
if(options.url===''){returnres.status(500).json({message:"Loop Out Quote Failed!",error:{message:'Loop Server URL is missing in the configuration.'}});}
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop Out Terms & Quotes...'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop Out Terms & Quotes..'});
options=common.getSwapServerOptions();
if(options.url===''){returnres.status(500).json({message:"Loop Out Terms And Quotes Failed!",error:{message:'Loop Server URL is missing in the configuration.'}});}
options.url=options.url+'/v1/loop/out/terms';
request(options).then(function(terms){
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop Out Terms: ' +JSON.stringify(terms)});
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop Out Terms',data:terms});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop In Terms...'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop In Terms..'});
options=common.getSwapServerOptions();
if(options.url===''){returnres.status(500).json({message:"Loop In Terms Failed!",error:{message:'Loop Server URL is missing in the configuration.'}});}
options.url=options.url+'/v1/loop/in/terms';
request(options).then(function(body){
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop In Terms: ' +JSON.stringify(body)});
logger.log({level:'INFO',fileName:'Loop',msg:'Loop In Terms Received.'});
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop In Terms',data:body});
logger.log({level:'INFO',fileName:'Loop',msg:'Loop In Terms Received'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop In Quotes...'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop In Quotes..'});
options=common.getSwapServerOptions();
if(options.url===''){returnres.status(500).json({message:"Loop In Quote Failed!",error:{message:'Loop Server URL is missing in the configuration.'}});}
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop In Terms & Quotes...'});
logger.log({level:'INFO',fileName:'Loop',msg:'Getting Loop In Terms & Quotes..'});
options=common.getSwapServerOptions();
if(options.url===''){returnres.status(500).json({message:"Loop In Terms And Quotes Failed!",error:{message:'Loop Server URL is missing in the configuration.'}});}
options.url=options.url+'/v1/loop/in/terms';
request(options).then(function(terms){
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop In Terms: ' +JSON.stringify(terms)});
logger.log({level:'DEBUG',fileName:'Loop',msg:'Loop In Terms',data:terms});