@reown/appkit-react-native 0.0.0-feat-multi-social-20250701154123 → 0.0.0-feat-multi-social-20250703185818
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 +18 -11
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +15 -3
- 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-activity/index.js +4 -4
- package/lib/commonjs/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-tokens/index.js +11 -10
- package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js +10 -10
- package/lib/commonjs/partials/w3m-account-wallet-features/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 +3 -3
- package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/utils.js +2 -2
- package/lib/commonjs/partials/w3m-send-input-token/utils.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js +4 -13
- package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +19 -32
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/index.js +11 -22
- package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/styles.js +0 -5
- package/lib/commonjs/views/w3m-account-view/styles.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js +14 -7
- package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +10 -8
- package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js +1 -1
- package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js +1 -1
- package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +5 -4
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js +10 -12
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js +1 -1
- 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 +7 -9
- package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-view/index.js +5 -5
- package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/module/AppKit.js +18 -11
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +15 -3
- 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-activity/index.js +5 -5
- package/lib/module/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/module/partials/w3m-account-tokens/index.js +12 -11
- package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js +11 -11
- package/lib/module/partials/w3m-account-wallet-features/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 +3 -3
- package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/utils.js +2 -2
- package/lib/module/partials/w3m-send-input-token/utils.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +5 -14
- package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +20 -33
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/index.js +13 -24
- package/lib/module/views/w3m-account-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/styles.js +0 -5
- package/lib/module/views/w3m-account-view/styles.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/social-login-list.js +14 -7
- package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
- package/lib/module/views/w3m-connecting-siwe-view/index.js +11 -9
- package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js +1 -1
- package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/index.js +2 -2
- package/lib/module/views/w3m-swap-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +6 -5
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-receive-view/index.js +11 -13
- package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js +1 -1
- 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 +8 -10
- package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-view/index.js +6 -6
- package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +1 -1
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts +2 -2
- package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
- package/lib/typescript/hooks/useAppKitEvents.d.ts +0 -9
- package/lib/typescript/hooks/useAppKitEvents.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-account-activity/index.d.ts.map +1 -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.map +1 -1
- package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-account-default-view/components/auth-buttons.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-account-view/styles.d.ts +0 -5
- package/lib/typescript/views/w3m-account-view/styles.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/social-login-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-compatible-networks-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-receive-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-select-token-view/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +24 -12
- package/src/connectors/WalletConnectConnector.ts +25 -6
- package/src/modal/w3m-router/index.tsx +0 -9
- package/src/partials/w3m-account-activity/index.tsx +4 -5
- package/src/partials/w3m-account-tokens/index.tsx +10 -9
- package/src/partials/w3m-account-wallet-features/index.tsx +7 -15
- package/src/partials/w3m-header/index.tsx +0 -3
- package/src/partials/w3m-send-input-token/index.tsx +4 -4
- package/src/partials/w3m-send-input-token/utils.ts +2 -2
- package/src/views/w3m-account-default-view/components/auth-buttons.tsx +4 -15
- package/src/views/w3m-account-default-view/index.tsx +23 -36
- package/src/views/w3m-account-view/index.tsx +9 -26
- package/src/views/w3m-account-view/styles.ts +0 -5
- package/src/views/w3m-connect-view/components/social-login-list.tsx +13 -5
- package/src/views/w3m-connecting-siwe-view/index.tsx +6 -17
- package/src/views/w3m-connecting-social-view/index.tsx +1 -1
- package/src/views/w3m-swap-view/index.tsx +1 -2
- package/src/views/w3m-wallet-compatible-networks-view/index.tsx +9 -11
- package/src/views/w3m-wallet-receive-view/index.tsx +16 -10
- package/src/views/w3m-wallet-send-preview-view/index.tsx +1 -1
- package/src/views/w3m-wallet-send-select-token-view/index.tsx +7 -9
- package/src/views/w3m-wallet-send-view/index.tsx +5 -5
- package/lib/commonjs/views/w3m-email-verify-device-view/index.js +0 -106
- package/lib/commonjs/views/w3m-email-verify-device-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-email-verify-device-view/styles.js +0 -25
- package/lib/commonjs/views/w3m-email-verify-device-view/styles.js.map +0 -1
- package/lib/commonjs/views/w3m-email-verify-otp-view/index.js +0 -86
- package/lib/commonjs/views/w3m-email-verify-otp-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/index.js +0 -103
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/index.js.map +0 -1
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/styles.js +0 -35
- package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/styles.js.map +0 -1
- package/lib/module/views/w3m-email-verify-device-view/index.js +0 -99
- package/lib/module/views/w3m-email-verify-device-view/index.js.map +0 -1
- package/lib/module/views/w3m-email-verify-device-view/styles.js +0 -19
- package/lib/module/views/w3m-email-verify-device-view/styles.js.map +0 -1
- package/lib/module/views/w3m-email-verify-otp-view/index.js +0 -79
- package/lib/module/views/w3m-email-verify-otp-view/index.js.map +0 -1
- package/lib/module/views/w3m-upgrade-to-smart-account-view/index.js +0 -96
- package/lib/module/views/w3m-upgrade-to-smart-account-view/index.js.map +0 -1
- package/lib/module/views/w3m-upgrade-to-smart-account-view/styles.js +0 -29
- package/lib/module/views/w3m-upgrade-to-smart-account-view/styles.js.map +0 -1
- package/lib/typescript/views/w3m-email-verify-device-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-email-verify-device-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-email-verify-device-view/styles.d.ts +0 -18
- package/lib/typescript/views/w3m-email-verify-device-view/styles.d.ts.map +0 -1
- package/lib/typescript/views/w3m-email-verify-otp-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-email-verify-otp-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/index.d.ts +0 -2
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/index.d.ts.map +0 -1
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/styles.d.ts +0 -28
- package/lib/typescript/views/w3m-upgrade-to-smart-account-view/styles.d.ts.map +0 -1
- package/src/views/w3m-email-verify-device-view/index.tsx +0 -80
- package/src/views/w3m-email-verify-device-view/styles.ts +0 -19
- package/src/views/w3m-email-verify-otp-view/index.tsx +0 -75
- package/src/views/w3m-upgrade-to-smart-account-view/index.tsx +0 -106
- package/src/views/w3m-upgrade-to-smart-account-view/styles.ts +0 -29
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ConnectionController,
|
|
4
|
-
ConnectorController,
|
|
5
|
-
CoreHelperUtil,
|
|
6
|
-
EventsController,
|
|
7
|
-
ModalController,
|
|
8
|
-
RouterController,
|
|
9
|
-
SnackController,
|
|
10
|
-
type AppKitFrameProvider
|
|
11
|
-
} from '@reown/appkit-core-react-native';
|
|
12
|
-
import useTimeout from '../../hooks/useTimeout';
|
|
13
|
-
import { OtpCodeView } from '../../partials/w3m-otp-code';
|
|
14
|
-
|
|
15
|
-
export function EmailVerifyOtpView() {
|
|
16
|
-
const { timeLeft, startTimer } = useTimeout(0);
|
|
17
|
-
const { data } = RouterController.state;
|
|
18
|
-
const [loading, setLoading] = useState(false);
|
|
19
|
-
const [error, setError] = useState('');
|
|
20
|
-
const authConnector = ConnectorController.getAuthConnector();
|
|
21
|
-
|
|
22
|
-
const onOtpResend = async () => {
|
|
23
|
-
try {
|
|
24
|
-
if (!data?.email || !authConnector) return;
|
|
25
|
-
setLoading(true);
|
|
26
|
-
const provider = authConnector?.provider as AppKitFrameProvider;
|
|
27
|
-
await provider.connectEmail({ email: data.email });
|
|
28
|
-
SnackController.showSuccess('Code resent');
|
|
29
|
-
startTimer(30);
|
|
30
|
-
setLoading(false);
|
|
31
|
-
} catch (e) {
|
|
32
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
33
|
-
SnackController.showError(parsedError);
|
|
34
|
-
setLoading(false);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const onOtpSubmit = async (otp: string) => {
|
|
39
|
-
if (!authConnector) return;
|
|
40
|
-
setLoading(true);
|
|
41
|
-
setError('');
|
|
42
|
-
try {
|
|
43
|
-
const provider = authConnector?.provider as AppKitFrameProvider;
|
|
44
|
-
await provider.connectOtp({ otp });
|
|
45
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_PASS' });
|
|
46
|
-
await ConnectionController.connectExternal(authConnector);
|
|
47
|
-
ModalController.close();
|
|
48
|
-
EventsController.sendEvent({
|
|
49
|
-
type: 'track',
|
|
50
|
-
event: 'CONNECT_SUCCESS',
|
|
51
|
-
properties: { method: 'email', name: authConnector.name || 'Unknown' }
|
|
52
|
-
});
|
|
53
|
-
} catch (e) {
|
|
54
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_FAIL' });
|
|
55
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
56
|
-
if (parsedError?.includes('Invalid code')) {
|
|
57
|
-
setError('Invalid code. Try again.');
|
|
58
|
-
} else {
|
|
59
|
-
SnackController.showError(parsedError);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
setLoading(false);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<OtpCodeView
|
|
67
|
-
loading={loading}
|
|
68
|
-
error={error}
|
|
69
|
-
timeLeft={timeLeft}
|
|
70
|
-
email={data?.email}
|
|
71
|
-
onRetry={onOtpResend}
|
|
72
|
-
onSubmit={onOtpSubmit}
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { Linking } from 'react-native';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { useSnapshot } from 'valtio';
|
|
4
|
-
import { Button, FlexView, IconLink, Link, Text, Visual } from '@reown/appkit-ui-react-native';
|
|
5
|
-
import {
|
|
6
|
-
AccountController,
|
|
7
|
-
ConnectorController,
|
|
8
|
-
EventsController,
|
|
9
|
-
ModalController,
|
|
10
|
-
NetworkController,
|
|
11
|
-
RouterController,
|
|
12
|
-
SnackController,
|
|
13
|
-
type AppKitFrameProvider
|
|
14
|
-
} from '@reown/appkit-core-react-native';
|
|
15
|
-
import styles from './styles';
|
|
16
|
-
|
|
17
|
-
export function UpgradeToSmartAccountView() {
|
|
18
|
-
const { address } = useSnapshot(AccountController.state);
|
|
19
|
-
const { loading } = useSnapshot(ModalController.state);
|
|
20
|
-
const [initialAddress] = useState(address);
|
|
21
|
-
|
|
22
|
-
const onSwitchAccountType = async () => {
|
|
23
|
-
try {
|
|
24
|
-
ModalController.setLoading(true);
|
|
25
|
-
const accountType =
|
|
26
|
-
AccountController.state.preferredAccountType === 'eoa' ? 'smartAccount' : 'eoa';
|
|
27
|
-
const provider = ConnectorController.getAuthConnector()?.provider as AppKitFrameProvider;
|
|
28
|
-
await provider?.setPreferredAccount(accountType);
|
|
29
|
-
EventsController.sendEvent({
|
|
30
|
-
type: 'track',
|
|
31
|
-
event: 'SET_PREFERRED_ACCOUNT_TYPE',
|
|
32
|
-
properties: {
|
|
33
|
-
accountType,
|
|
34
|
-
network: NetworkController.state.caipNetwork?.id || ''
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
} catch (error) {
|
|
38
|
-
ModalController.setLoading(false);
|
|
39
|
-
SnackController.showError('Error switching account type');
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const onClose = () => {
|
|
44
|
-
ModalController.close();
|
|
45
|
-
ModalController.setLoading(false);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const onGoBack = () => {
|
|
49
|
-
RouterController.goBack();
|
|
50
|
-
ModalController.setLoading(false);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const onLearnMorePress = () => {
|
|
54
|
-
Linking.openURL('https://reown.com/faq');
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
// Go back if the address has changed
|
|
59
|
-
if (address && initialAddress !== address) {
|
|
60
|
-
RouterController.goBack();
|
|
61
|
-
}
|
|
62
|
-
}, [initialAddress, address]);
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<>
|
|
66
|
-
<IconLink
|
|
67
|
-
icon="close"
|
|
68
|
-
size="md"
|
|
69
|
-
onPress={onClose}
|
|
70
|
-
testID="header-close"
|
|
71
|
-
style={styles.closeButton}
|
|
72
|
-
/>
|
|
73
|
-
|
|
74
|
-
<FlexView style={styles.container} padding={['4xl', 'm', '2xl', 'm']}>
|
|
75
|
-
<FlexView alignItems="center" justifyContent="center" flexDirection="row">
|
|
76
|
-
<Visual name="google" />
|
|
77
|
-
<Visual style={styles.middleIcon} name="pencil" />
|
|
78
|
-
<Visual name="lightbulb" />
|
|
79
|
-
</FlexView>
|
|
80
|
-
<Text variant="medium-600" color="fg-100" style={styles.title}>
|
|
81
|
-
Discover Smart Accounts
|
|
82
|
-
</Text>
|
|
83
|
-
<Text variant="paragraph-400" color="fg-100" center>
|
|
84
|
-
Access advanced brand new features as username, improved security and a smoother user
|
|
85
|
-
experience!
|
|
86
|
-
</Text>
|
|
87
|
-
<FlexView flexDirection="row" margin={['m', '4xl', 'm', '4xl']}>
|
|
88
|
-
<Button
|
|
89
|
-
variant="accent"
|
|
90
|
-
onPress={onGoBack}
|
|
91
|
-
disabled={loading}
|
|
92
|
-
style={[styles.button, styles.cancelButton]}
|
|
93
|
-
>
|
|
94
|
-
Do it later
|
|
95
|
-
</Button>
|
|
96
|
-
<Button onPress={onSwitchAccountType} loading={loading} style={styles.button}>
|
|
97
|
-
Continue
|
|
98
|
-
</Button>
|
|
99
|
-
</FlexView>
|
|
100
|
-
<Link onPress={onLearnMorePress} iconRight="externalLink">
|
|
101
|
-
Learn more
|
|
102
|
-
</Link>
|
|
103
|
-
</FlexView>
|
|
104
|
-
</>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Spacing } from '@reown/appkit-ui-react-native';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export default StyleSheet.create({
|
|
5
|
-
container: {
|
|
6
|
-
justifyContent: 'center',
|
|
7
|
-
alignItems: 'center'
|
|
8
|
-
},
|
|
9
|
-
title: {
|
|
10
|
-
marginTop: Spacing.xl,
|
|
11
|
-
marginVertical: Spacing.s
|
|
12
|
-
},
|
|
13
|
-
button: {
|
|
14
|
-
width: 110
|
|
15
|
-
},
|
|
16
|
-
cancelButton: {
|
|
17
|
-
marginRight: Spacing.m
|
|
18
|
-
},
|
|
19
|
-
middleIcon: {
|
|
20
|
-
marginHorizontal: Spacing.s
|
|
21
|
-
},
|
|
22
|
-
closeButton: {
|
|
23
|
-
alignSelf: 'flex-end',
|
|
24
|
-
right: Spacing.xl,
|
|
25
|
-
top: Spacing.l,
|
|
26
|
-
position: 'absolute',
|
|
27
|
-
zIndex: 2
|
|
28
|
-
}
|
|
29
|
-
});
|