vega-frontend-monorepo/libs/deal-ticket/src/hooks/estimate-order.mock.ts
Bartłomiej Głownia 4c95db5fb3
feat(deal-ticket): calculate fees and discount base on volumeDiscountStats and referralSetStats (#5147)
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
2023-10-30 18:13:26 -07:00

31 lines
730 B
TypeScript

import type { PartialDeep } from 'type-fest';
import merge from 'lodash/merge';
import type { EstimateFeesQuery } from './__generated__/EstimateOrder';
export const estimateFeesQuery = (
override?: PartialDeep<EstimateFeesQuery>
): EstimateFeesQuery => {
const defaultResult: EstimateFeesQuery = {
epoch: {
id: '1',
},
referralSetStats: {
edges: [],
},
volumeDiscountStats: {
edges: [],
},
estimateFees: {
__typename: 'FeeEstimate',
totalFeeAmount: '0.0006',
fees: {
__typename: 'TradeFee',
makerFee: '100000',
infrastructureFee: '100000',
liquidityFee: '100000',
},
},
};
return merge(defaultResult, override);
};