gdog-tg-share
v1.4.0
Published
G.dog Telegram Share Images.
Downloads
37
Readme
gdog-Tg-share
token share Demo token
const {TokenShare} = require('gdog-tg-share');
const tokenInfo = {
"price": 0.000011783288298661556,
"token_decimals": 18,
"token_name": "Pepe",
"token_symbol": "PEPE",
...
};
const chartData = [
{
"price": 0.000011397883896766809,
"timestamp": "2024-07-16T08:00:00.000Z"
},
{
"price": 0.00001192862732773498,
"timestamp": "2024-07-16T09:00:00.000Z"
},
{
"price": 0.00001212820984628874,
"timestamp": "2024-07-16T10:00:00.000Z"
},
...
];
const summary = {
"summary": "根据G.DOG的AI分析,这个币可能包含了深厚的meme文化和社区元素。Pepe(PEPE)借用了广受欢迎的Pepe the Frog的形象,这个形象在互联网meme文化中有很高的辨识度和影响力。官网声称$PEPE旨在取代其他流行的meme币,打造“最具meme潜力的memecoin”。该币无预售、无税收,且LP已被烧毁,合约已放弃控制,旨在通过其memetic力量吸引社区关注。虽然没有实际价值或回报预期,但强大的文化认同可能推动其社交媒体上的热度。This token has a relatively long issuance time, the contract code is open-source (owner renounced), liquidity is sufficient (locked), trading volume is active, tax rate is 0%, social media topics are very active, overall risk assessment level is low."
};
(async () => {
const tokenShare = new TokenShare({
// language = en | zh
language: 'en',
});
await tokenShare.initBg();
await tokenShare.clearData();
// 设置title potential | trending, 默认 trending
await tokenShare.setTokenInfo(tokenInfo, 'potential');
await tokenShare.setChart(chartData);
// 0 表示显示全部AI分析内容, >= 3表示显示多少行, 至少3行
await tokenShare.setSummaryData(summary, 0);
// 增加导出PNG 压缩级别和过滤器设置
// compressionLevel = 1~9 默认 9, 1-3 快速, 4-6 最佳质量, 7-9 平衡
// 默认 PNG_FILTER_AVG,filters = PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | PNG_FILTER_AVG | PNG_FILTER_PAETH | PNG_ALL_FILTERS
const PNGBuffer = await tokenShare.getPNGBuffer({
compressionLevel: 9,
filters: tokenShare.canvas.PNG_FILTER_AVG,
});
// 增加导出JPEG buffer, quality 压缩质量设置 0~1, 1=最高质量
const JPEGBuffer = await tokenShare.getJPEGBuffer({
quality: 0.95
})
console.log(JPEGBuffer);
})()