Skip to content

Commit 196f9dc

Browse files
committed
log formatting
1 parent 9043381 commit 196f9dc

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/index.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,16 @@ const jupiterSwap = async ({
5353
if (swapResult.error) {
5454
console.log(swapResult.error);
5555
} else {
56-
console.log(
57-
`${
58-
swapResult.inputAmount / (10 ** inputToken.decimals)} ${inputToken.symbol} -> ${swapResult.outputAmount / (10 ** inputToken.decimals)} ${outputToken.symbol}: https://solscan.io/tx/${swapResult.txid}`
59-
);
56+
// trying to keep these on one line
57+
process.stdout.write(
58+
`${swapResult.inputAmount / (10 ** inputToken.decimals)} `
59+
);
60+
process.stdout.write(`${inputToken.symbol} -> `);
61+
process.stdout.write(
62+
`${swapResult.outputAmount / (10 ** inputToken.decimals)} `
63+
);
64+
process.stdout.write(`${outputToken.symbol} -> `);
65+
console.log(`https://solscan.io/tx/${swapResult.txid}`);
6066
}
6167
} else {
6268
console.log("Error: Jupiter couldn't route.");
@@ -78,7 +84,10 @@ const main = async () => {
7884
// Fetch token list from Jupiter API
7985
const tokens: Token[] = await (await fetch(TOKEN_LIST_URL[ENV])).json();
8086

81-
console.log("Validating dcaconfig. Jobs may not be included if the cron expression is invalid or chosen token strings do not exist in the MINT_ADDRESSES object.");
87+
console.log("Validating dcaconfig.");
88+
console.log("A job may be excluded because:");
89+
console.log("- invalid cron expression");
90+
console.log("- inputToken or outputToken does not exist in MINT_ADDRESSES");
8291
const filteredJobs = dcaconfig.filter(job => {
8392
return (cron.validate(job.cron)
8493
&& job.inputToken in MINT_ADDRESSES

0 commit comments

Comments
 (0)