Skip to content

Commit

Permalink
feat(HW-780): TRON support for scan QR codes (#2180)
Browse files Browse the repository at this point in the history
* feat(HW-780): Updated QR scanner address validation

* feat(HW-780): Read tron address when deeplink checked

* feat(HW-780): Handle deeplinks with haqq://
  • Loading branch information
devkudasov authored Nov 1, 2024
1 parent d2026c0 commit c571793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/qr-scanner-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const QrScannerButton = () => {

const onPressQR = useCallback(() => {
const subscription = ({from, to}: any) => {
if (AddressUtils.isEthAddress(to)) {
if (AddressUtils.isValidAddress(to)) {
app.off('address', subscription);
hideModal(ModalType.qr);
navigation.navigate('transaction', {to, from});
Expand Down
16 changes: 8 additions & 8 deletions src/event-actions/on-deep-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export async function onDeepLink(
return false;
}

if (AddressUtils.isEthAddress(link)) {
await handleAddress(link, withoutFromAddress);
if (AddressUtils.isHaqqAddress(link)) {
await handleAddress(AddressUtils.toEth(link), withoutFromAddress);
return true;
}

if (AddressUtils.isHaqqAddress(link)) {
await handleAddress(AddressUtils.toEth(link), withoutFromAddress);
if (AddressUtils.isValidAddress(link)) {
await handleAddress(link, withoutFromAddress);
return true;
}

Expand Down Expand Up @@ -101,13 +101,13 @@ export async function onDeepLink(
':',
);

if (AddressUtils.isEthAddress(key)) {
await handleAddress(key, withoutFromAddress);
if (AddressUtils.isHaqqAddress(link)) {
await handleAddress(AddressUtils.toEth(link), withoutFromAddress);
return true;
}

if (AddressUtils.isHaqqAddress(key)) {
await handleAddress(AddressUtils.toEth(key), withoutFromAddress);
if (AddressUtils.isValidAddress(link)) {
await handleAddress(link, withoutFromAddress);
return true;
}

Expand Down

0 comments on commit c571793

Please sign in to comment.