feat: explorer API, wallet, CCIP scripts, and config refresh

- Backend REST/gateway/track routes, analytics, Blockscout proxy paths.
- Frontend wallet and liquidity surfaces; MetaMask token list alignment.
- Deployment docs, verification scripts, address inventory updates.

Check: go build ./... under backend/ (pass).
Made-with: Cursor
This commit is contained in:
defiQUG
2026-04-07 23:22:12 -07:00
parent 4044fb07e1
commit bdae5a9f6e
224 changed files with 19671 additions and 3291 deletions

View File

@@ -0,0 +1,30 @@
const WEI_DECIMALS = 18n
export function formatWeiAsEth(value: string, fractionDigits = 4): string {
try {
const normalizedDigits = Math.max(0, Math.min(18, fractionDigits))
const wei = BigInt(value)
const divisor = 10n ** WEI_DECIMALS
const whole = wei / divisor
const fraction = wei % divisor
if (normalizedDigits === 0) {
return `${whole.toString()} ETH`
}
const scale = 10n ** (WEI_DECIMALS - BigInt(normalizedDigits))
const truncatedFraction = fraction / scale
const paddedFraction = truncatedFraction
.toString()
.padStart(normalizedDigits, '0')
.replace(/0+$/, '')
if (!paddedFraction) {
return `${whole.toString()} ETH`
}
return `${whole.toString()}.${paddedFraction} ETH`
} catch {
return '0 ETH'
}
}