Fix types
This commit is contained in:
parent
55211ed5f8
commit
b47fb525f5
|
@ -66,7 +66,7 @@ export const mustBeEthereumAddress = simpleMemoize((address: Field) => {
|
||||||
return isAddress ? undefined : 'Address should be a valid Ethereum address or ENS name'
|
return isAddress ? undefined : 'Address should be a valid Ethereum address or ENS name'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const mustBeEthereumContractAddress = simpleMemoize(async (address: Field) => {
|
export const mustBeEthereumContractAddress = simpleMemoize(async (address: string) => {
|
||||||
const contractCode: string = await getWeb3().eth.getCode(address)
|
const contractCode: string = await getWeb3().eth.getCode(address)
|
||||||
|
|
||||||
return (!contractCode || contractCode.replace('0x', '').replace(/0/g, '') === '')
|
return (!contractCode || contractCode.replace('0x', '').replace(/0/g, '') === '')
|
||||||
|
|
|
@ -11,6 +11,8 @@ import ReviewTx from './screens/ReviewTx'
|
||||||
import SendCustomTx from './screens/SendCustomTx'
|
import SendCustomTx from './screens/SendCustomTx'
|
||||||
import ReviewCustomTx from './screens/ReviewCustomTx'
|
import ReviewCustomTx from './screens/ReviewCustomTx'
|
||||||
|
|
||||||
|
type ActiveScreen = 'chooseTxType' | 'sendFunds' | 'reviewTx' | 'sendCustomTx' | 'reviewCustomTx'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onClose: () => void,
|
onClose: () => void,
|
||||||
classes: Object,
|
classes: Object,
|
||||||
|
@ -22,11 +24,9 @@ type Props = {
|
||||||
tokens: List<Token>,
|
tokens: List<Token>,
|
||||||
selectedToken: string,
|
selectedToken: string,
|
||||||
createTransaction: Function,
|
createTransaction: Function,
|
||||||
activeScreenType: string
|
activeScreenType: ActiveScreen
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActiveScreen = 'chooseTxType' | 'sendFunds' | 'reviewTx' | 'sendCustomTx' | 'reviewCustomTx'
|
|
||||||
|
|
||||||
type TxStateType =
|
type TxStateType =
|
||||||
| {
|
| {
|
||||||
token: Token,
|
token: Token,
|
||||||
|
|
Loading…
Reference in New Issue