@reown/appkit-react-native 0.0.0-feat-multi-social-20250708154835 → 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 +13 -1
- package/lib/commonjs/AppKit.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-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/views/w3m-account-default-view/index.js +11 -4
- package/lib/commonjs/views/w3m-account-default-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-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-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/module/AppKit.js +13 -1
- package/lib/module/AppKit.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-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/views/w3m-account-default-view/index.js +11 -4
- package/lib/module/views/w3m-account-default-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-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-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/typescript/AppKit.d.ts +2 -1
- package/lib/typescript/AppKit.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.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-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-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-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/package.json +5 -5
- package/src/AppKit.ts +36 -21
- package/src/client.ts +12 -41
- package/src/connectors/WalletConnectConnector.ts +4 -2
- package/src/modal/w3m-router/index.tsx +0 -9
- package/src/partials/w3m-connecting-qrcode/index.tsx +3 -4
- package/src/partials/w3m-header/index.tsx +0 -3
- package/src/views/w3m-account-default-view/index.tsx +13 -2
- 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-onramp-transaction-view/index.tsx +2 -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/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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-update-email-wallet-view/index.tsx"],"names":[],"mappings":"AAeA,wBAAgB,qBAAqB,4CAgFpC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
container: {
|
|
3
|
-
justifyContent: "center";
|
|
4
|
-
alignItems: "center";
|
|
5
|
-
};
|
|
6
|
-
emailInput: {
|
|
7
|
-
marginBottom: number;
|
|
8
|
-
};
|
|
9
|
-
cancelButton: {
|
|
10
|
-
flex: number;
|
|
11
|
-
height: number;
|
|
12
|
-
marginRight: number;
|
|
13
|
-
borderRadius: number;
|
|
14
|
-
};
|
|
15
|
-
saveButton: {
|
|
16
|
-
flex: number;
|
|
17
|
-
height: number;
|
|
18
|
-
marginLeft: number;
|
|
19
|
-
borderRadius: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
23
|
-
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-update-email-wallet-view/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,wBAoBG"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
ConnectorController,
|
|
5
|
-
CoreHelperUtil,
|
|
6
|
-
EventsController,
|
|
7
|
-
RouterController,
|
|
8
|
-
SnackController,
|
|
9
|
-
type AppKitFrameProvider
|
|
10
|
-
} from '@reown/appkit-core-react-native';
|
|
11
|
-
|
|
12
|
-
import { OtpCodeView } from '../../partials/w3m-otp-code';
|
|
13
|
-
|
|
14
|
-
export function UpdateEmailPrimaryOtpView() {
|
|
15
|
-
const { data } = RouterController.state;
|
|
16
|
-
const [loading, setLoading] = useState(false);
|
|
17
|
-
const [error, setError] = useState('');
|
|
18
|
-
const authProvider = ConnectorController.getAuthConnector()?.provider as
|
|
19
|
-
| AppKitFrameProvider
|
|
20
|
-
| undefined;
|
|
21
|
-
|
|
22
|
-
const onOtpSubmit = async (value: string) => {
|
|
23
|
-
if (!authProvider || loading) return;
|
|
24
|
-
setLoading(true);
|
|
25
|
-
setError('');
|
|
26
|
-
try {
|
|
27
|
-
await authProvider.updateEmailPrimaryOtp({ otp: value });
|
|
28
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_PASS' });
|
|
29
|
-
RouterController.replace('UpdateEmailSecondaryOtp', data);
|
|
30
|
-
} catch (e) {
|
|
31
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_FAIL' });
|
|
32
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
33
|
-
if (parsedError?.includes('Invalid Otp')) {
|
|
34
|
-
setError('Invalid code. Try again.');
|
|
35
|
-
} else {
|
|
36
|
-
SnackController.showError(parsedError);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
setLoading(false);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<OtpCodeView
|
|
44
|
-
loading={loading}
|
|
45
|
-
error={error}
|
|
46
|
-
email={data?.email}
|
|
47
|
-
onSubmit={onOtpSubmit}
|
|
48
|
-
onRetry={RouterController.goBack}
|
|
49
|
-
codeExpiry={10}
|
|
50
|
-
retryLabel="Something wrong?"
|
|
51
|
-
retryDisabledButtonLabel="Try again"
|
|
52
|
-
retryButtonLabel="Try again"
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { useSnapshot } from 'valtio';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
ConnectorController,
|
|
6
|
-
CoreHelperUtil,
|
|
7
|
-
RouterController,
|
|
8
|
-
SnackController,
|
|
9
|
-
EventsController,
|
|
10
|
-
type AppKitFrameProvider
|
|
11
|
-
} from '@reown/appkit-core-react-native';
|
|
12
|
-
|
|
13
|
-
import { OtpCodeView } from '../../partials/w3m-otp-code';
|
|
14
|
-
|
|
15
|
-
export function UpdateEmailSecondaryOtpView() {
|
|
16
|
-
const { data } = useSnapshot(RouterController.state);
|
|
17
|
-
const [loading, setLoading] = useState(false);
|
|
18
|
-
const [error, setError] = useState('');
|
|
19
|
-
const authConnector = ConnectorController.getAuthConnector();
|
|
20
|
-
|
|
21
|
-
const onOtpSubmit = async (value: string) => {
|
|
22
|
-
if (!authConnector) return;
|
|
23
|
-
setLoading(true);
|
|
24
|
-
setError('');
|
|
25
|
-
try {
|
|
26
|
-
const provider = authConnector?.provider as AppKitFrameProvider;
|
|
27
|
-
await provider.updateEmailSecondaryOtp({ otp: value });
|
|
28
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_PASS' });
|
|
29
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_EDIT_COMPLETE' });
|
|
30
|
-
RouterController.reset('Account');
|
|
31
|
-
} catch (e) {
|
|
32
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_VERIFICATION_CODE_FAIL' });
|
|
33
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
34
|
-
if (parsedError?.includes('Invalid Otp')) {
|
|
35
|
-
setError('Invalid code. Try again.');
|
|
36
|
-
} else {
|
|
37
|
-
SnackController.showError(parsedError);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
setLoading(false);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<OtpCodeView
|
|
45
|
-
loading={loading}
|
|
46
|
-
error={error}
|
|
47
|
-
email={data?.newEmail}
|
|
48
|
-
onSubmit={onOtpSubmit}
|
|
49
|
-
onRetry={RouterController.goBack}
|
|
50
|
-
codeExpiry={10}
|
|
51
|
-
retryLabel="Something wrong?"
|
|
52
|
-
retryDisabledButtonLabel="Try again"
|
|
53
|
-
retryButtonLabel="Try again"
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
ConnectorController,
|
|
5
|
-
CoreHelperUtil,
|
|
6
|
-
RouterController,
|
|
7
|
-
SnackController,
|
|
8
|
-
EventsController,
|
|
9
|
-
type AppKitFrameProvider
|
|
10
|
-
} from '@reown/appkit-core-react-native';
|
|
11
|
-
import { Button, EmailInput, FlexView, Spacing, Text } from '@reown/appkit-ui-react-native';
|
|
12
|
-
import { useKeyboard } from '../../hooks/useKeyboard';
|
|
13
|
-
|
|
14
|
-
import styles from './styles';
|
|
15
|
-
|
|
16
|
-
export function UpdateEmailWalletView() {
|
|
17
|
-
const { data } = RouterController.state;
|
|
18
|
-
const [loading, setLoading] = useState(false);
|
|
19
|
-
const [error, setError] = useState('');
|
|
20
|
-
const [email, setEmail] = useState(data?.email || '');
|
|
21
|
-
const [isValidNewEmail, setIsValidNewEmail] = useState(false);
|
|
22
|
-
const authConnector = ConnectorController.getAuthConnector();
|
|
23
|
-
const { keyboardShown, keyboardHeight } = useKeyboard();
|
|
24
|
-
const paddingBottom = Platform.select({
|
|
25
|
-
android: keyboardShown ? keyboardHeight + Spacing.l : Spacing.l,
|
|
26
|
-
default: Spacing.l
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const onChangeText = (value: string) => {
|
|
30
|
-
setIsValidNewEmail(data?.email !== value && CoreHelperUtil.isValidEmail(value));
|
|
31
|
-
setEmail(value);
|
|
32
|
-
setError('');
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const onEmailSubmit = async (value: string) => {
|
|
36
|
-
if (!authConnector) return;
|
|
37
|
-
|
|
38
|
-
const provider = authConnector.provider as AppKitFrameProvider;
|
|
39
|
-
setLoading(true);
|
|
40
|
-
setError('');
|
|
41
|
-
|
|
42
|
-
try {
|
|
43
|
-
const response = await provider.updateEmail({ email: value });
|
|
44
|
-
EventsController.sendEvent({ type: 'track', event: 'EMAIL_EDIT' });
|
|
45
|
-
if (response.action === 'VERIFY_SECONDARY_OTP') {
|
|
46
|
-
RouterController.push('UpdateEmailSecondaryOtp', { email: data?.email, newEmail: value });
|
|
47
|
-
} else {
|
|
48
|
-
RouterController.push('UpdateEmailPrimaryOtp', { email: data?.email, newEmail: value });
|
|
49
|
-
}
|
|
50
|
-
} catch (e) {
|
|
51
|
-
const parsedError = CoreHelperUtil.parseError(e);
|
|
52
|
-
if (parsedError?.includes('Invalid email')) {
|
|
53
|
-
setError('Invalid email. Try again.');
|
|
54
|
-
} else {
|
|
55
|
-
SnackController.showError(parsedError);
|
|
56
|
-
}
|
|
57
|
-
} finally {
|
|
58
|
-
setLoading(false);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<FlexView padding={['l', 's', '0', 's']} style={{ paddingBottom }}>
|
|
64
|
-
<EmailInput
|
|
65
|
-
initialValue={data?.email}
|
|
66
|
-
onSubmit={onEmailSubmit}
|
|
67
|
-
submitEnabled={isValidNewEmail}
|
|
68
|
-
onChangeText={onChangeText}
|
|
69
|
-
loading={loading}
|
|
70
|
-
errorMessage={error}
|
|
71
|
-
style={styles.emailInput}
|
|
72
|
-
autoFocus
|
|
73
|
-
/>
|
|
74
|
-
<FlexView
|
|
75
|
-
flexDirection="row"
|
|
76
|
-
justifyContent="center"
|
|
77
|
-
alignItems="center"
|
|
78
|
-
margin={['0', 'xs', '0', 'xs']}
|
|
79
|
-
>
|
|
80
|
-
<Button onPress={RouterController.goBack} variant="shade" style={styles.cancelButton}>
|
|
81
|
-
<Text variant="paragraph-600" color="fg-100">
|
|
82
|
-
Cancel
|
|
83
|
-
</Text>
|
|
84
|
-
</Button>
|
|
85
|
-
<Button
|
|
86
|
-
onPress={() => onEmailSubmit(email)}
|
|
87
|
-
variant="fill"
|
|
88
|
-
style={styles.saveButton}
|
|
89
|
-
disabled={loading || !isValidNewEmail}
|
|
90
|
-
>
|
|
91
|
-
Save
|
|
92
|
-
</Button>
|
|
93
|
-
</FlexView>
|
|
94
|
-
</FlexView>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BorderRadius, 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
|
-
emailInput: {
|
|
10
|
-
marginBottom: Spacing.s
|
|
11
|
-
},
|
|
12
|
-
cancelButton: {
|
|
13
|
-
flex: 1,
|
|
14
|
-
height: 48,
|
|
15
|
-
marginRight: Spacing['2xs'],
|
|
16
|
-
borderRadius: BorderRadius.xs
|
|
17
|
-
},
|
|
18
|
-
saveButton: {
|
|
19
|
-
flex: 1,
|
|
20
|
-
height: 48,
|
|
21
|
-
marginLeft: Spacing['2xs'],
|
|
22
|
-
borderRadius: BorderRadius.xs
|
|
23
|
-
}
|
|
24
|
-
});
|