Skip to content
Closed
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
10 changes: 10 additions & 0 deletions flows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This directory contains end-to-end UI automation flows for the Keeper app using Maestro.

## USDT Settings route smoke check

`usdt-settings-routes.yaml` starts on Home in an authenticated, disposable development app on TESTNET. It checks Settings > Keys & Wallets > Add USDT Wallet, opens the creation form and the seed import form, and returns without submitting either form. It does not create wallets or make transaction, recovery or backup requests.

```bash
maestro --udid <disposable-device-id> test flows/usdt-settings-routes.yaml
```

The default app ID is `io.hexawallet.hexakeeper.dev`; override it with `-e APP_ID=<installed-development-app-id>` when testing a different development package. Do not run against a funded/customer profile. Production USDT entry uses MAINNET; this smoke flow is intended for the development TESTNET fixture.

## Instructions

Use these flows to validate onboarding, wallet, RGB assets, settings, backup, and recovery journeys on development builds.
Expand Down
43 changes: 43 additions & 0 deletions flows/usdt-settings-routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
appId: ${APP_ID}
env:
APP_ID: io.hexawallet.hexakeeper.dev
---
# Start with an authenticated disposable development/testnet app on Home.
# This check never submits a wallet, seed, send or backup request.
- runFlow:
when:
visible: "Protect Your Recovery Key"
commands:
- tapOn: "Skip for Now"
- extendedWaitUntil:
visible: "Skip Backup"
timeout: 20000
- tapOn: "Skip Backup"
- assertVisible: "More"
- tapOn: "More"
- scrollUntilVisible:
element:
id: "btn_setting_Add USDT Wallet"
direction: DOWN
timeout: 20000
- tapOn:
id: "btn_setting_Add USDT Wallet"
- assertVisible: ".*Create a new USDT wallet.*"
- assertVisible: ".*Import Wallet.*"
- tapOn: ".*Create a new USDT wallet.*"
- extendedWaitUntil:
visible: "Add Your Wallet Details"
timeout: 20000
- assertVisible: "Enter wallet name"
- assertVisible: "Create Your Wallet"
- tapOn:
id: btn_back
- tapOn:
id: "btn_setting_Add USDT Wallet"
- tapOn: ".*Import Wallet.*"
- extendedWaitUntil:
visible: "Enter Seed Words"
timeout: 20000
- assertVisible: "Next"
- tapOn:
id: btn_back
18 changes: 18 additions & 0 deletions openspec/specs/settings/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ Settings grouping should separate:

## Requirements

### Requirement: USDT wallet creation entry point

Settings > Keys & Wallets MUST show "Add USDT Wallet" when the active Bitcoin network matches `USDTWalletSupportedNetwork` (testnet in development mode, mainnet otherwise). It MUST open the existing USDT create/import choice. On the unsupported network, the entry point MUST be absent. Moving this entry point MUST NOT remove existing USDT wallets or change their send, receive, GasFree, backup, or management behavior.

#### Scenario: Open USDT wallet creation from Settings

- GIVEN the user is on `USDTWalletSupportedNetwork`
- WHEN the user opens Settings > Keys & Wallets and taps "Add USDT Wallet"
- THEN the user can choose "Create Wallet" or "Import Wallet"

#### Scenario: USDT creation unavailable on the unsupported network

- GIVEN the active network differs from `USDTWalletSupportedNetwork`
- WHEN the user opens Settings > Keys & Wallets
- THEN "Add USDT Wallet" is not shown

---

### Requirement: Node Configuration

The app MUST allow the user to add, connect, disconnect, and delete custom Electrum
Expand Down
29 changes: 18 additions & 11 deletions openspec/specs/usdt/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,26 @@ visually and functionally distinct from all Bitcoin and multi-key entities.

### Requirement: USDT Wallet Availability

The app MUST only offer USDT wallet creation and import when the active Bitcoin network is mainnet. On testnet the USDT wallet option MUST NOT be shown in the wallet-type picker.
The app MUST offer USDT wallet creation and import from Settings > Keys & Wallets only when the active Bitcoin network matches `USDTWalletSupportedNetwork` (testnet in development mode, mainnet otherwise). The home Add Wallet control and onboarding MUST lead to Bitcoin wallet flows without a currency picker. Moving this entry point MUST NOT delete or migrate existing USDT wallets.

#### Scenario: USDT option shown on mainnet (happy path)
#### Scenario: USDT entry point shown on the supported network (happy path)

- GIVEN the user is authenticated and the app is configured for mainnet
- WHEN the user taps the "Add Wallet" control on the home screen
- THEN a currency-type picker appears offering both a Bitcoin wallet option and a USDT (Dollar) wallet option
- GIVEN the user is authenticated and the active network matches `USDTWalletSupportedNetwork`
- WHEN the user opens Settings > Keys & Wallets
- THEN an "Add USDT Wallet" item opens a choice to create or import a USDT wallet

#### Scenario: USDT option hidden on testnet
#### Scenario: USDT entry point hidden on the unsupported network

- GIVEN the user is authenticated and the app is configured for testnet
- WHEN the user taps the "Add Wallet" control on the home screen
- THEN the currency-type picker shows only the Bitcoin wallet option and the USDT wallet option is absent
- GIVEN the user is authenticated and the active network differs from `USDTWalletSupportedNetwork`
- WHEN the user opens Settings > Keys & Wallets
- THEN the "Add USDT Wallet" item is absent

#### Scenario: Add Wallet remains Bitcoin focused

- GIVEN the user is on the home screen on either network
- WHEN the user taps "Add Wallet"
- THEN the Bitcoin wallet create, import, and collaborative wallet choices appear directly
- AND no USDT choice appears in that flow

---

Expand All @@ -42,7 +49,7 @@ The app MUST allow the user to create a new USDT wallet by supplying a name and

#### Scenario: Create a new USDT wallet (happy path)

- GIVEN the user selects the USDT wallet option and then "Create wallet" from the wallet-type picker
- GIVEN the user opens "Add USDT Wallet" in Settings and selects "Create Wallet"
- WHEN the user enters a valid wallet name (up to 18 characters) and optionally a description, then confirms
- THEN a new USDT wallet is created and appears in the home-screen wallet list
- AND the wallet's creation is persisted to the relay server as part of the app image backup
Expand All @@ -67,7 +74,7 @@ The app MUST allow the user to import an existing USDT wallet by providing its B

#### Scenario: Import a USDT wallet via mnemonic (happy path)

- GIVEN the user selects the USDT wallet option and then "Import wallet" from the wallet-type picker
- GIVEN the user opens "Add USDT Wallet" in Settings and selects "Import Wallet"
- WHEN the user enters the correct seed phrase for an existing USDT wallet
- THEN the wallet is imported and appears in the home-screen wallet list with its corresponding Tron address

Expand Down
14 changes: 7 additions & 7 deletions openspec/specs/wallets/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,19 @@ A watch-only or zero-balance wallet that is hidden MUST be deletable from the wa

### Requirement: USDT Wallet Distinction

The app MUST distinguish USDT wallets from Bitcoin wallets at every level of the interface. USDT wallets MUST NOT appear in the Bitcoin wallet list on the home screen and MUST be accessible from a dedicated USDT section.
The app MUST distinguish USDT wallets from Bitcoin wallets at every level of the interface. Existing visible USDT wallets MUST remain in the unified home wallet list with a distinct USDT identity. Their creation and import entry point is in Settings > Keys & Wallets.

#### Scenario: USDT wallet absent from Bitcoin home list
#### Scenario: USDT wallet remains visible on home

- GIVEN the user has both a Bitcoin wallet and a USDT wallet
- WHEN the user views the main home screen wallet list
- THEN the USDT wallet does not appear alongside Bitcoin wallets
- THEN the USDT wallet appears alongside Bitcoin wallets with a distinct USDT identifier and balance unit

#### Scenario: USDT wallet accessible from dedicated section
#### Scenario: USDT wallet detail remains accessible

- GIVEN the user has a USDT wallet
- WHEN the user navigates to the USDT section of the home screen
- THEN the USDT wallet is listed there with its balance and transaction history
- WHEN the user taps the USDT wallet card on the home screen
- THEN the USDT wallet detail opens with its balance and transaction history

---

Expand All @@ -334,7 +334,7 @@ The app MUST distinguish USDT wallets from Bitcoin wallets at every level of the
- Watch-only wallet shows: "This wallet can show balances and transactions, but cannot send bitcoin."
- Buy, Sell, Swap, Acquire entry points are absent from wallet creation and management.
- No subscription/tier gating.
- USDT wallets are in a distinct section (not the Bitcoin wallet list).
- Existing USDT wallets remain visible in the unified home wallet list with distinct USDT identity.

---

Expand Down
3 changes: 2 additions & 1 deletion src/context/Localization/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@
"restoreExistingWallet": "Restore an existing wallet",
"walletWithFamily": "Create wallet with family and friends",
"addNewWallet": "Add a New Wallet",
"AddUSDTWallet": "Add USDT Wallet",
"createOrImportWallet": "Create a new wallet or import existing one",
"collaborativeSessionExists": "Collaborative wallet setup session already exists",
"collaborativeSessionExistsDesc": "You already have a collaborative wallet setup session in progress, would you like to continue the session or start a new one?",
Expand Down Expand Up @@ -2218,4 +2219,4 @@
"disclaimerLearnMore": "Learn more about Ask Keeper",
"disclaimerCta": "Got it"
}
}
}
3 changes: 2 additions & 1 deletion src/context/Localization/language/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@
"restoreExistingWallet": "Restore an existing wallet",
"walletWithFamily": "Create wallet with family and friends",
"addNewWallet": "Add a New Wallet",
"AddUSDTWallet": "Add USDT Wallet",
"createOrImportWallet": "Create a new wallet or import existing one",
"collaborativeSessionExists": "Collaborative wallet setup session already exists",
"collaborativeSessionExistsDesc": "You already have a collaborative wallet setup session in progress, would you like to continue the session or start a new one?",
Expand Down Expand Up @@ -2199,4 +2200,4 @@
"disclaimerLearnMore": "Learn more about Ask Keeper",
"disclaimerCta": "Got it"
}
}
}
128 changes: 128 additions & 0 deletions src/screens/Home/components/Settings/USDTWalletCreationModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import { Box, useColorMode } from '@gluestack-ui/themed-native-base';
import { CommonActions, useNavigation } from '@react-navigation/native';
import React, { useContext } from 'react';
import { StyleSheet, TouchableOpacity } from 'react-native';
import ImportWalletIcon from 'src/assets/images/import.svg';
import NewWalletIcon from 'src/assets/images/wallet-white-small.svg';
import TickIcon from 'src/assets/images/icon_tick.svg';
import ToastErrorIcon from 'src/assets/images/toast_error.svg';
import CircleIconWrapper from 'src/components/CircleIconWrapper';
import KeeperModal from 'src/components/KeeperModal';
import Text from 'src/components/KeeperText';
import { hp, wp } from 'src/constants/responsive';
import { LocalizationContext } from 'src/context/Localization/LocContext';
import useToastMessage from 'src/hooks/useToastMessage';
import { useUSDTWallets } from 'src/hooks/useUSDTWallets';
import { USDTWalletType } from 'src/services/wallets/factories/USDTWalletFactory';

const USDTWalletCreationModal = ({ visible, close }: { visible: boolean; close: () => void }) => {
const { colorMode } = useColorMode();
const navigation = useNavigation();
const { translations } = useContext(LocalizationContext);
const { wallet: walletText, home } = translations;
const { createWallet } = useUSDTWallets();
const { showToast } = useToastMessage();

const importUSDTWallet = async (mnemonic) => {
try {
const { newWallet, error } = await createWallet({
type: USDTWalletType.IMPORTED,
name: 'USDT Wallet',
description: 'Imported USDT Wallet',
importDetails: { mnemonic },
});

if (!newWallet) throw new Error(error);

showToast('USDT wallet imported successfully!', <TickIcon />);
setTimeout(() => {
navigation.dispatch(
CommonActions.navigate({ name: 'Home', params: { selectedOption: 'Wallets' } })
);
}, 900);
} catch (err) {
showToast(`Failed to import USDT wallet: ${err.message}`, <ToastErrorIcon />);
}
};

const options = [
{
title: walletText.createWallet,
subtitle: 'Create a new USDT wallet',
icon: <NewWalletIcon />,
onPress: () => {
close();
navigation.dispatch(CommonActions.navigate('addUsdtWallet'));
},
},
{
title: home.ImportWallet,
subtitle: walletText.restoreExistingWallet,
icon: <ImportWalletIcon />,
onPress: () => {
close();
navigation.dispatch(
CommonActions.navigate({
name: 'EnterSeedScreen',
params: { isImport: true, isUSDTWallet: true, importSeedCta: importUSDTWallet },
})
);
},
},
];

return (
<KeeperModal
visible={visible}
title={walletText.AddUSDTWallet}
subTitle={walletText.createOrImportWallet}
close={close}
textColor={`${colorMode}.textGreen`}
subTitleColor={`${colorMode}.modalSubtitleBlack`}
showCloseIcon
Content={() => (
<Box style={styles.optionsList}>
{options.map((option) => (
<TouchableOpacity key={option.title} onPress={option.onPress}>
<Box
style={styles.option}
backgroundColor={`${colorMode}.boxSecondaryBackground`}
borderColor={`${colorMode}.separator`}
>
<CircleIconWrapper
width={wp(40)}
icon={option.icon}
backgroundColor={`${colorMode}.pantoneGreen`}
/>
<Box style={styles.optionText}>
<Text color={`${colorMode}.secondaryText`} fontSize={15} medium>
{option.title}
</Text>
<Text color={`${colorMode}.secondaryText`} fontSize={12}>
{option.subtitle}
</Text>
</Box>
</Box>
</TouchableOpacity>
))}
</Box>
)}
/>
);
};

export default USDTWalletCreationModal;

const styles = StyleSheet.create({
optionsList: { gap: wp(15), marginBottom: hp(10) },
option: {
flexDirection: 'row',
paddingHorizontal: wp(15),
paddingVertical: hp(22),
alignItems: 'center',
gap: wp(16),
borderRadius: 12,
borderWidth: 1,
},
optionText: { flex: 1, flexShrink: 1 },
});
Loading
Loading