-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathindex.ts
More file actions
18 lines (16 loc) · 667 Bytes
/
index.ts
File metadata and controls
18 lines (16 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { useMemo } from 'react';
import { useSelector } from 'react-redux';
import { selectSourceWalletAddress } from '../../../../../selectors/bridge';
import { isHardwareAccount } from '../../../../../util/address';
/**
* Returns whether the current bridge source account is a hardware wallet.
* Used to omit gas-included / 7702 params from bridge quote requests so responses
* are non-sponsored for hardware signers.
*/
export function useIsHardwareWalletForBridge(): boolean {
const walletAddress = useSelector(selectSourceWalletAddress);
return useMemo(
() => Boolean(walletAddress && isHardwareAccount(walletAddress)),
[walletAddress],
);
}