MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / buildFiatToFiatResponse

Method buildFiatToFiatResponse

rate/rate.ts:579–585  ·  view source on GitHub ↗
(amount: number, convertedAmount: number, rate: number, sourceSymbol: string, targetSymbol: string)

Source from the content-addressed store, hash-verified

577 `📊 <b>汇率:</b> ${codeTag(`1 ${sourceSymbol} = ${this.formatAmount(rate)} ${targetSymbol}`)}\n` +
578 `⏰ <b>更新时间:</b> ${new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}`;
579 }
580
581 private buildCryptoToCryptoResponse(amount: number, convertedAmount: number, conversionRate: number, price: number, targetPrice: number, sourceSymbol: string, targetSymbol: string, lastUpdated: Date): string {
582 return `💱 <b>汇率</b>\n\n` +
583 `${codeTag(`${this.formatAmount(amount)} ${sourceSymbol} ≈`)}\n` +
584 `${codeTag(`${this.formatAmount(convertedAmount)} ${targetSymbol}`)}\n\n` +
585 `💎 <b>兑换比率:</b> ${codeTag(`1 ${sourceSymbol} = ${this.formatAmount(conversionRate)} ${targetSymbol}`)}\n` +
586 `📊 <b>基准价格:</b> ${codeTag(`${sourceSymbol} $${this.formatPrice(price)} • ${targetSymbol} $${this.formatPrice(targetPrice)}`)}\n` +
587 `⏰ <b>数据更新:</b> ${lastUpdated.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })}`;
588 }

Callers 1

handleRateMethod · 0.95

Calls 2

formatAmountMethod · 0.95
codeTagFunction · 0.70

Tested by

no test coverage detected