Added as shorten utily method to eth address logic files
This commit is contained in:
parent
19bcc7db7c
commit
13b28dc51f
|
@ -10,3 +10,10 @@ export const sameAddress = (firstAddress: string, secondAddress: string): boolea
|
||||||
|
|
||||||
return firstAddress.toLowerCase() === secondAddress.toLowerCase()
|
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)}`
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue