File tree 3 files changed +25
-16
lines changed 3 files changed +25
-16
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import { parseExternalBtcAmount } from '@/api/coins';
29
29
import { useLoad } from '@/hooks/api' ;
30
30
import { BitrefillTerms , localeMapping } from '@/components/terms/bitrefill-terms' ;
31
31
import { getBitrefillInfo } from '@/api/exchanges' ;
32
+ import { getURLOrigin } from '@/utils/url' ;
32
33
33
34
// Map coins supported by Bitrefill
34
35
const coinMapping : Readonly < Record < string , string > > = {
@@ -45,14 +46,6 @@ type TProps = {
45
46
code : AccountCode ;
46
47
} ;
47
48
48
- const getURLOrigin = ( uri : string ) : string | null => {
49
- try {
50
- return new URL ( uri ) . origin ;
51
- } catch ( e ) {
52
- return null ;
53
- }
54
- } ;
55
-
56
49
export const Bitrefill = ( { accounts, code } : TProps ) => {
57
50
const { t } = useTranslation ( ) ;
58
51
const { isDarkMode } = useDarkmode ( ) ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { useLoad } from '@/hooks/api';
24
24
import { useDarkmode } from '@/hooks/darkmode' ;
25
25
import { UseDisableBackButton } from '@/hooks/backbutton' ;
26
26
import { getConfig } from '@/utils/config' ;
27
+ import { getURLOrigin } from '@/utils/url' ;
27
28
import { Header } from '@/components/layout' ;
28
29
import { Spinner } from '@/components/spinner/Spinner' ;
29
30
import { findAccount , isBitcoinOnly } from '@/routes/account/utils' ;
@@ -45,14 +46,6 @@ type TProps = {
45
46
code : AccountCode ;
46
47
}
47
48
48
- const getURLOrigin = ( uri : string ) : string | null => {
49
- try {
50
- return new URL ( uri ) . origin ;
51
- } catch ( e ) {
52
- return null ;
53
- }
54
- } ;
55
-
56
49
export const BTCDirect = ( { accounts, code } : TProps ) => {
57
50
const { i18n, t } = useTranslation ( ) ;
58
51
const { isDevServers } = useContext ( AppContext ) ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright 2025 Shift Crypto AG
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export const getURLOrigin = ( uri : string ) : string | null => {
18
+ try {
19
+ return new URL ( uri ) . origin ;
20
+ } catch ( e ) {
21
+ return null ;
22
+ }
23
+ } ;
You can’t perform that action at this time.
0 commit comments