prettier + minor changes
This commit is contained in:
parent
1135d5a971
commit
c198d0079e
@ -89,11 +89,7 @@ export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase<Forward
|
||||
): Promise<SmartContractParamsInfo<ForwarderSmartContractParams>> {
|
||||
assert.isValidForwarderSwapQuote('quote', quote, await this._getEtherTokenAssetDataOrThrowAsync());
|
||||
|
||||
const { extensionContractOpts } = _.merge(
|
||||
{},
|
||||
constants.DEFAULT_FORWARDER_SWAP_QUOTE_GET_OPTS,
|
||||
opts,
|
||||
);
|
||||
const { extensionContractOpts } = _.merge({}, constants.DEFAULT_FORWARDER_SWAP_QUOTE_GET_OPTS, opts);
|
||||
|
||||
assert.isValidForwarderExtensionContractOpts('extensionContractOpts', extensionContractOpts);
|
||||
|
||||
|
@ -9,9 +9,7 @@ import { SwapQuoterError } from '../types';
|
||||
export class ProtocolFeeUtils {
|
||||
private readonly _exchangeContract: ExchangeContract;
|
||||
|
||||
constructor(
|
||||
exchangeContract: ExchangeContract,
|
||||
) {
|
||||
constructor(exchangeContract: ExchangeContract) {
|
||||
this._exchangeContract = exchangeContract;
|
||||
}
|
||||
|
||||
@ -41,7 +39,10 @@ export class ProtocolFeeUtils {
|
||||
/**
|
||||
* Calculates protocol fee with protofol fee multiplier for each fill.
|
||||
*/
|
||||
public async calculateWorstCaseProtocolFeeAsync<T extends Order>(orders: T[], gasPrice: BigNumber): Promise<BigNumber> {
|
||||
public async calculateWorstCaseProtocolFeeAsync<T extends Order>(
|
||||
orders: T[],
|
||||
gasPrice: BigNumber,
|
||||
): Promise<BigNumber> {
|
||||
const protocolFeeMultiplier = await this.getProtocolFeeMultiplierAsync();
|
||||
const protocolFee = new BigNumber(orders.length).times(protocolFeeMultiplier).times(gasPrice);
|
||||
return protocolFee;
|
||||
|
@ -26,14 +26,14 @@ export const swapQuoteCalculator = {
|
||||
gasPrice: BigNumber,
|
||||
protocolFeeUtils: ProtocolFeeUtils,
|
||||
): Promise<MarketSellSwapQuote> {
|
||||
return await calculateSwapQuoteAsync(
|
||||
return (await calculateSwapQuoteAsync(
|
||||
prunedOrders,
|
||||
takerAssetFillAmount,
|
||||
slippagePercentage,
|
||||
gasPrice,
|
||||
protocolFeeUtils,
|
||||
MarketOperation.Sell,
|
||||
) as MarketSellSwapQuote;
|
||||
)) as MarketSellSwapQuote;
|
||||
},
|
||||
async calculateMarketBuySwapQuoteAsync(
|
||||
prunedOrders: PrunedSignedOrder[],
|
||||
@ -42,14 +42,14 @@ export const swapQuoteCalculator = {
|
||||
gasPrice: BigNumber,
|
||||
protocolFeeUtils: ProtocolFeeUtils,
|
||||
): Promise<MarketBuySwapQuote> {
|
||||
return await calculateSwapQuoteAsync(
|
||||
return (await calculateSwapQuoteAsync(
|
||||
prunedOrders,
|
||||
takerAssetFillAmount,
|
||||
slippagePercentage,
|
||||
gasPrice,
|
||||
protocolFeeUtils,
|
||||
MarketOperation.Buy,
|
||||
) as MarketBuySwapQuote;
|
||||
)) as MarketBuySwapQuote;
|
||||
},
|
||||
};
|
||||
|
||||
@ -103,7 +103,13 @@ async function calculateSwapQuoteAsync(
|
||||
const takerAssetData = resultOrders[0].takerAssetData;
|
||||
const makerAssetData = resultOrders[0].makerAssetData;
|
||||
|
||||
const bestCaseQuoteInfo = await calculateQuoteInfoAsync(resultOrders, assetFillAmount, gasPrice, protocolFeeUtils, marketOperation);
|
||||
const bestCaseQuoteInfo = await calculateQuoteInfoAsync(
|
||||
resultOrders,
|
||||
assetFillAmount,
|
||||
gasPrice,
|
||||
protocolFeeUtils,
|
||||
marketOperation,
|
||||
);
|
||||
// in order to calculate the maxRate, reverse the ordersAndFillableAmounts such that they are sorted from worst rate to best rate
|
||||
const worstCaseQuoteInfo = await calculateQuoteInfoAsync(
|
||||
_.reverse(_.clone(resultOrders)),
|
||||
|
@ -1,4 +1,11 @@
|
||||
import { affiliateFeeUtils, ExtensionContractType, MarketBuySwapQuote, SwapQuoteConsumer, SwapQuoteConsumerError, SwapQuoter } from '@0x/asset-swapper';
|
||||
import {
|
||||
affiliateFeeUtils,
|
||||
ExtensionContractType,
|
||||
MarketBuySwapQuote,
|
||||
SwapQuoteConsumer,
|
||||
SwapQuoteConsumerError,
|
||||
SwapQuoter,
|
||||
} from '@0x/asset-swapper';
|
||||
import { AssetProxyId } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
@ -26,9 +33,17 @@ export interface BuyButtonProps {
|
||||
affiliateInfo?: AffiliateInfo;
|
||||
selectedAsset?: Asset;
|
||||
onValidationPending: (swapQuote: MarketBuySwapQuote) => void;
|
||||
onValidationFail: (swapQuote: MarketBuySwapQuote, errorMessage: SwapQuoteConsumerError | ZeroExInstantError) => void;
|
||||
onValidationFail: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
errorMessage: SwapQuoteConsumerError | ZeroExInstantError,
|
||||
) => void;
|
||||
onSignatureDenied: (swapQuote: MarketBuySwapQuote) => void;
|
||||
onBuyProcessing: (swapQuote: MarketBuySwapQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => void;
|
||||
onBuyProcessing: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
txHash: string,
|
||||
startTimeUnix: number,
|
||||
expectedEndTimeUnix: number,
|
||||
) => void;
|
||||
onBuySuccess: (swapQuote: MarketBuySwapQuote, txHash: string) => void;
|
||||
onBuyFailure: (swapQuote: MarketBuySwapQuote, txHash: string) => void;
|
||||
}
|
||||
@ -59,7 +74,14 @@ export class BuyButton extends React.PureComponent<BuyButtonProps> {
|
||||
}
|
||||
private readonly _handleClick = async () => {
|
||||
// The button is disabled when there is no buy quote anyway.
|
||||
const { swapQuote, swapQuoteConsumer, affiliateInfo, accountAddress, accountEthBalanceInWei, web3Wrapper } = this.props;
|
||||
const {
|
||||
swapQuote,
|
||||
swapQuoteConsumer,
|
||||
affiliateInfo,
|
||||
accountAddress,
|
||||
accountEthBalanceInWei,
|
||||
web3Wrapper,
|
||||
} = this.props;
|
||||
if (swapQuote === undefined || accountAddress === undefined) {
|
||||
return;
|
||||
}
|
||||
|
@ -1,4 +1,10 @@
|
||||
import { MarketBuySwapQuote, SwapQuoteConsumer, SwapQuoter, SwapQuoterError, SwapQuoteConsumerError } from '@0x/asset-swapper';
|
||||
import {
|
||||
MarketBuySwapQuote,
|
||||
SwapQuoteConsumer,
|
||||
SwapQuoter,
|
||||
SwapQuoterError,
|
||||
SwapQuoteConsumerError,
|
||||
} from '@0x/asset-swapper';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as React from 'react';
|
||||
@ -25,9 +31,17 @@ export interface BuyOrderStateButtonProps {
|
||||
selectedAsset?: Asset;
|
||||
onViewTransaction: () => void;
|
||||
onValidationPending: (swapQuote: MarketBuySwapQuote) => void;
|
||||
onValidationFail: (swapQuote: MarketBuySwapQuote, errorMessage: SwapQuoteConsumerError | ZeroExInstantError) => void;
|
||||
onValidationFail: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
errorMessage: SwapQuoteConsumerError | ZeroExInstantError,
|
||||
) => void;
|
||||
onSignatureDenied: (swapQuote: MarketBuySwapQuote) => void;
|
||||
onBuyProcessing: (swapQuote: MarketBuySwapQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => void;
|
||||
onBuyProcessing: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
txHash: string,
|
||||
startTimeUnix: number,
|
||||
expectedEndTimeUnix: number,
|
||||
) => void;
|
||||
onBuySuccess: (swapQuote: MarketBuySwapQuote, txHash: string) => void;
|
||||
onBuyFailure: (swapQuote: MarketBuySwapQuote, txHash: string) => void;
|
||||
onRetry: () => void;
|
||||
|
@ -37,7 +37,7 @@ export class OrderDetails extends React.PureComponent<OrderDetailsProps> {
|
||||
);
|
||||
}
|
||||
|
||||
// TODO(dave4506) adjust fees for the new system (add affiliate fees)
|
||||
// TODO(dave4506) currently instant has affiliate fees disabled, until we resolve that, this displays only takerFees + protocolFees
|
||||
private _renderRows(): React.ReactNode {
|
||||
const { swapQuoteInfo } = this.props;
|
||||
return (
|
||||
@ -48,12 +48,16 @@ export class OrderDetails extends React.PureComponent<OrderDetailsProps> {
|
||||
/>
|
||||
<OrderDetailsRow
|
||||
labelText="Fee"
|
||||
primaryValue={this._displayAmountOrPlaceholder(swapQuoteInfo && swapQuoteInfo.feeTakerAssetAmount.plus(swapQuoteInfo.protocolFeeInEthAmount))}
|
||||
primaryValue={this._displayAmountOrPlaceholder(
|
||||
swapQuoteInfo && swapQuoteInfo.feeTakerAssetAmount.plus(swapQuoteInfo.protocolFeeInEthAmount),
|
||||
)}
|
||||
/>
|
||||
<OrderDetailsRow
|
||||
labelText="Total Cost"
|
||||
isLabelBold={true}
|
||||
primaryValue={this._displayAmountOrPlaceholder(swapQuoteInfo && swapQuoteInfo.totalTakerAssetAmount.plus(swapQuoteInfo.protocolFeeInEthAmount))}
|
||||
primaryValue={this._displayAmountOrPlaceholder(
|
||||
swapQuoteInfo && swapQuoteInfo.totalTakerAssetAmount.plus(swapQuoteInfo.protocolFeeInEthAmount),
|
||||
)}
|
||||
isPrimaryValueBold={true}
|
||||
secondaryValue={this._totalCostSecondaryValue()}
|
||||
/>
|
||||
@ -89,7 +93,10 @@ export class OrderDetails extends React.PureComponent<OrderDetailsProps> {
|
||||
(secondaryCurrency === BaseCurrency.USD && this.props.ethUsdPrice && !this._hadErrorFetchingUsdPrice());
|
||||
|
||||
if (this.props.swapQuoteInfo && canDisplayCurrency) {
|
||||
return this._displayAmount(secondaryCurrency, this.props.swapQuoteInfo.totalTakerAssetAmount.plus(this.props.swapQuoteInfo.protocolFeeInEthAmount));
|
||||
return this._displayAmount(
|
||||
secondaryCurrency,
|
||||
this.props.swapQuoteInfo.totalTakerAssetAmount.plus(this.props.swapQuoteInfo.protocolFeeInEthAmount),
|
||||
);
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
@ -84,7 +84,6 @@ export class ZeroExInstantProvider extends React.PureComponent<ZeroExInstantProv
|
||||
networkId,
|
||||
),
|
||||
assetMetaDataMap: completeAssetMetaDataMap,
|
||||
affiliateInfo: props.affiliateInfo,
|
||||
onSuccess: props.onSuccess,
|
||||
};
|
||||
return storeStateFromProps;
|
||||
@ -140,7 +139,7 @@ export class ZeroExInstantProvider extends React.PureComponent<ZeroExInstantProv
|
||||
state.providerState,
|
||||
window,
|
||||
state.selectedAsset,
|
||||
this.props.affiliateInfo,
|
||||
undefined,
|
||||
state.baseCurrency,
|
||||
),
|
||||
);
|
||||
|
@ -1,4 +1,10 @@
|
||||
import { MarketBuySwapQuote, SwapQuoteConsumer, SwapQuoteConsumerError, SwapQuoter, SwapQuoterError } from '@0x/asset-swapper';
|
||||
import {
|
||||
MarketBuySwapQuote,
|
||||
SwapQuoteConsumer,
|
||||
SwapQuoteConsumerError,
|
||||
SwapQuoter,
|
||||
SwapQuoterError,
|
||||
} from '@0x/asset-swapper';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as _ from 'lodash';
|
||||
@ -30,11 +36,19 @@ interface ConnectedState {
|
||||
interface ConnectedDispatch {
|
||||
onValidationPending: (swapQuote: MarketBuySwapQuote) => void;
|
||||
onSignatureDenied: (swapQuote: MarketBuySwapQuote) => void;
|
||||
onBuyProcessing: (swapQuote: MarketBuySwapQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => void;
|
||||
onBuyProcessing: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
txHash: string,
|
||||
startTimeUnix: number,
|
||||
expectedEndTimeUnix: number,
|
||||
) => void;
|
||||
onBuySuccess: (swapQuote: MarketBuySwapQuote, txHash: string) => void;
|
||||
onBuyFailure: (swapQuote: MarketBuySwapQuote, txHash: string) => void;
|
||||
onRetry: () => void;
|
||||
onValidationFail: (swapQuote: MarketBuySwapQuote, errorMessage: SwapQuoteConsumerError | ZeroExInstantError) => void;
|
||||
onValidationFail: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
errorMessage: SwapQuoteConsumerError | ZeroExInstantError,
|
||||
) => void;
|
||||
}
|
||||
export interface SelectedAssetBuyOrderStateButtons {}
|
||||
const mapStateToProps = (state: State, _ownProps: SelectedAssetBuyOrderStateButtons): ConnectedState => {
|
||||
@ -63,10 +77,7 @@ const mapStateToProps = (state: State, _ownProps: SelectedAssetBuyOrderStateButt
|
||||
state.swapOrderState.processState === OrderProcessState.Success ||
|
||||
state.swapOrderState.processState === OrderProcessState.Failure
|
||||
) {
|
||||
const etherscanUrl = etherscanUtil.getEtherScanTxnAddressIfExists(
|
||||
state.swapOrderState.txHash,
|
||||
chainId,
|
||||
);
|
||||
const etherscanUrl = etherscanUtil.getEtherScanTxnAddressIfExists(state.swapOrderState.txHash, chainId);
|
||||
if (etherscanUrl) {
|
||||
analytics.trackTransactionViewed(state.swapOrderState.processState);
|
||||
|
||||
@ -85,7 +96,12 @@ const mapDispatchToProps = (
|
||||
onValidationPending: (swapQuote: MarketBuySwapQuote) => {
|
||||
dispatch(actions.setSwapOrderStateValidating());
|
||||
},
|
||||
onBuyProcessing: (swapQuote: MarketBuySwapQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => {
|
||||
onBuyProcessing: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
txHash: string,
|
||||
startTimeUnix: number,
|
||||
expectedEndTimeUnix: number,
|
||||
) => {
|
||||
dispatch(actions.setSwapOrderStateProcessing(txHash, startTimeUnix, expectedEndTimeUnix));
|
||||
},
|
||||
onBuySuccess: (swapQuote: MarketBuySwapQuote, txHash: string) => dispatch(actions.setSwapOrderStateSuccess(txHash)),
|
||||
|
@ -29,11 +29,7 @@ interface ConnectedState {
|
||||
}
|
||||
|
||||
interface ConnectedDispatch {
|
||||
updateSwapQuote: (
|
||||
swapQuoter: SwapQuoter,
|
||||
value?: BigNumber,
|
||||
asset?: ERC20Asset,
|
||||
) => void;
|
||||
updateSwapQuote: (swapQuoter: SwapQuoter, value?: BigNumber, asset?: ERC20Asset) => void;
|
||||
}
|
||||
|
||||
type ConnectedProps = Omit<ERC20AssetAmountInputProps, keyof SelectedERC20AssetAmountInputProps>;
|
||||
|
@ -48,9 +48,10 @@ const validateInstantRenderConfig = (config: ZeroExInstantConfig, selector: stri
|
||||
if (config.zIndex !== undefined) {
|
||||
assert.isNumber('zIndex', config.zIndex);
|
||||
}
|
||||
if (config.affiliateInfo !== undefined) {
|
||||
assert.isValidAffiliateInfo('affiliateInfo', config.affiliateInfo);
|
||||
}
|
||||
// TODO(dave4506) reenable affiliate fees once we figure out how to work with it
|
||||
// if (config.affiliateInfo !== undefined) {
|
||||
// assert.isValidAffiliateInfo('affiliateInfo', config.affiliateInfo);
|
||||
// }
|
||||
if (config.provider !== undefined) {
|
||||
providerUtils.standardizeOrThrow(config.provider);
|
||||
}
|
||||
|
@ -59,7 +59,8 @@ export const actions = {
|
||||
createAction(ActionTypes.SetSwapOrderStateProcessing, { txHash, startTimeUnix, expectedEndTimeUnix }),
|
||||
setSwapOrderStateFailure: (txHash: string) => createAction(ActionTypes.SetSwapOrderStateFailure, txHash),
|
||||
setSwapOrderStateSuccess: (txHash: string) => createAction(ActionTypes.SetSwapOrderStateSuccess, txHash),
|
||||
updateLatestSwapQuote: (swapQuote?: MarketBuySwapQuote) => createAction(ActionTypes.UpdateLatestSwapQuote, swapQuote),
|
||||
updateLatestSwapQuote: (swapQuote?: MarketBuySwapQuote) =>
|
||||
createAction(ActionTypes.UpdateLatestSwapQuote, swapQuote),
|
||||
updateSelectedAsset: (asset: Asset) => createAction(ActionTypes.UpdateSelectedAsset, asset),
|
||||
setAvailableAssets: (availableAssets: Asset[]) => createAction(ActionTypes.SetAvailableAssets, availableAssets),
|
||||
setQuoteRequestStatePending: () => createAction(ActionTypes.SetQuoteRequestStatePending),
|
||||
|
@ -200,7 +200,6 @@ export interface ZeroExInstantOptionalBaseConfig {
|
||||
defaultSelectedAssetData: string;
|
||||
additionalAssetMetaDataMap: ObjectMap<AssetMetaData>;
|
||||
networkId: Network;
|
||||
affiliateInfo: AffiliateInfo;
|
||||
shouldDisableAnalyticsTracking: boolean;
|
||||
onSuccess?: (txHash: string) => void;
|
||||
}
|
||||
|
@ -85,13 +85,18 @@ function trackingEventFnWithPayload(eventName: EventNames): (eventProperties: Ev
|
||||
const swapQuoteEventProperties = (swapQuote: MarketBuySwapQuote) => {
|
||||
const makerAssetFillAmount = swapQuote.makerAssetFillAmount.toString();
|
||||
const assetEthAmount = swapQuote.worstCaseQuoteInfo.takerAssetAmount.toString();
|
||||
const feeEthAmount = swapQuote.worstCaseQuoteInfo.protocolFeeInEthAmount.plus(swapQuote.worstCaseQuoteInfo.feeTakerAssetAmount).toString();
|
||||
const totalEthAmount = swapQuote.worstCaseQuoteInfo.totalTakerAssetAmount.toString();
|
||||
const feeEthAmount = swapQuote.worstCaseQuoteInfo.protocolFeeInEthAmount
|
||||
.plus(swapQuote.worstCaseQuoteInfo.feeTakerAssetAmount)
|
||||
.toString();
|
||||
const totalEthAmount = swapQuote.worstCaseQuoteInfo.totalTakerAssetAmount
|
||||
.plus(swapQuote.worstCaseQuoteInfo.protocolFeeInEthAmount)
|
||||
.toString();
|
||||
return {
|
||||
makerAssetFillAmount,
|
||||
assetEthAmount,
|
||||
feeEthAmount,
|
||||
totalEthAmount,
|
||||
gasPrice: swapQuote.gasPrice,
|
||||
};
|
||||
};
|
||||
|
||||
@ -191,20 +196,35 @@ export const analytics = {
|
||||
...swapQuoteEventProperties(swapQuote),
|
||||
errorMessage,
|
||||
}),
|
||||
trackBuyTxSubmitted: (swapQuote: MarketBuySwapQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
|
||||
trackBuyTxSubmitted: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
txHash: string,
|
||||
startTimeUnix: number,
|
||||
expectedEndTimeUnix: number,
|
||||
) =>
|
||||
trackingEventFnWithPayload(EventNames.BuyTxSubmitted)({
|
||||
...swapQuoteEventProperties(swapQuote),
|
||||
txHash,
|
||||
expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
|
||||
}),
|
||||
trackBuyTxSucceeded: (swapQuote: MarketBuySwapQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
|
||||
trackBuyTxSucceeded: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
txHash: string,
|
||||
startTimeUnix: number,
|
||||
expectedEndTimeUnix: number,
|
||||
) =>
|
||||
trackingEventFnWithPayload(EventNames.BuyTxSucceeded)({
|
||||
...swapQuoteEventProperties(swapQuote),
|
||||
txHash,
|
||||
expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
|
||||
actualTxTimeMs: new Date().getTime() - startTimeUnix,
|
||||
}),
|
||||
trackBuyTxFailed: (swapQuote: MarketBuySwapQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
|
||||
trackBuyTxFailed: (
|
||||
swapQuote: MarketBuySwapQuote,
|
||||
txHash: string,
|
||||
startTimeUnix: number,
|
||||
expectedEndTimeUnix: number,
|
||||
) =>
|
||||
trackingEventFnWithPayload(EventNames.BuyTxFailed)({
|
||||
...swapQuoteEventProperties(swapQuote),
|
||||
txHash,
|
||||
|
@ -35,7 +35,6 @@ export const swapQuoteUpdater = {
|
||||
// mark quote as pending
|
||||
dispatch(actions.setQuoteRequestStatePending());
|
||||
}
|
||||
// TODO(dave4506) expose wethAssetData + feePercentage utils
|
||||
const wethAssetData = await swapQuoter.getEtherTokenAssetDataOrThrowAsync();
|
||||
let newSwapQuote: MarketBuySwapQuote | undefined;
|
||||
const slippagePercentage =
|
||||
@ -43,9 +42,14 @@ export const swapQuoteUpdater = {
|
||||
? ERC20_SWAP_QUOTE_SLIPPAGE_PERCENTAGE
|
||||
: ERC721_SWAP_QUOTE_SLIPPAGE_PERCENTAGE;
|
||||
try {
|
||||
newSwapQuote = await swapQuoter.getMarketBuySwapQuoteAsync(wethAssetData, asset.assetData, assetUnitAmount, {
|
||||
newSwapQuote = await swapQuoter.getMarketBuySwapQuoteAsync(
|
||||
wethAssetData,
|
||||
asset.assetData,
|
||||
assetUnitAmount,
|
||||
{
|
||||
slippagePercentage,
|
||||
});
|
||||
},
|
||||
);
|
||||
} catch (error) {
|
||||
const errorMessage = assetUtils.swapQuoterErrorMessage(asset, error);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user