Adds isEmptyAddress method
This commit is contained in:
parent
38c5bdf757
commit
8b1809d8eb
|
@ -1,12 +1,18 @@
|
||||||
import { List } from 'immutable'
|
import { List } from 'immutable'
|
||||||
import { SafeRecord } from 'src/logic/safe/store/models/safe'
|
import { SafeRecord } from 'src/logic/safe/store/models/safe'
|
||||||
import { sameString } from 'src/utils/strings'
|
import { sameString } from 'src/utils/strings'
|
||||||
|
import { EMPTY_DATA } from 'src/logic/wallets/ethTransactions'
|
||||||
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
||||||
|
|
||||||
export const sameAddress = (firstAddress: string | undefined, secondAddress: string | undefined): boolean => {
|
export const sameAddress = (firstAddress: string | undefined, secondAddress: string | undefined): boolean => {
|
||||||
return sameString(firstAddress, secondAddress)
|
return sameString(firstAddress, secondAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const isEmptyAddress = (address: string | undefined): boolean => {
|
||||||
|
if (!address) return true
|
||||||
|
return sameAddress(address, EMPTY_DATA) || sameAddress(address, ZERO_ADDRESS)
|
||||||
|
}
|
||||||
|
|
||||||
export const shortVersionOf = (value: string, cut: number): string => {
|
export const shortVersionOf = (value: string, cut: number): string => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return 'Unknown'
|
return 'Unknown'
|
||||||
|
|
Loading…
Reference in New Issue