Send in affiliate info as option
This commit is contained in:
parent
447b0f91f9
commit
33a156d9b5
@ -81,14 +81,11 @@ const mapDispatchToProps = (
|
||||
// even if it's debounced, give them the illusion it's loading
|
||||
dispatch(actions.setQuoteRequestStatePending());
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
debouncedUpdateBuyQuoteAsync(
|
||||
assetBuyer,
|
||||
dispatch,
|
||||
asset,
|
||||
value,
|
||||
{ setPending: true, dispatchErrors: true },
|
||||
debouncedUpdateBuyQuoteAsync(assetBuyer, dispatch, asset, value, {
|
||||
setPending: true,
|
||||
dispatchErrors: true,
|
||||
affiliateInfo,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -97,8 +97,7 @@ export const asyncData = {
|
||||
dispatch,
|
||||
selectedAsset as ERC20Asset,
|
||||
selectedAssetUnitAmount,
|
||||
{ setPending: !options.updateSilently, dispatchErrors: !options.updateSilently },
|
||||
affiliateInfo,
|
||||
{ setPending: !options.updateSilently, dispatchErrors: !options.updateSilently, affiliateInfo },
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -16,8 +16,7 @@ export const buyQuoteUpdater = {
|
||||
dispatch: Dispatch<Action>,
|
||||
asset: ERC20Asset,
|
||||
assetUnitAmount: BigNumber,
|
||||
options: { setPending: boolean; dispatchErrors: boolean },
|
||||
affiliateInfo?: AffiliateInfo,
|
||||
options: { setPending: boolean; dispatchErrors: boolean; affiliateInfo?: AffiliateInfo },
|
||||
): Promise<void> => {
|
||||
// get a new buy quote.
|
||||
const baseUnitValue = Web3Wrapper.toBaseUnitAmount(assetUnitAmount, asset.metaData.decimals);
|
||||
@ -25,7 +24,7 @@ export const buyQuoteUpdater = {
|
||||
// mark quote as pending
|
||||
dispatch(actions.setQuoteRequestStatePending());
|
||||
}
|
||||
const feePercentage = oc(affiliateInfo).feePercentage();
|
||||
const feePercentage = oc(options.affiliateInfo).feePercentage();
|
||||
let newBuyQuote: BuyQuote | undefined;
|
||||
try {
|
||||
newBuyQuote = await assetBuyer.getBuyQuoteAsync(asset.assetData, baseUnitValue, { feePercentage });
|
||||
|
Loading…
x
Reference in New Issue
Block a user