13 lines
341 B
TypeScript
13 lines
341 B
TypeScript
import { web3 } from "../web3";
|
|
|
|
export function shortenAddress(address: string) {
|
|
return address.slice(0, 6) + "..." + address.slice(-4);
|
|
}
|
|
|
|
export function formatPadTokenAmount(amount: bigint) {
|
|
if (Number(amount) === Math.pow(2, 256)) {
|
|
return "∞ PAD";
|
|
}
|
|
return `${web3.utils.fromWei(amount, "ether").replace(/\.*$/, "")} PAD`;
|
|
}
|