diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-11-27 06:47:46 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-11-27 06:49:50 +0800 |
commit | 2795849dd3170542d3120a4e8c2493d29fa76a26 (patch) | |
tree | bbf5debe781391361357966a50ef7bfc8b2aec64 /packages/instant/src/components | |
parent | fad48b8b6c5299b2fd3b8490779a538e1158f2dd (diff) | |
download | dexon-sol-tools-2795849dd3170542d3120a4e8c2493d29fa76a26.tar dexon-sol-tools-2795849dd3170542d3120a4e8c2493d29fa76a26.tar.gz dexon-sol-tools-2795849dd3170542d3120a4e8c2493d29fa76a26.tar.bz2 dexon-sol-tools-2795849dd3170542d3120a4e8c2493d29fa76a26.tar.lz dexon-sol-tools-2795849dd3170542d3120a4e8c2493d29fa76a26.tar.xz dexon-sol-tools-2795849dd3170542d3120a4e8c2493d29fa76a26.tar.zst dexon-sol-tools-2795849dd3170542d3120a4e8c2493d29fa76a26.zip |
feat(instant): add buyQuote properties to buy events
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 9a6785862..118e3c92f 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -60,7 +60,7 @@ export class BuyButton extends React.Component<BuyButtonProps> { // if we don't have a balance for the user, let the transaction through, it will be handled by the wallet const hasSufficientEth = _.isUndefined(accountEthBalanceInWei) || accountEthBalanceInWei.gte(ethNeededForBuy); if (!hasSufficientEth) { - analytics.trackBuyNotEnoughEth(); + analytics.trackBuyNotEnoughEth(buyQuote); this.props.onValidationFail(buyQuote, ZeroExInstantError.InsufficientETH); return; } @@ -68,21 +68,21 @@ export class BuyButton extends React.Component<BuyButtonProps> { const gasInfo = await gasPriceEstimator.getGasInfoAsync(); const feeRecipient = oc(affiliateInfo).feeRecipient(); try { - analytics.trackBuyStarted(); + analytics.trackBuyStarted(buyQuote); txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote, { feeRecipient, takerAddress: accountAddress, gasPrice: gasInfo.gasPriceInWei, }); - analytics.trackBuyTxSubmitted(txHash); + analytics.trackBuyTxSubmitted(buyQuote, txHash); } catch (e) { if (e instanceof Error) { if (e.message === AssetBuyerError.SignatureRequestDenied) { - analytics.trackBuySignatureDenied(); + analytics.trackBuySignatureDenied(buyQuote); this.props.onSignatureDenied(buyQuote); return; } else if (e.message === AssetBuyerError.TransactionValueTooLow) { - analytics.trackBuySimulationFailed(); + analytics.trackBuySimulationFailed(buyQuote); this.props.onValidationFail(buyQuote, AssetBuyerError.TransactionValueTooLow); return; } @@ -95,14 +95,14 @@ export class BuyButton extends React.Component<BuyButtonProps> { try { await web3Wrapper.awaitTransactionSuccessAsync(txHash); } catch (e) { - analytics.trackBuyTxFailed(txHash); + analytics.trackBuyTxFailed(buyQuote, txHash); if (e instanceof Error && e.message.startsWith(WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX)) { this.props.onBuyFailure(buyQuote, txHash); return; } throw e; } - analytics.trackBuyTxSucceeded(txHash); + analytics.trackBuyTxSucceeded(buyQuote, txHash); this.props.onBuySuccess(buyQuote, txHash); }; } |