MCPcopy
hub / github.com/BlueWallet/BlueWallet / DevMenu

Function DevMenu

components/DevMenu.tsx:72–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70};
71
72const DevMenu: React.FC = () => {
73 const { wallets, addWallet } = useStorage();
74
75 useEffect(() => {
76 if (__DEV__) {
77 // Clear existing Dev Menu items to prevent duplication
78 DevSettings.addMenuItem('Reset Dev Menu', () => {
79 DevSettings.reload();
80 });
81
82 DevSettings.addMenuItem('Add New Wallet', async () => {
83 const wallet = new HDSegwitBech32Wallet();
84 await wallet.generate();
85 const label = getRandomLabelFromSecret(wallet.getSecret());
86 wallet.setLabel(label);
87 addWallet(wallet);
88
89 Clipboard.setString(wallet.getSecret());
90 Alert.alert('New Wallet created!', `Wallet secret copied to clipboard.\nLabel: ${label}`);
91 });
92
93 DevSettings.addMenuItem('Copy Wallet Secret', () => {
94 if (wallets.length === 0) {
95 Alert.alert('No wallets available');
96 return;
97 }
98
99 showAlertWithWalletOptions(wallets, 'Copy Wallet Secret', 'Select the wallet to copy the secret', wallet => {
100 Clipboard.setString(wallet.getSecret());
101 Alert.alert('Wallet Secret copied to clipboard!');
102 });
103 });
104
105 DevSettings.addMenuItem('Copy Wallet ID', () => {
106 if (wallets.length === 0) {
107 Alert.alert('No wallets available');
108 return;
109 }
110
111 showAlertWithWalletOptions(wallets, 'Copy Wallet ID', 'Select the wallet to copy the ID', wallet => {
112 Clipboard.setString(wallet.getID());
113 Alert.alert('Wallet ID copied to clipboard!');
114 });
115 });
116
117 DevSettings.addMenuItem('Copy Wallet Xpub', () => {
118 if (wallets.length === 0) {
119 Alert.alert('No wallets available');
120 return;
121 }
122
123 showAlertWithWalletOptions(
124 wallets,
125 'Copy Wallet Xpub',
126 'Select the wallet to copy the Xpub',
127 wallet => {
128 const xpub = wallet.getXpub();
129 if (xpub) {

Callers

nothing calls this directly

Calls 8

useStorageFunction · 0.90
getRandomLabelFromSecretFunction · 0.85
setLabelMethod · 0.80
generateMethod · 0.45
getSecretMethod · 0.45
getIDMethod · 0.45
getXpubMethod · 0.45

Tested by

no test coverage detected