-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
105 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/app/common/transactions/use-fee-estimations-capped-values.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { | ||
useConfigFeeEstimationsMaxEnabled, | ||
useConfigFeeEstimationsMaxValues, | ||
useConfigFeeEstimationsMinEnabled, | ||
useConfigFeeEstimationsMinValues, | ||
} from '@app/query/hiro-config/hiro-config.query'; | ||
|
||
const defaultFeeEstimationsMaxValues = [500000, 750000, 2000000]; | ||
const defaultFeeEstimationsMinValues = [2500, 3000, 3500]; | ||
|
||
export function useFeeEstimationsMaxValues() { | ||
// Get it first from the config | ||
const configFeeEstimationsMaxEnabled = useConfigFeeEstimationsMaxEnabled(); | ||
const configFeeEstimationsMaxValues = useConfigFeeEstimationsMaxValues(); | ||
// Only when the remote config file explicitly sets the maxValuesEnabled as false, we return no max cap for fees | ||
if (configFeeEstimationsMaxEnabled === false) return; | ||
return configFeeEstimationsMaxValues || defaultFeeEstimationsMaxValues; | ||
} | ||
|
||
export function useFeeEstimationsMinValues() { | ||
// Get it first from the config | ||
const configFeeEstimationsMinEnabled = useConfigFeeEstimationsMinEnabled(); | ||
const configFeeEstimationsMinValues = useConfigFeeEstimationsMinValues(); | ||
// Only when the remote config file explicitly sets the minValuesEnabled as false, we return no min cap for fees | ||
if (configFeeEstimationsMinEnabled === false) return; | ||
return configFeeEstimationsMinValues || defaultFeeEstimationsMinValues; | ||
} |
15 changes: 0 additions & 15 deletions
15
src/app/common/transactions/use-fee-estimations-max-values.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters