forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WALL] Rostislav / WALL-3069 / Use requests instead of subscriptions …
…for exchange rates in transfer messages and transfer inputs (deriv-com#12229) * refactor: the thing * refactor: a few corrections * refactor: rename `useExchangeRate` * refactor: move logic to context, different names * fix: param mismatch + refactor for insurance * refactor: move limits mgmt to context * fix: param
- Loading branch information
1 parent
9c79cff
commit 164b965
Showing
11 changed files
with
132 additions
and
105 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
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,15 @@ | ||
import useQuery from '../useQuery'; | ||
|
||
type TProps = Required<Parameters<typeof useQuery<'exchange_rates'>>[1]>['payload']; | ||
|
||
const useGetExchangeRate = ({ base_currency, loginid, target_currency }: TProps) => { | ||
const { data, ...rest } = useQuery('exchange_rates', { payload: { base_currency, loginid, target_currency } }); | ||
|
||
return { | ||
/** The exchange rates response */ | ||
data: data?.exchange_rates, | ||
...rest, | ||
}; | ||
}; | ||
|
||
export default useGetExchangeRate; |
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
Oops, something went wrong.