Skip to content

Commit

Permalink
refactor: reuse AverageBitcoinFeeRates interface
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Jan 24, 2024
1 parent 6950539 commit 8cce77c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import BigNumber from 'bignumber.js';

import { AverageBitcoinFeeRates } from '@shared/models/fees/bitcoin-fees.model';
import { createMoney } from '@shared/models/money.model';

import { satToBtc } from '@app/common/money/unit-conversion';
import { UtxoResponseItem } from '@app/query/bitcoin/bitcoin-client';
import { AverageBitcoinFeeRatesData } from '@app/query/bitcoin/fees/fee-estimates.hooks';

import { filterUneconomicalUtxos, getSpendableAmount } from '../utils';

interface CalculateMaxBitcoinSpend {
address: string;
utxos: UtxoResponseItem[];
fetchedFeeRates: AverageBitcoinFeeRatesData;
fetchedFeeRates?: AverageBitcoinFeeRates;
feeRate?: number;
}

Expand Down
10 changes: 0 additions & 10 deletions src/app/query/bitcoin/fees/fee-estimates.hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import BigNumber from 'bignumber.js';

import { logger } from '@shared/logger';

import { useAnalytics } from '@app/common/hooks/analytics/use-analytics';
Expand All @@ -9,14 +7,6 @@ import { isFulfilled, isRejected } from '@app/common/utils';

import { useGetAllBitcoinFeeEstimatesQuery } from './fee-estimates.query';

export type AverageBitcoinFeeRatesData =
| {
fastestFee: BigNumber;
halfHourFee: BigNumber;
hourFee: BigNumber;
}
| undefined;

export function useAverageBitcoinFeeRates() {
const analytics = useAnalytics();
return useGetAllBitcoinFeeEstimatesQuery({
Expand Down

0 comments on commit 8cce77c

Please sign in to comment.