Files
solana/explorer/src/utils/index.ts
2020-06-12 16:32:05 -07:00

10 lines
274 B
TypeScript

import { LAMPORTS_PER_SOL } from "@solana/web3.js";
export function assertUnreachable(x: never): never {
throw new Error("Unreachable!");
}
export function lamportsToSolString(lamports: number): string {
return `${(1.0 * Math.abs(lamports)) / LAMPORTS_PER_SOL}`;
}