|
|
@ -63,14 +63,17 @@ PendingTx.prototype.componentWillMount = async function () { |
|
|
|
isFetching: false, |
|
|
|
isFetching: false, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const tokenData = txParams && abiDecoder.decodeMethod(txParams.data) |
|
|
|
|
|
|
|
const { name: tokenMethodName } = tokenData || {} |
|
|
|
|
|
|
|
const isTokenTransaction = ['transfer', 'approve', 'transferFrom'] |
|
|
|
|
|
|
|
.find(possibleName => tokenMethodName === possibleName) |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
if (isTokenTransaction) { |
|
|
|
const token = util.getContractAtAddress(txParams.to) |
|
|
|
const token = util.getContractAtAddress(txParams.to) |
|
|
|
const results = await Promise.all([ |
|
|
|
const results = await Promise.all([ |
|
|
|
token.symbol(), |
|
|
|
token.symbol(), |
|
|
|
token.decimals(), |
|
|
|
token.decimals(), |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
const [ symbol, decimals ] = results |
|
|
|
const [ symbol, decimals ] = results |
|
|
|
|
|
|
|
|
|
|
|
if (symbol[0] && decimals[0]) { |
|
|
|
if (symbol[0] && decimals[0]) { |
|
|
@ -83,11 +86,14 @@ PendingTx.prototype.componentWillMount = async function () { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.setState({ |
|
|
|
this.setState({ |
|
|
|
transactionType: TX_TYPES.SEND_ETHER, |
|
|
|
transactionType: TX_TYPES.SEND_TOKEN, |
|
|
|
|
|
|
|
tokenAddress: txParams.to, |
|
|
|
|
|
|
|
tokenSymbol: null, |
|
|
|
|
|
|
|
tokenDecimals: null, |
|
|
|
isFetching: false, |
|
|
|
isFetching: false, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
} else { |
|
|
|
this.setState({ |
|
|
|
this.setState({ |
|
|
|
transactionType: TX_TYPES.SEND_ETHER, |
|
|
|
transactionType: TX_TYPES.SEND_ETHER, |
|
|
|
isFetching: false, |
|
|
|
isFetching: false, |
|
|
|