51 | {loading ? (
52 |
53 | ) : (
54 | <>
55 |
56 | {Object.keys(tabs).map((tab) => (
57 | setActiveTab(tab as AddressType)}
63 | />
64 | ))}
65 |
66 | {activeTab === AddressType.UNIFIED && (
67 |
68 | )}
69 | {activeTab === AddressType.TRANSPARENT && (
70 |
71 | )}
72 | >
73 | )}
74 |
75 | >
76 | );
77 | }
78 |
79 | export default Receive;
80 |
--------------------------------------------------------------------------------
/packages/web-wallet/src/context/MetamaskContext.tsx:
--------------------------------------------------------------------------------
1 | import type { MetaMaskInpageProvider } from '@metamask/providers';
2 | import type { ReactNode } from 'react';
3 | import { createContext, useContext, useEffect, useState } from 'react';
4 |
5 | import type { Snap } from '../types';
6 | import { getSnapsProvider } from '../utils';
7 | import { SnapState } from 'src/hooks/snaps/useGetSnapState';
8 |
9 | type MetaMaskContextType = {
10 | provider: MetaMaskInpageProvider | null;
11 | installedSnap: Snap | null;
12 | error: Error | null;
13 | snapState: SnapState | null;
14 | setSnapState: (SnapState: SnapState) => void;
15 | setInstalledSnap: (snap: Snap | null) => void;
16 | setError: (error: Error) => void;
17 | };
18 |
19 | const MetaMaskContext = createContext