Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Ledger: fetch address activity and import ref #1093

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/allowed-url-prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const allowedUrlPrefixes = [
'https://api.blockcypher.com/v1/',
'https://api.fullstack.cash/v5/',
'https://deep-index.moralis.io/api/v2.2/',
'https://api.bitcore.io/api',
'https://api-eth.bitcore.io/api',
'https://api-matic.bitcore.io/api',
'https://api-xrp.bitcore.io/api',
].concat(developmentOnlyAllowedUrlPrefixes);

const allowedUrlPrefixString = allowedUrlPrefixes.join(',');
Expand Down
4 changes: 2 additions & 2 deletions src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ import InAppMessage from './components/modal/in-app-message/InAppMessage';
import SettingsGroup, {
SettingsGroupParamList,
} from './navigation/tabs/settings/SettingsGroup';
// import {ImportLedgerWalletModal} from './components/modal/import-ledger-wallet/ImportLedgerWalletModal';
import {ImportLedgerWalletModal} from './components/modal/import-ledger-wallet/ImportLedgerWalletModal';

// ROOT NAVIGATION CONFIG
export type RootStackParamList = {
Expand Down Expand Up @@ -578,7 +578,7 @@ export default () => {
<BlurContainer />
<PinModal />
<BiometricModal />
{/* <ImportLedgerWalletModal /> */}
<ImportLedgerWalletModal />
</NavigationContainer>
</ThemeProvider>
</SafeAreaProvider>
Expand Down
50 changes: 33 additions & 17 deletions src/components/list/WalletRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ import {
formatCurrencyAbbreviation,
getProtocolName,
} from '../../utils/helper-methods';
import {Platform} from 'react-native';
import {ActivityIndicator, Platform} from 'react-native';
import {ProgressBlue} from '../../styles/colors';

const SpinnerContainer = styled.View`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-right: 10px;
`;

const BadgeContainer = styled.View`
margin-left: 3px;
Expand Down Expand Up @@ -105,6 +114,7 @@ const WalletRow = ({wallet, hideIcon, onPress, isLast, hideBalance}: Props) => {
isToken,
network,
multisig,
isScanning,
} = wallet;

// @ts-ignore
Expand Down Expand Up @@ -143,22 +153,28 @@ const WalletRow = ({wallet, hideIcon, onPress, isLast, hideBalance}: Props) => {
{buildTestBadge(network, chain, isToken)}
</Row>
</CurrencyColumn>
<BalanceColumn>
{!hideBalance ? (
<>
<H5 numberOfLines={1} ellipsizeMode="tail">
{cryptoBalance}
</H5>
{showFiatBalance && (
<ListItemSubText textAlign={'right'}>
{network === 'testnet' ? 'Test - No Value' : fiatBalance}
</ListItemSubText>
)}
</>
) : (
<H5>****</H5>
)}
</BalanceColumn>
{!isScanning ? (
<BalanceColumn>
{!hideBalance ? (
<>
<H5 numberOfLines={1} ellipsizeMode="tail">
{cryptoBalance}
</H5>
{showFiatBalance && (
<ListItemSubText textAlign={'right'}>
{network === 'testnet' ? 'Test - No Value' : fiatBalance}
</ListItemSubText>
)}
</>
) : (
<H5>****</H5>
)}
</BalanceColumn>
) : (
<SpinnerContainer>
<ActivityIndicator color={ProgressBlue} />
</SpinnerContainer>
)}
</RowContainer>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export const OpenApp: React.FC<{
<IconRow>
<IconWrapper>
{props.connectionMethod === 'ble' ? (
<BluetoothIconSvg height={40} width={40} />
<BluetoothIconSvg height={60} width={60} />
) : props.connectionMethod === 'hid' ? (
<UsbIconSvg height={40} width={40} />
<UsbIconSvg height={60} width={60} />
) : (
<LedgerLogoIconSvg height={40} width={40} />
<LedgerLogoIconSvg height={60} width={60} />
)}
</IconWrapper>
</IconRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export const ConfirmLedgerSending: React.FC<Props> = props => {
<IconRow>
<IconWrapper>
{props.connectionMethod === 'ble' ? (
<BluetoothIconSvg height={40} width={40} />
<BluetoothIconSvg height={60} width={60} />
) : props.connectionMethod === 'hid' ? (
<UsbIconSvg height={40} width={40} />
<UsbIconSvg height={60} width={60} />
) : (
<LedgerLogoIconSvg height={40} width={40} />
<LedgerLogoIconSvg height={60} width={60} />
)}
</IconWrapper>
</IconRow>
Expand Down
7 changes: 4 additions & 3 deletions src/components/modal/confirm-hardware-wallet/ledger/Start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
Wrapper,
} from '../../import-ledger-wallet/import-ledger-wallet.styled';
import {checkPermissionsBLE} from '../../import-ledger-wallet/utils';
import {Warning25} from '../../../../styles/colors';
import {Warning75, White} from '../../../../styles/colors';
import {SearchingForDevices} from '../../import-ledger-wallet/pair-device/SearchingForDevices';
import {sleep} from '../../../../utils/helper-methods';

Expand All @@ -37,7 +37,8 @@ const IconWrapper = styled.View`
`;

const ErrParagraph = styled(Paragraph)`
background-color: ${Warning25};
background-color: ${Warning75};
color: ${White};
border-radius: 12px;
padding: 20px;
`;
Expand Down Expand Up @@ -157,7 +158,7 @@ export const ConfirmLedgerStart: React.FC<
<Wrapper>
<Header>
<IconWrapper>
<LedgerLogoIconSvg height={40} width={40} />
<LedgerLogoIconSvg height={60} width={60} />
</IconWrapper>

<H3>Approve on your Ledger</H3>
Expand Down
Loading