aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-11-27 15:08:20 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-11-27 15:08:20 +0800
commitd3b0162dc979ccdc4b4ddff62199929c714ad3ca (patch)
tree1dc7a93c9376223c7645086739adfc3328d08fed /packages/instant/src/components
parent2795849dd3170542d3120a4e8c2493d29fa76a26 (diff)
downloaddexon-0x-contracts-d3b0162dc979ccdc4b4ddff62199929c714ad3ca.tar.gz
dexon-0x-contracts-d3b0162dc979ccdc4b4ddff62199929c714ad3ca.tar.zst
dexon-0x-contracts-d3b0162dc979ccdc4b4ddff62199929c714ad3ca.zip
feat(instant): add expectedEndTimeUnix and actualEndTimeUnix to buy events
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/buy_button.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 118e3c92f..eeb42d6fc 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -74,7 +74,6 @@ export class BuyButton extends React.Component<BuyButtonProps> {
takerAddress: accountAddress,
gasPrice: gasInfo.gasPriceInWei,
});
- analytics.trackBuyTxSubmitted(buyQuote, txHash);
} catch (e) {
if (e instanceof Error) {
if (e.message === AssetBuyerError.SignatureRequestDenied) {
@@ -93,16 +92,17 @@ export class BuyButton extends React.Component<BuyButtonProps> {
const expectedEndTimeUnix = startTimeUnix + gasInfo.estimatedTimeMs;
this.props.onBuyProcessing(buyQuote, txHash, startTimeUnix, expectedEndTimeUnix);
try {
+ analytics.trackBuyTxSubmitted(buyQuote, txHash, startTimeUnix, expectedEndTimeUnix);
await web3Wrapper.awaitTransactionSuccessAsync(txHash);
} catch (e) {
- analytics.trackBuyTxFailed(buyQuote, txHash);
if (e instanceof Error && e.message.startsWith(WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX)) {
+ analytics.trackBuyTxFailed(buyQuote, txHash, startTimeUnix, expectedEndTimeUnix);
this.props.onBuyFailure(buyQuote, txHash);
return;
}
throw e;
}
- analytics.trackBuyTxSucceeded(buyQuote, txHash);
+ analytics.trackBuyTxSucceeded(buyQuote, txHash, startTimeUnix, expectedEndTimeUnix);
this.props.onBuySuccess(buyQuote, txHash);
};
}