mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-20 22:00:43 +08:00
Get everything properly typed
This commit is contained in:
+3
-2
@@ -1,10 +1,11 @@
|
||||
import { ethers } from "ethers";
|
||||
import type { BigNumber } from "ethers";
|
||||
|
||||
export function formatBalance(n) {
|
||||
export function formatBalance(n: BigNumber) {
|
||||
return ethers.utils.commify(parseFloat(ethers.utils.formatUnits(n)).toFixed(2));
|
||||
}
|
||||
|
||||
export function formatAddress(addr) {
|
||||
export function formatAddress(addr: string) {
|
||||
return addr.substring(0, 6)
|
||||
+ '...'
|
||||
+ addr.substring(addr.length - 4, addr.length);
|
||||
|
||||
Reference in New Issue
Block a user