aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-29 06:11:53 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-29 06:11:53 +0800
commitec01893e9c987fcbd3fd7bcb4ec34498a6f516cc (patch)
treeaf7714c79643c1bbf51a2c8ac19277205ef4e310 /packages/instant/src
parentf4cc14f43862c639d2cf9f6e5359e4822f1bcacf (diff)
downloaddexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.gz
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.bz2
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.lz
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.xz
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.tar.zst
dexon-sol-tools-ec01893e9c987fcbd3fd7bcb4ec34498a6f516cc.zip
fetchedVia -> fetchOrigin
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx2
-rw-r--r--packages/instant/src/containers/selected_erc20_asset_amount_input.ts2
-rw-r--r--packages/instant/src/redux/async_data.ts4
-rw-r--r--packages/instant/src/util/analytics.ts8
-rw-r--r--packages/instant/src/util/buy_quote_updater.ts10
-rw-r--r--packages/instant/src/util/heartbeater_factory.ts2
6 files changed, 16 insertions, 12 deletions
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
index 7841f5bf7..f7880fc12 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -117,7 +117,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
// tslint:disable-next-line:no-floating-promises
asyncData.fetchCurrentBuyQuoteAndDispatchToStore(state, dispatch, {
updateSilently: false,
- fetchedVia: QuoteFetchOrigin.Manual,
+ fetchOrigin: QuoteFetchOrigin.Manual,
});
// warm up the gas price estimator cache just in case we can't
// grab the gas price estimate when submitting the transaction
diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
index a2d523b82..40e35b575 100644
--- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
+++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts
@@ -92,7 +92,7 @@ const mapDispatchToProps = (
setPending: true,
dispatchErrors: true,
affiliateInfo,
- fetchedVia: QuoteFetchOrigin.Manual,
+ fetchOrigin: QuoteFetchOrigin.Manual,
});
}
},
diff --git a/packages/instant/src/redux/async_data.ts b/packages/instant/src/redux/async_data.ts
index 6a1d2ed00..dc73fd9af 100644
--- a/packages/instant/src/redux/async_data.ts
+++ b/packages/instant/src/redux/async_data.ts
@@ -84,7 +84,7 @@ export const asyncData = {
fetchCurrentBuyQuoteAndDispatchToStore: async (
state: State,
dispatch: Dispatch,
- options: { updateSilently: boolean; fetchedVia: QuoteFetchOrigin },
+ options: { updateSilently: boolean; fetchOrigin: QuoteFetchOrigin },
) => {
const { buyOrderState, providerState, selectedAsset, selectedAssetUnitAmount, affiliateInfo } = state;
const assetBuyer = providerState.assetBuyer;
@@ -102,7 +102,7 @@ export const asyncData = {
{
setPending: !options.updateSilently,
dispatchErrors: !options.updateSilently,
- fetchedVia: options.fetchedVia,
+ fetchOrigin: options.fetchOrigin,
affiliateInfo,
},
);
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index c0ed8c638..99e8736d3 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -180,16 +180,16 @@ export const analytics = {
trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload),
trackTokenSelectorSearched: (searchText: string) =>
trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }),
- trackQuoteFetched: (buyQuote: BuyQuote, fetchedVia: QuoteFetchOrigin) =>
+ trackQuoteFetched: (buyQuote: BuyQuote, fetchOrigin: QuoteFetchOrigin) =>
trackingEventFnWithPayload(EventNames.QUOTE_FETCHED)({
...buyQuoteEventProperties(buyQuote),
- fetchedVia,
+ fetchOrigin,
}),
- trackQuoteError: (errorMessage: string, assetAmount: BigNumber, fetchedVia: QuoteFetchOrigin) => {
+ trackQuoteError: (errorMessage: string, assetAmount: BigNumber, fetchOrigin: QuoteFetchOrigin) => {
trackingEventFnWithPayload(EventNames.QUOTE_ERROR)({
errorMessage,
assetAmount: assetAmount.toString(),
- fetchedVia,
+ fetchOrigin,
});
},
};
diff --git a/packages/instant/src/util/buy_quote_updater.ts b/packages/instant/src/util/buy_quote_updater.ts
index 14af57660..06474b69f 100644
--- a/packages/instant/src/util/buy_quote_updater.ts
+++ b/packages/instant/src/util/buy_quote_updater.ts
@@ -20,7 +20,7 @@ export const buyQuoteUpdater = {
options: {
setPending: boolean;
dispatchErrors: boolean;
- fetchedVia: QuoteFetchOrigin;
+ fetchOrigin: QuoteFetchOrigin;
affiliateInfo?: AffiliateInfo;
},
): Promise<void> => {
@@ -37,7 +37,11 @@ export const buyQuoteUpdater = {
} catch (error) {
if (options.dispatchErrors) {
dispatch(actions.setQuoteRequestStateFailure());
- analytics.trackQuoteError(error.message ? error.message : 'other', assetUnitAmount, options.fetchedVia);
+ analytics.trackQuoteError(
+ error.message ? error.message : 'other',
+ assetUnitAmount,
+ options.fetchOrigin,
+ );
let errorMessage;
if (error.message === AssetBuyerError.InsufficientAssetLiquidity) {
const assetName = assetUtils.bestNameForAsset(asset, 'of this asset');
@@ -65,6 +69,6 @@ export const buyQuoteUpdater = {
errorFlasher.clearError(dispatch);
// invalidate the last buy quote.
dispatch(actions.updateLatestBuyQuote(newBuyQuote));
- analytics.trackQuoteFetched(newBuyQuote, options.fetchedVia);
+ analytics.trackQuoteFetched(newBuyQuote, options.fetchOrigin);
},
};
diff --git a/packages/instant/src/util/heartbeater_factory.ts b/packages/instant/src/util/heartbeater_factory.ts
index 84aeb4dbc..5f7ef55e5 100644
--- a/packages/instant/src/util/heartbeater_factory.ts
+++ b/packages/instant/src/util/heartbeater_factory.ts
@@ -20,7 +20,7 @@ export const generateBuyQuoteHeartbeater = (options: HeartbeatFactoryOptions): H
return new Heartbeater(async () => {
await asyncData.fetchCurrentBuyQuoteAndDispatchToStore(store.getState(), store.dispatch, {
updateSilently: true,
- fetchedVia: QuoteFetchOrigin.Heartbeat,
+ fetchOrigin: QuoteFetchOrigin.Heartbeat,
});
}, shouldPerformImmediatelyOnStart);
};