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