Added as shorten utily method to eth address logic files

This commit is contained in:
apanizo 2018-09-05 15:50:47 +02:00
parent 19bcc7db7c
commit 13b28dc51f
1 changed files with 7 additions and 0 deletions

View File

@ -10,3 +10,10 @@ export const sameAddress = (firstAddress: string, secondAddress: string): boolea
return firstAddress.toLowerCase() === secondAddress.toLowerCase()
}
export const shortVersionOf = (address: string, cut: number) => {
const initial = cut
const final = 42 - cut
return `${address.substring(0, initial)}...${address.substring(final)}`
}