@reown/appkit-react-native 0.0.0-feat-multi-social-20250703185818 → 0.0.0-feat-multi-social-20250710154055
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/AppKit.js +50 -16
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/AppKitContext.js +2 -1
- package/lib/commonjs/AppKitContext.js.map +1 -1
- package/lib/commonjs/client.js +15 -24
- package/lib/commonjs/client.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +4 -2
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/modal/w3m-router/index.js +0 -9
- package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-tokens/index.js +11 -4
- package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js +5 -2
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +4 -3
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +0 -3
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/index.js +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +22 -23
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/index.js +11 -6
- package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/index.js +10 -11
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/connectors-list.js +47 -32
- package/lib/commonjs/views/w3m-connect-view/components/connectors-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +12 -21
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js +20 -15
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-network-switch-view/index.js +13 -19
- package/lib/commonjs/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-transaction-view/index.js +1 -1
- package/lib/commonjs/views/w3m-onramp-transaction-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-select-token-view/utils.js +4 -1
- package/lib/commonjs/views/w3m-swap-select-token-view/utils.js.map +1 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js +7 -20
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-upgrade-email-wallet-view/index.js +3 -8
- package/lib/commonjs/views/w3m-upgrade-email-wallet-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js +2 -2
- package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js +3 -3
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js +1 -1
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/module/AppKit.js +50 -16
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/AppKitContext.js +2 -1
- package/lib/module/AppKitContext.js.map +1 -1
- package/lib/module/client.js +17 -26
- package/lib/module/client.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +4 -2
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/modal/w3m-router/index.js +0 -9
- package/lib/module/modal/w3m-router/index.js.map +1 -1
- package/lib/module/partials/w3m-account-tokens/index.js +12 -5
- package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js +5 -2
- package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/index.js +5 -4
- package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +0 -3
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/index.js +1 -1
- package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +22 -23
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/index.js +12 -7
- package/lib/module/views/w3m-account-view/index.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/index.js +11 -12
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/connectors-list.js +47 -32
- package/lib/module/views/w3m-connect-view/components/connectors-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +13 -22
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js +22 -16
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-network-switch-view/index.js +14 -19
- package/lib/module/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-transaction-view/index.js +2 -2
- package/lib/module/views/w3m-onramp-transaction-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-select-token-view/utils.js +4 -1
- package/lib/module/views/w3m-swap-select-token-view/utils.js.map +1 -1
- package/lib/module/views/w3m-unsupported-chain-view/index.js +8 -21
- package/lib/module/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/module/views/w3m-upgrade-email-wallet-view/index.js +3 -8
- package/lib/module/views/w3m-upgrade-email-wallet-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js +2 -2
- package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js +4 -4
- package/lib/module/views/w3m-wallet-send-preview-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js +1 -1
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +4 -1
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/AppKitContext.d.ts +1 -0
- package/lib/typescript/AppKitContext.d.ts.map +1 -1
- package/lib/typescript/client.d.ts +1 -6
- package/lib/typescript/client.d.ts.map +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
- package/lib/typescript/hooks/useAppKitEvents.d.ts +1 -1
- package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-tokens/index.d.ts +2 -1
- package/lib/typescript/partials/w3m-account-tokens/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts +2 -2
- package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-default-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/connectors-list.d.ts +1 -7
- package/lib/typescript/views/w3m-connect-view/components/connectors-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-external-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-network-switch-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-select-token-view/utils.d.ts +1 -1
- package/lib/typescript/views/w3m-swap-select-token-view/utils.d.ts.map +1 -1
- package/lib/typescript/views/w3m-unsupported-chain-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-upgrade-email-wallet-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-preview-view/components/preview-send-details.d.ts +3 -3
- package/lib/typescript/views/w3m-wallet-send-preview-view/components/preview-send-details.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +78 -39
- package/src/AppKitContext.tsx +2 -1
- package/src/client.ts +12 -41
- package/src/connectors/WalletConnectConnector.ts +5 -3
- package/src/modal/w3m-router/index.tsx +0 -9
- package/src/partials/w3m-account-tokens/index.tsx +26 -18
- package/src/partials/w3m-account-wallet-features/index.tsx +5 -3
- package/src/partials/w3m-connecting-qrcode/index.tsx +3 -4
- package/src/partials/w3m-header/index.tsx +0 -3
- package/src/partials/w3m-send-input-token/index.tsx +2 -2
- package/src/views/w3m-account-default-view/index.tsx +20 -23
- package/src/views/w3m-account-view/index.tsx +11 -8
- package/src/views/w3m-all-wallets-view/index.tsx +7 -7
- package/src/views/w3m-connect-view/components/connectors-list.tsx +40 -38
- package/src/views/w3m-connect-view/index.tsx +9 -18
- package/src/views/w3m-connecting-external-view/index.tsx +16 -16
- package/src/views/w3m-network-switch-view/index.tsx +12 -24
- package/src/views/w3m-onramp-transaction-view/index.tsx +2 -2
- package/src/views/w3m-swap-select-token-view/utils.ts +6 -2
- package/src/views/w3m-unsupported-chain-view/index.tsx +8 -30
- package/src/views/w3m-upgrade-email-wallet-view/index.tsx +3 -7
- package/src/views/w3m-wallet-send-preview-view/components/preview-send-details.tsx +4 -4
- package/src/views/w3m-wallet-send-preview-view/index.tsx +3 -3
- package/src/views/w3m-wallet-send-select-token-view/index.tsx +1 -1
- package/lib/commonjs/views/w3m-update-email-primary-otp-view/index.js +0 -56
- package/lib/commonjs/views/w3m-update-email-primary-otp-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-update-email-secondary-otp-view/index.js +0 -62
- package/lib/commonjs/views/w3m-update-email-secondary-otp-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-update-email-wallet-view/index.js +0 -104
- package/lib/commonjs/views/w3m-update-email-wallet-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-update-email-wallet-view/styles.js +0 -30
- package/lib/commonjs/views/w3m-update-email-wallet-view/styles.js.map +0 -1
- package/lib/module/views/w3m-update-email-primary-otp-view/index.js +0 -50
- package/lib/module/views/w3m-update-email-primary-otp-view/index.js.map +0 -1
- package/lib/module/views/w3m-update-email-secondary-otp-view/index.js +0 -56
- package/lib/module/views/w3m-update-email-secondary-otp-view/index.js.map +0 -1
- package/lib/module/views/w3m-update-email-wallet-view/index.js +0 -97
- package/lib/module/views/w3m-update-email-wallet-view/index.js.map +0 -1
- package/lib/module/views/w3m-update-email-wallet-view/styles.js +0 -24
- package/lib/module/views/w3m-update-email-wallet-view/styles.js.map +0 -1
- package/lib/typescript/views/w3m-update-email-primary-otp-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-update-email-primary-otp-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-update-email-secondary-otp-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-update-email-secondary-otp-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-update-email-wallet-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-update-email-wallet-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-update-email-wallet-view/styles.d.ts +0 -23
- package/lib/typescript/views/w3m-update-email-wallet-view/styles.d.ts.map +0 -1
- package/src/views/w3m-update-email-primary-otp-view/index.tsx +0 -55
- package/src/views/w3m-update-email-secondary-otp-view/index.tsx +0 -56
- package/src/views/w3m-update-email-wallet-view/index.tsx +0 -96
- package/src/views/w3m-update-email-wallet-view/styles.ts +0 -24
|
@@ -18,14 +18,16 @@ import {
|
|
|
18
18
|
Text,
|
|
19
19
|
ListToken,
|
|
20
20
|
useTheme,
|
|
21
|
-
Spacing
|
|
21
|
+
Spacing,
|
|
22
|
+
LoadingSpinner
|
|
22
23
|
} from '@reown/appkit-ui-react-native';
|
|
23
24
|
|
|
24
25
|
interface Props {
|
|
25
26
|
style?: StyleProp<ViewStyle>;
|
|
27
|
+
isLoading?: boolean;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
export function AccountTokens({ style }: Props) {
|
|
30
|
+
export function AccountTokens({ style, isLoading }: Props) {
|
|
29
31
|
const Theme = useTheme();
|
|
30
32
|
const [refreshing, setRefreshing] = useState(false);
|
|
31
33
|
const { activeNetwork, balances } = useSnapshot(ConnectionsController.state);
|
|
@@ -46,21 +48,24 @@ export function AccountTokens({ style }: Props) {
|
|
|
46
48
|
|
|
47
49
|
if (!filteredBalances?.length) {
|
|
48
50
|
return (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
<>
|
|
52
|
+
<ListItem
|
|
53
|
+
icon="arrowBottomCircle"
|
|
54
|
+
iconColor="magenta-100"
|
|
55
|
+
onPress={onReceivePress}
|
|
56
|
+
style={styles.receiveButton}
|
|
57
|
+
>
|
|
58
|
+
<FlexView flexDirection="column" alignItems="flex-start">
|
|
59
|
+
<Text variant="paragraph-500" color="fg-100">
|
|
60
|
+
Receive funds
|
|
61
|
+
</Text>
|
|
62
|
+
<Text variant="small-400" color="fg-200">
|
|
63
|
+
Transfer tokens on your wallet
|
|
64
|
+
</Text>
|
|
65
|
+
</FlexView>
|
|
66
|
+
</ListItem>
|
|
67
|
+
{isLoading && <LoadingSpinner size="sm" style={styles.loadingSpinner} />}
|
|
68
|
+
</>
|
|
64
69
|
);
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -70,7 +75,7 @@ export function AccountTokens({ style }: Props) {
|
|
|
70
75
|
style={style}
|
|
71
76
|
refreshControl={
|
|
72
77
|
<RefreshControl
|
|
73
|
-
refreshing={refreshing}
|
|
78
|
+
refreshing={isLoading || refreshing}
|
|
74
79
|
onRefresh={onRefresh}
|
|
75
80
|
tintColor={Theme['accent-100']}
|
|
76
81
|
colors={[Theme['accent-100']]}
|
|
@@ -97,5 +102,8 @@ const styles = StyleSheet.create({
|
|
|
97
102
|
receiveButton: {
|
|
98
103
|
width: 'auto',
|
|
99
104
|
marginHorizontal: Spacing.s
|
|
105
|
+
},
|
|
106
|
+
loadingSpinner: {
|
|
107
|
+
marginTop: Spacing.m
|
|
100
108
|
}
|
|
101
109
|
});
|
|
@@ -17,10 +17,10 @@ import { AccountTokens } from '../w3m-account-tokens';
|
|
|
17
17
|
import styles from './styles';
|
|
18
18
|
|
|
19
19
|
export interface AccountWalletFeaturesProps {
|
|
20
|
-
|
|
20
|
+
isBalanceLoading: boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export function AccountWalletFeatures() {
|
|
23
|
+
export function AccountWalletFeatures({ isBalanceLoading }: AccountWalletFeaturesProps) {
|
|
24
24
|
const [activeTab, setActiveTab] = useState(0);
|
|
25
25
|
const { features, isOnRampEnabled } = useSnapshot(OptionsController.state);
|
|
26
26
|
const { activeNetwork, balances } = useSnapshot(ConnectionsController.state);
|
|
@@ -137,7 +137,9 @@ export function AccountWalletFeatures() {
|
|
|
137
137
|
<Tabs tabs={['Tokens', 'Activity']} onTabChange={onTabChange} />
|
|
138
138
|
</FlexView>
|
|
139
139
|
<FlexView padding={['m', '0', '0', '0']} style={styles.tabContainer}>
|
|
140
|
-
{activeTab === 0 &&
|
|
140
|
+
{activeTab === 0 && (
|
|
141
|
+
<AccountTokens style={styles.tabContent} isLoading={isBalanceLoading} />
|
|
142
|
+
)}
|
|
141
143
|
{activeTab === 1 && <AccountActivity style={styles.tabContent} />}
|
|
142
144
|
</FlexView>
|
|
143
145
|
</FlexView>
|
|
@@ -3,7 +3,6 @@ import { useSnapshot } from 'valtio';
|
|
|
3
3
|
import {
|
|
4
4
|
AssetUtil,
|
|
5
5
|
ConnectionController,
|
|
6
|
-
ConnectorController,
|
|
7
6
|
EventsController,
|
|
8
7
|
OptionsController,
|
|
9
8
|
SnackController
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
import { FlexView, Link, QrCode, Text, Spacing } from '@reown/appkit-ui-react-native';
|
|
12
11
|
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
13
12
|
import styles from './styles';
|
|
13
|
+
import { PresetsUtil } from '@reown/appkit-common-react-native';
|
|
14
14
|
|
|
15
15
|
export function ConnectingQrCode() {
|
|
16
16
|
const { wcUri } = useSnapshot(ConnectionController.state);
|
|
@@ -37,9 +37,8 @@ export function ConnectingQrCode() {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const url = AssetUtil.getConnectorImage(connector);
|
|
40
|
+
//TODO: check this
|
|
41
|
+
const url = AssetUtil.getConnectorImage(PresetsUtil.ConnectorImageIds['WALLET_CONNECT']);
|
|
43
42
|
ConnectionController.setConnectedWalletImageUrl(url);
|
|
44
43
|
};
|
|
45
44
|
|
|
@@ -48,9 +48,6 @@ export function Header() {
|
|
|
48
48
|
SwapPreview: 'Review swap',
|
|
49
49
|
Transactions: 'Activity',
|
|
50
50
|
UnsupportedChain: 'Switch network',
|
|
51
|
-
UpdateEmailPrimaryOtp: 'Confirm current email',
|
|
52
|
-
UpdateEmailSecondaryOtp: 'Confirm new email',
|
|
53
|
-
UpdateEmailWallet: 'Edit email',
|
|
54
51
|
UpgradeEmailWallet: 'Upgrade wallet',
|
|
55
52
|
WalletCompatibleNetworks: 'Compatible networks',
|
|
56
53
|
WalletReceive: 'Receive',
|
|
@@ -41,9 +41,9 @@ export function SendInputToken({
|
|
|
41
41
|
const onMaxPress = () => {
|
|
42
42
|
if (token?.quantity && gasPrice) {
|
|
43
43
|
const isNetworkToken =
|
|
44
|
-
token.
|
|
44
|
+
token.address === undefined ||
|
|
45
45
|
Object.values(ConstantsUtil.NATIVE_TOKEN_ADDRESS).some(
|
|
46
|
-
nativeAddress => token?.
|
|
46
|
+
nativeAddress => token?.address?.split(':')[2] === nativeAddress
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
const numericGas = NumberUtil.bigNumber(gasPrice).shiftedBy(-token.quantity.decimals);
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
OnRampController,
|
|
17
17
|
ConnectionsController
|
|
18
18
|
} from '@reown/appkit-core-react-native';
|
|
19
|
+
import { ConstantsUtil as CommonConstantsUtil } from '@reown/appkit-common-react-native';
|
|
19
20
|
import {
|
|
20
21
|
Avatar,
|
|
21
22
|
Button,
|
|
@@ -34,6 +35,7 @@ import { AuthButtons } from './components/auth-buttons';
|
|
|
34
35
|
import styles from './styles';
|
|
35
36
|
|
|
36
37
|
export function AccountDefaultView() {
|
|
38
|
+
const { switchAccountType, disconnect } = useAppKit();
|
|
37
39
|
const { profileName, profileImage } = useSnapshot(AccountController.state);
|
|
38
40
|
const { loading } = useSnapshot(ModalController.state);
|
|
39
41
|
const {
|
|
@@ -50,14 +52,13 @@ export function AccountDefaultView() {
|
|
|
50
52
|
const { history } = useSnapshot(RouterController.state);
|
|
51
53
|
const networkImage = AssetUtil.getNetworkImage(activeNetwork?.id);
|
|
52
54
|
const showCopy = OptionsController.isClipboardAvailable();
|
|
53
|
-
const isAuth = connection?.properties?.
|
|
55
|
+
const isAuth = !!connection?.properties?.provider;
|
|
54
56
|
const showBalance = balance && !isAuth;
|
|
55
57
|
const showExplorer = Object.keys(activeNetwork?.blockExplorers ?? {}).length > 0 && !isAuth;
|
|
56
58
|
const showBack = history.length > 1;
|
|
57
|
-
const showSwitchAccountType = isAuth;
|
|
59
|
+
const showSwitchAccountType = isAuth && activeNamespace === 'eip155';
|
|
58
60
|
const showActivity =
|
|
59
61
|
!isAuth &&
|
|
60
|
-
activeNamespace &&
|
|
61
62
|
activeNetwork?.caipNetworkId &&
|
|
62
63
|
ConstantsUtil.ACTIVITY_SUPPORTED_CHAINS.includes(activeNetwork.caipNetworkId);
|
|
63
64
|
const showSwaps =
|
|
@@ -66,7 +67,6 @@ export function AccountDefaultView() {
|
|
|
66
67
|
activeNetwork?.caipNetworkId &&
|
|
67
68
|
ConstantsUtil.SWAP_SUPPORTED_NETWORKS.includes(activeNetwork.caipNetworkId);
|
|
68
69
|
const { padding } = useCustomDimensions();
|
|
69
|
-
const { disconnect } = useAppKit();
|
|
70
70
|
|
|
71
71
|
async function onDisconnect() {
|
|
72
72
|
setDisconnecting(true);
|
|
@@ -76,26 +76,13 @@ export function AccountDefaultView() {
|
|
|
76
76
|
|
|
77
77
|
const onSwitchAccountType = async () => {
|
|
78
78
|
try {
|
|
79
|
-
|
|
79
|
+
const namespace = ConnectionsController.state.activeNamespace;
|
|
80
|
+
const network = ConnectionsController.state.activeNetwork;
|
|
81
|
+
if (isAuth && namespace && network) {
|
|
80
82
|
const newType = ConnectionsController.state.accountType === 'eoa' ? 'smartAccount' : 'eoa';
|
|
81
|
-
|
|
82
|
-
ConnectionsController.state.activeNamespace,
|
|
83
|
-
ConnectionsController.state.accountType === 'eoa' ? 'smartAccount' : 'eoa'
|
|
84
|
-
);
|
|
85
|
-
ConnectionsController.fetchBalance();
|
|
86
|
-
|
|
87
|
-
EventsController.sendEvent({
|
|
88
|
-
type: 'track',
|
|
89
|
-
event: 'SET_PREFERRED_ACCOUNT_TYPE',
|
|
90
|
-
properties: {
|
|
91
|
-
// eslint-disable-next-line valtio/state-snapshot-rule
|
|
92
|
-
accountType: newType,
|
|
93
|
-
network: ConnectionsController.state.activeNetwork?.caipNetworkId || ''
|
|
94
|
-
}
|
|
95
|
-
});
|
|
83
|
+
switchAccountType(namespace, newType, network);
|
|
96
84
|
}
|
|
97
85
|
} catch (error) {
|
|
98
|
-
ModalController.setLoading(false);
|
|
99
86
|
SnackController.showError('Error switching account type');
|
|
100
87
|
}
|
|
101
88
|
};
|
|
@@ -158,11 +145,21 @@ export function AccountDefaultView() {
|
|
|
158
145
|
RouterController.push('UpgradeEmailWallet');
|
|
159
146
|
};
|
|
160
147
|
|
|
161
|
-
const onEmailPress = () => {
|
|
148
|
+
const onEmailPress = async () => {
|
|
162
149
|
const email = ConnectionsController.state.connection?.properties?.email;
|
|
163
150
|
const provider = ConnectionsController.state.connection?.properties?.provider;
|
|
164
151
|
if (provider !== 'email' || !email) return;
|
|
165
|
-
|
|
152
|
+
|
|
153
|
+
const sessionTopic = ConnectionsController.state.connection?.properties?.sessionTopic;
|
|
154
|
+
|
|
155
|
+
if (!sessionTopic) {
|
|
156
|
+
throw new Error('Session topic not found');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const link = `${CommonConstantsUtil.WEB_WALLET_URL}/emailUpdate/${sessionTopic}`;
|
|
160
|
+
await CoreHelperUtil.openLink(link);
|
|
161
|
+
|
|
162
|
+
// Subscribe to email update event
|
|
166
163
|
};
|
|
167
164
|
|
|
168
165
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSnapshot } from 'valtio';
|
|
2
|
-
import { useEffect } from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
3
|
import { ScrollView } from 'react-native';
|
|
4
4
|
import {
|
|
5
5
|
AccountPill,
|
|
@@ -25,6 +25,7 @@ import styles from './styles';
|
|
|
25
25
|
|
|
26
26
|
export function AccountView() {
|
|
27
27
|
const Theme = useTheme();
|
|
28
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
28
29
|
const { padding } = useCustomDimensions();
|
|
29
30
|
const { activeNetwork, activeAddress } = useSnapshot(ConnectionsController.state);
|
|
30
31
|
const address = CoreHelperUtil.getPlainAddress(activeAddress);
|
|
@@ -38,15 +39,17 @@ export function AccountView() {
|
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
useEffect(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
async function fetchBalance() {
|
|
43
|
+
setIsLoading(true);
|
|
44
|
+
await ConnectionsController.fetchBalance();
|
|
45
|
+
setIsLoading(false);
|
|
46
|
+
}
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
fetchBalance();
|
|
49
|
+
SendController.resetSend();
|
|
47
50
|
|
|
48
51
|
const balanceInterval = setInterval(() => {
|
|
49
|
-
|
|
52
|
+
fetchBalance();
|
|
50
53
|
}, 10000);
|
|
51
54
|
|
|
52
55
|
return () => {
|
|
@@ -82,7 +85,7 @@ export function AccountView() {
|
|
|
82
85
|
onPress={onProfilePress}
|
|
83
86
|
style={styles.accountPill}
|
|
84
87
|
/>
|
|
85
|
-
<AccountWalletFeatures />
|
|
88
|
+
<AccountWalletFeatures isBalanceLoading={isLoading} />
|
|
86
89
|
</FlexView>
|
|
87
90
|
</ScrollView>
|
|
88
91
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ConnectionController,
|
|
4
|
-
ConnectorController,
|
|
5
4
|
EventsController,
|
|
6
5
|
RouterController,
|
|
7
6
|
type WcWallet
|
|
@@ -25,12 +24,13 @@ export function AllWalletsView() {
|
|
|
25
24
|
const { debouncedCallback: onInputChange } = useDebounceCallback({ callback: setSearchQuery });
|
|
26
25
|
|
|
27
26
|
const onWalletPress = (wallet: WcWallet) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
27
|
+
//TODO: check this
|
|
28
|
+
// const connector = ConnectorController.state.connectors.find(c => c.explorerId === wallet.id);
|
|
29
|
+
// if (connector) {
|
|
30
|
+
// RouterController.push('ConnectingExternal', { connector, wallet });
|
|
31
|
+
// } else {
|
|
32
|
+
RouterController.push('ConnectingWalletConnect', { wallet });
|
|
33
|
+
// }
|
|
34
34
|
|
|
35
35
|
EventsController.sendEvent({
|
|
36
36
|
type: 'track',
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { useSnapshot } from 'valtio';
|
|
2
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '@reown/appkit-core-react-native';
|
|
1
|
+
// import { useSnapshot } from 'valtio';
|
|
2
|
+
// import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
// import {
|
|
4
|
+
// ConnectorController,
|
|
5
|
+
// AssetUtil,
|
|
6
|
+
// RouterController,
|
|
7
|
+
// ApiController
|
|
8
|
+
// } from '@reown/appkit-core-react-native';
|
|
9
9
|
|
|
10
|
-
import { ListWallet } from '@reown/appkit-ui-react-native';
|
|
11
|
-
import type { ConnectorType } from '@reown/appkit-common-react-native';
|
|
10
|
+
// import { ListWallet } from '@reown/appkit-ui-react-native';
|
|
11
|
+
// import type { ConnectorType } from '@reown/appkit-common-react-native';
|
|
12
12
|
|
|
13
|
-
interface Props {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
13
|
+
// interface Props {
|
|
14
|
+
// itemStyle: StyleProp<ViewStyle>;
|
|
15
|
+
// isWalletConnectEnabled: boolean;
|
|
16
|
+
// }
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
18
|
+
// TODO: check this for coinbase
|
|
19
|
+
export function ConnectorList(/*{ itemStyle, isWalletConnectEnabled }: Props*/) {
|
|
20
|
+
// const { connectors } = useSnapshot(ConnectorController.state);
|
|
21
|
+
// const excludeConnectors: ConnectorType[] = ['WALLET_CONNECT', 'AUTH'];
|
|
22
|
+
// const imageHeaders = ApiController._getApiHeaders();
|
|
22
23
|
|
|
23
|
-
if (isWalletConnectEnabled) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
24
|
+
// if (isWalletConnectEnabled) {
|
|
25
|
+
// // use wallet from api list
|
|
26
|
+
// excludeConnectors.push('COINBASE');
|
|
27
|
+
// }
|
|
27
28
|
|
|
28
|
-
return connectors.map(connector => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// return connectors.map(connector => {
|
|
30
|
+
// if (excludeConnectors.includes(connector.type)) {
|
|
31
|
+
// return null;
|
|
32
|
+
// }
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
34
|
+
// return (
|
|
35
|
+
// <ListWallet
|
|
36
|
+
// key={connector.type}
|
|
37
|
+
// imageSrc={AssetUtil.getConnectorImage(connector)}
|
|
38
|
+
// imageHeaders={imageHeaders}
|
|
39
|
+
// name={connector.name || 'Unknown'}
|
|
40
|
+
// onPress={() => RouterController.push('ConnectingExternal', { connector })}
|
|
41
|
+
// style={itemStyle}
|
|
42
|
+
// installed={connector.installed}
|
|
43
|
+
// />
|
|
44
|
+
// );
|
|
45
|
+
// });
|
|
46
|
+
return null;
|
|
45
47
|
}
|
|
@@ -2,7 +2,6 @@ import { useSnapshot } from 'valtio';
|
|
|
2
2
|
import { ScrollView, View } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
ApiController,
|
|
5
|
-
ConnectorController,
|
|
6
5
|
EventUtil,
|
|
7
6
|
EventsController,
|
|
8
7
|
OptionsController,
|
|
@@ -12,7 +11,6 @@ import {
|
|
|
12
11
|
import { FlexView, Icon, ListItem, Separator, Text } from '@reown/appkit-ui-react-native';
|
|
13
12
|
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
14
13
|
import { Placeholder } from '../../partials/w3m-placeholder';
|
|
15
|
-
import { ConnectorList } from './components/connectors-list';
|
|
16
14
|
import { CustomWalletList } from './components/custom-wallet-list';
|
|
17
15
|
import { AllWalletsButton } from './components/all-wallets-button';
|
|
18
16
|
import { AllWalletList } from './components/all-wallet-list';
|
|
@@ -21,16 +19,13 @@ import { SocialLoginList } from './components/social-login-list';
|
|
|
21
19
|
import styles from './styles';
|
|
22
20
|
|
|
23
21
|
export function ConnectView() {
|
|
24
|
-
const connectors = ConnectorController.state.connectors;
|
|
25
|
-
// const { authLoading } = useSnapshot(ConnectorController.state);
|
|
26
22
|
const { prefetchError } = useSnapshot(ApiController.state);
|
|
27
23
|
const { features } = useSnapshot(OptionsController.state);
|
|
28
24
|
const { padding } = useCustomDimensions();
|
|
29
25
|
|
|
30
|
-
//TODO: check this
|
|
31
|
-
// const isWalletConnectEnabled = connectors.some(c => c.type === 'WALLET_CONNECT');
|
|
26
|
+
//TODO: check this with Coinbase
|
|
32
27
|
const isWalletConnectEnabled = true;
|
|
33
|
-
const isCoinbaseEnabled =
|
|
28
|
+
const isCoinbaseEnabled = false;
|
|
34
29
|
const isSocialEnabled = features?.socials && features?.socials.length > 0;
|
|
35
30
|
const showConnectWalletsButton =
|
|
36
31
|
isWalletConnectEnabled && isSocialEnabled && !features?.showWallets;
|
|
@@ -39,19 +34,19 @@ export function ConnectView() {
|
|
|
39
34
|
const showList = !showConnectWalletsButton && !showLoadingError;
|
|
40
35
|
|
|
41
36
|
const onWalletPress = (wallet: WcWallet, isInstalled?: boolean) => {
|
|
42
|
-
const connector = connectors.find(c => c.explorerId === wallet.id);
|
|
43
|
-
if (connector) {
|
|
44
|
-
|
|
45
|
-
} else {
|
|
46
|
-
|
|
47
|
-
}
|
|
37
|
+
// const connector = connectors.find(c => c.explorerId === wallet.id);
|
|
38
|
+
// if (connector) {
|
|
39
|
+
// RouterController.push('ConnectingExternal', { connector, wallet });
|
|
40
|
+
// } else {
|
|
41
|
+
RouterController.push('ConnectingWalletConnect', { wallet });
|
|
42
|
+
// }
|
|
48
43
|
|
|
49
44
|
const platform = EventUtil.getWalletPlatform(wallet, isInstalled);
|
|
50
45
|
EventsController.sendEvent({
|
|
51
46
|
type: 'track',
|
|
52
47
|
event: 'SELECT_WALLET',
|
|
53
48
|
properties: {
|
|
54
|
-
name: wallet.name ??
|
|
49
|
+
name: wallet.name ?? 'Unknown',
|
|
55
50
|
platform,
|
|
56
51
|
explorer_id: wallet.id
|
|
57
52
|
}
|
|
@@ -108,10 +103,6 @@ export function ConnectView() {
|
|
|
108
103
|
onWalletPress={onWalletPress}
|
|
109
104
|
isWalletConnectEnabled={isWalletConnectEnabled}
|
|
110
105
|
/>
|
|
111
|
-
<ConnectorList
|
|
112
|
-
itemStyle={styles.item}
|
|
113
|
-
isWalletConnectEnabled={isWalletConnectEnabled}
|
|
114
|
-
/>
|
|
115
106
|
<AllWalletsButton
|
|
116
107
|
itemStyle={styles.item}
|
|
117
108
|
onPress={onViewAllPress}
|
|
@@ -3,11 +3,8 @@ import { ScrollView } from 'react-native';
|
|
|
3
3
|
import {
|
|
4
4
|
RouterController,
|
|
5
5
|
ApiController,
|
|
6
|
-
AssetUtil,
|
|
7
|
-
ConnectionController,
|
|
8
6
|
ModalController,
|
|
9
7
|
EventsController,
|
|
10
|
-
StorageUtil,
|
|
11
8
|
type WcWallet
|
|
12
9
|
} from '@reown/appkit-core-react-native';
|
|
13
10
|
import {
|
|
@@ -22,6 +19,7 @@ import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
|
22
19
|
import { ConnectingBody, getMessage, type BodyErrorType } from '../../partials/w3m-connecting-body';
|
|
23
20
|
import styles from './styles';
|
|
24
21
|
|
|
22
|
+
//TODO: check if this view is needed with Coinbase
|
|
25
23
|
export function ConnectingExternalView() {
|
|
26
24
|
const { data } = RouterController.state;
|
|
27
25
|
const connector = data?.connector;
|
|
@@ -35,25 +33,27 @@ export function ConnectingExternalView() {
|
|
|
35
33
|
};
|
|
36
34
|
|
|
37
35
|
const storeConnectedWallet = useCallback(
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
38
|
async (wallet?: WcWallet) => {
|
|
39
|
-
if (wallet) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
if (connector) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
39
|
+
// if (wallet) {
|
|
40
|
+
// const recentWallets = await StorageUtil.addRecentWallet(wallet);
|
|
41
|
+
// if (recentWallets) {
|
|
42
|
+
// ConnectionController.setRecentWallets(recentWallets);
|
|
43
|
+
// }
|
|
44
|
+
// }
|
|
45
|
+
// if (connector) {
|
|
46
|
+
// const url = AssetUtil.getConnectorImage(connector);
|
|
47
|
+
// ConnectionController.setConnectedWalletImageUrl(url);
|
|
48
|
+
// }
|
|
49
49
|
},
|
|
50
|
-
[
|
|
50
|
+
[]
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
const onConnect = useCallback(async () => {
|
|
54
54
|
try {
|
|
55
55
|
if (connector) {
|
|
56
|
-
await ConnectionController.connectExternal(connector);
|
|
56
|
+
// await ConnectionController.connectExternal(connector);
|
|
57
57
|
storeConnectedWallet(data?.wallet);
|
|
58
58
|
ModalController.close();
|
|
59
59
|
EventsController.sendEvent({
|
|
@@ -97,7 +97,7 @@ export function ConnectingExternalView() {
|
|
|
97
97
|
<LoadingThumbnail paused={!!errorType}>
|
|
98
98
|
<WalletImage
|
|
99
99
|
size="xl"
|
|
100
|
-
imageSrc={AssetUtil.getConnectorImage(connector)}
|
|
100
|
+
// imageSrc={AssetUtil.getConnectorImage(connector)}
|
|
101
101
|
imageHeaders={ApiController._getApiHeaders()}
|
|
102
102
|
/>
|
|
103
103
|
{errorType && (
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable valtio/state-snapshot-rule */
|
|
2
1
|
import { useSnapshot } from 'valtio';
|
|
3
2
|
import { useEffect, useState } from 'react';
|
|
4
3
|
import {
|
|
@@ -6,9 +5,6 @@ import {
|
|
|
6
5
|
AssetUtil,
|
|
7
6
|
ConnectionController,
|
|
8
7
|
ConnectionsController,
|
|
9
|
-
ConnectorController,
|
|
10
|
-
EventsController,
|
|
11
|
-
NetworkController,
|
|
12
8
|
RouterController,
|
|
13
9
|
RouterUtil
|
|
14
10
|
} from '@reown/appkit-core-react-native';
|
|
@@ -20,30 +16,27 @@ import {
|
|
|
20
16
|
NetworkImage,
|
|
21
17
|
Text
|
|
22
18
|
} from '@reown/appkit-ui-react-native';
|
|
19
|
+
import { useAppKit } from '../../AppKitContext';
|
|
23
20
|
import styles from './styles';
|
|
24
21
|
|
|
25
22
|
export function NetworkSwitchView() {
|
|
23
|
+
const { switchNetwork } = useAppKit();
|
|
26
24
|
const { data } = useSnapshot(RouterController.state);
|
|
27
25
|
const { recentWallets } = useSnapshot(ConnectionController.state);
|
|
28
26
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
29
|
-
const isAuthConnected = ConnectorController.state.connectedConnector === 'AUTH';
|
|
30
27
|
const [error, setError] = useState<boolean>(false);
|
|
31
28
|
const [showRetry, setShowRetry] = useState<boolean>(false);
|
|
32
|
-
const network = data?.network
|
|
29
|
+
const network = data?.network;
|
|
33
30
|
const wallet = recentWallets?.[0];
|
|
34
31
|
|
|
35
32
|
const onSwitchNetwork = async () => {
|
|
36
33
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
properties: {
|
|
44
|
-
network: network.id
|
|
45
|
-
}
|
|
46
|
-
});
|
|
34
|
+
if (network) {
|
|
35
|
+
setError(false);
|
|
36
|
+
const _network = ConnectionsController.state.networks.find(n => n.id === network.id);
|
|
37
|
+
if (!_network) return;
|
|
38
|
+
await switchNetwork(_network);
|
|
39
|
+
}
|
|
47
40
|
} catch {
|
|
48
41
|
setError(true);
|
|
49
42
|
setShowRetry(true);
|
|
@@ -57,9 +50,12 @@ export function NetworkSwitchView() {
|
|
|
57
50
|
|
|
58
51
|
useEffect(() => {
|
|
59
52
|
// Go back if network is already switched
|
|
53
|
+
// eslint-disable-next-line valtio/state-snapshot-rule
|
|
60
54
|
if (activeNetwork?.id === network?.id) {
|
|
61
55
|
RouterUtil.navigateAfterNetworkSwitch();
|
|
62
56
|
}
|
|
57
|
+
|
|
58
|
+
// eslint-disable-next-line valtio/state-snapshot-rule
|
|
63
59
|
}, [activeNetwork?.id, network?.id]);
|
|
64
60
|
|
|
65
61
|
const retryTemplate = () => {
|
|
@@ -95,14 +91,6 @@ export function NetworkSwitchView() {
|
|
|
95
91
|
);
|
|
96
92
|
}
|
|
97
93
|
|
|
98
|
-
if (isAuthConnected) {
|
|
99
|
-
return (
|
|
100
|
-
<Text variant="paragraph-500" style={styles.text}>
|
|
101
|
-
Switching to {network.name} network
|
|
102
|
-
</Text>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
94
|
return (
|
|
107
95
|
<>
|
|
108
96
|
<Text variant="paragraph-500" style={styles.text}>{`Approve in ${walletName}`}</Text>
|
|
@@ -2,7 +2,7 @@ import { useSnapshot } from 'valtio';
|
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
AccountController,
|
|
5
|
-
|
|
5
|
+
ConnectionsController,
|
|
6
6
|
OnRampController,
|
|
7
7
|
RouterController
|
|
8
8
|
} from '@reown/appkit-core-react-native';
|
|
@@ -15,7 +15,7 @@ export function OnRampTransactionView() {
|
|
|
15
15
|
const { data } = useSnapshot(RouterController.state);
|
|
16
16
|
|
|
17
17
|
const onClose = () => {
|
|
18
|
-
const isAuth =
|
|
18
|
+
const isAuth = !!ConnectionsController.state.connection?.properties?.provider;
|
|
19
19
|
RouterController.replace(isAuth ? 'Account' : 'AccountDefault');
|
|
20
20
|
};
|
|
21
21
|
|