solana-better-cli
Version:
A comprehensive Solana wallet management CLI tool with portfolio tracking, token swapping, and more
45 lines • 1.77 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Logger = void 0;
const chalk_1 = __importDefault(require("chalk"));
class Logger {
static info(message) {
console.log(chalk_1.default.blue('ℹ'), message);
}
static success(message) {
console.log(chalk_1.default.green('✅'), message);
}
static warning(message) {
console.log(chalk_1.default.yellow('⚠️'), message);
}
static error(message) {
const errorMessage = message instanceof Error ? message.message : message;
console.log(chalk_1.default.red('❌'), errorMessage);
}
static transaction(signature) {
console.log(chalk_1.default.cyan('🔗 Transaction:'), `https://solscan.io/tx/${signature}`);
}
static wallet(publicKey) {
console.log(chalk_1.default.magenta('👛 Wallet:'), publicKey);
}
static balance(token, amount, symbol = '') {
const formattedAmount = amount.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 6
});
console.log(chalk_1.default.green('💰'), `${token}: ${formattedAmount} ${symbol}`);
}
static header(text) {
console.log('\n' + chalk_1.default.bold.cyan('=' + '='.repeat(text.length + 2) + '='));
console.log(chalk_1.default.bold.cyan(`| ${text} |`));
console.log(chalk_1.default.bold.cyan('=' + '='.repeat(text.length + 2) + '=') + '\n');
}
static separator() {
console.log(chalk_1.default.gray('-'.repeat(50)));
}
}
exports.Logger = Logger;
//# sourceMappingURL=logger.js.map
;