@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.
Files changed (168) hide show
  1. package/lib/commonjs/AppKit.js +18 -11
  2. package/lib/commonjs/AppKit.js.map +1 -1
  3. package/lib/commonjs/connectors/WalletConnectConnector.js +15 -3
  4. package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
  5. package/lib/commonjs/modal/w3m-router/index.js +0 -9
  6. package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
  7. package/lib/commonjs/partials/w3m-account-activity/index.js +4 -4
  8. package/lib/commonjs/partials/w3m-account-activity/index.js.map +1 -1
  9. package/lib/commonjs/partials/w3m-account-tokens/index.js +11 -10
  10. package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
  11. package/lib/commonjs/partials/w3m-account-wallet-features/index.js +10 -10
  12. package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
  13. package/lib/commonjs/partials/w3m-header/index.js +0 -3
  14. package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
  15. package/lib/commonjs/partials/w3m-send-input-token/index.js +3 -3
  16. package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
  17. package/lib/commonjs/partials/w3m-send-input-token/utils.js +2 -2
  18. package/lib/commonjs/partials/w3m-send-input-token/utils.js.map +1 -1
  19. package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js +4 -13
  20. package/lib/commonjs/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
  21. package/lib/commonjs/views/w3m-account-default-view/index.js +19 -32
  22. package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
  23. package/lib/commonjs/views/w3m-account-view/index.js +11 -22
  24. package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
  25. package/lib/commonjs/views/w3m-account-view/styles.js +0 -5
  26. package/lib/commonjs/views/w3m-account-view/styles.js.map +1 -1
  27. package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js +14 -7
  28. package/lib/commonjs/views/w3m-connect-view/components/social-login-list.js.map +1 -1
  29. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +10 -8
  30. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
  31. package/lib/commonjs/views/w3m-connecting-social-view/index.js +1 -1
  32. package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
  33. package/lib/commonjs/views/w3m-swap-view/index.js +1 -1
  34. package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
  35. package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +5 -4
  36. package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
  37. package/lib/commonjs/views/w3m-wallet-receive-view/index.js +10 -12
  38. package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
  39. package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js +1 -1
  40. package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js.map +1 -1
  41. package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js +7 -9
  42. package/lib/commonjs/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
  43. package/lib/commonjs/views/w3m-wallet-send-view/index.js +5 -5
  44. package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
  45. package/lib/module/AppKit.js +18 -11
  46. package/lib/module/AppKit.js.map +1 -1
  47. package/lib/module/connectors/WalletConnectConnector.js +15 -3
  48. package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
  49. package/lib/module/modal/w3m-router/index.js +0 -9
  50. package/lib/module/modal/w3m-router/index.js.map +1 -1
  51. package/lib/module/partials/w3m-account-activity/index.js +5 -5
  52. package/lib/module/partials/w3m-account-activity/index.js.map +1 -1
  53. package/lib/module/partials/w3m-account-tokens/index.js +12 -11
  54. package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
  55. package/lib/module/partials/w3m-account-wallet-features/index.js +11 -11
  56. package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
  57. package/lib/module/partials/w3m-header/index.js +0 -3
  58. package/lib/module/partials/w3m-header/index.js.map +1 -1
  59. package/lib/module/partials/w3m-send-input-token/index.js +3 -3
  60. package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
  61. package/lib/module/partials/w3m-send-input-token/utils.js +2 -2
  62. package/lib/module/partials/w3m-send-input-token/utils.js.map +1 -1
  63. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js +5 -14
  64. package/lib/module/views/w3m-account-default-view/components/auth-buttons.js.map +1 -1
  65. package/lib/module/views/w3m-account-default-view/index.js +20 -33
  66. package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
  67. package/lib/module/views/w3m-account-view/index.js +13 -24
  68. package/lib/module/views/w3m-account-view/index.js.map +1 -1
  69. package/lib/module/views/w3m-account-view/styles.js +0 -5
  70. package/lib/module/views/w3m-account-view/styles.js.map +1 -1
  71. package/lib/module/views/w3m-connect-view/components/social-login-list.js +14 -7
  72. package/lib/module/views/w3m-connect-view/components/social-login-list.js.map +1 -1
  73. package/lib/module/views/w3m-connecting-siwe-view/index.js +11 -9
  74. package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
  75. package/lib/module/views/w3m-connecting-social-view/index.js +1 -1
  76. package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
  77. package/lib/module/views/w3m-swap-view/index.js +2 -2
  78. package/lib/module/views/w3m-swap-view/index.js.map +1 -1
  79. package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +6 -5
  80. package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
  81. package/lib/module/views/w3m-wallet-receive-view/index.js +11 -13
  82. package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
  83. package/lib/module/views/w3m-wallet-send-preview-view/index.js +1 -1
  84. package/lib/module/views/w3m-wallet-send-preview-view/index.js.map +1 -1
  85. package/lib/module/views/w3m-wallet-send-select-token-view/index.js +8 -10
  86. package/lib/module/views/w3m-wallet-send-select-token-view/index.js.map +1 -1
  87. package/lib/module/views/w3m-wallet-send-view/index.js +6 -6
  88. package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
  89. package/lib/typescript/AppKit.d.ts +1 -1
  90. package/lib/typescript/AppKit.d.ts.map +1 -1
  91. package/lib/typescript/connectors/WalletConnectConnector.d.ts +2 -2
  92. package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
  93. package/lib/typescript/hooks/useAppKitEvents.d.ts +0 -9
  94. package/lib/typescript/hooks/useAppKitEvents.d.ts.map +1 -1
  95. package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
  96. package/lib/typescript/partials/w3m-account-activity/index.d.ts.map +1 -1
  97. package/lib/typescript/partials/w3m-account-tokens/index.d.ts.map +1 -1
  98. package/lib/typescript/partials/w3m-account-wallet-features/index.d.ts.map +1 -1
  99. package/lib/typescript/partials/w3m-header/index.d.ts.map +1 -1
  100. package/lib/typescript/views/w3m-account-default-view/components/auth-buttons.d.ts.map +1 -1
  101. package/lib/typescript/views/w3m-account-default-view/index.d.ts.map +1 -1
  102. package/lib/typescript/views/w3m-account-view/index.d.ts.map +1 -1
  103. package/lib/typescript/views/w3m-account-view/styles.d.ts +0 -5
  104. package/lib/typescript/views/w3m-account-view/styles.d.ts.map +1 -1
  105. package/lib/typescript/views/w3m-connect-view/components/social-login-list.d.ts.map +1 -1
  106. package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
  107. package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
  108. package/lib/typescript/views/w3m-wallet-compatible-networks-view/index.d.ts.map +1 -1
  109. package/lib/typescript/views/w3m-wallet-receive-view/index.d.ts.map +1 -1
  110. package/lib/typescript/views/w3m-wallet-send-select-token-view/index.d.ts.map +1 -1
  111. package/package.json +5 -5
  112. package/src/AppKit.ts +24 -12
  113. package/src/connectors/WalletConnectConnector.ts +25 -6
  114. package/src/modal/w3m-router/index.tsx +0 -9
  115. package/src/partials/w3m-account-activity/index.tsx +4 -5
  116. package/src/partials/w3m-account-tokens/index.tsx +10 -9
  117. package/src/partials/w3m-account-wallet-features/index.tsx +7 -15
  118. package/src/partials/w3m-header/index.tsx +0 -3
  119. package/src/partials/w3m-send-input-token/index.tsx +4 -4
  120. package/src/partials/w3m-send-input-token/utils.ts +2 -2
  121. package/src/views/w3m-account-default-view/components/auth-buttons.tsx +4 -15
  122. package/src/views/w3m-account-default-view/index.tsx +23 -36
  123. package/src/views/w3m-account-view/index.tsx +9 -26
  124. package/src/views/w3m-account-view/styles.ts +0 -5
  125. package/src/views/w3m-connect-view/components/social-login-list.tsx +13 -5
  126. package/src/views/w3m-connecting-siwe-view/index.tsx +6 -17
  127. package/src/views/w3m-connecting-social-view/index.tsx +1 -1
  128. package/src/views/w3m-swap-view/index.tsx +1 -2
  129. package/src/views/w3m-wallet-compatible-networks-view/index.tsx +9 -11
  130. package/src/views/w3m-wallet-receive-view/index.tsx +16 -10
  131. package/src/views/w3m-wallet-send-preview-view/index.tsx +1 -1
  132. package/src/views/w3m-wallet-send-select-token-view/index.tsx +7 -9
  133. package/src/views/w3m-wallet-send-view/index.tsx +5 -5
  134. package/lib/commonjs/views/w3m-email-verify-device-view/index.js +0 -106
  135. package/lib/commonjs/views/w3m-email-verify-device-view/index.js.map +0 -1
  136. package/lib/commonjs/views/w3m-email-verify-device-view/styles.js +0 -25
  137. package/lib/commonjs/views/w3m-email-verify-device-view/styles.js.map +0 -1
  138. package/lib/commonjs/views/w3m-email-verify-otp-view/index.js +0 -86
  139. package/lib/commonjs/views/w3m-email-verify-otp-view/index.js.map +0 -1
  140. package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/index.js +0 -103
  141. package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/index.js.map +0 -1
  142. package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/styles.js +0 -35
  143. package/lib/commonjs/views/w3m-upgrade-to-smart-account-view/styles.js.map +0 -1
  144. package/lib/module/views/w3m-email-verify-device-view/index.js +0 -99
  145. package/lib/module/views/w3m-email-verify-device-view/index.js.map +0 -1
  146. package/lib/module/views/w3m-email-verify-device-view/styles.js +0 -19
  147. package/lib/module/views/w3m-email-verify-device-view/styles.js.map +0 -1
  148. package/lib/module/views/w3m-email-verify-otp-view/index.js +0 -79
  149. package/lib/module/views/w3m-email-verify-otp-view/index.js.map +0 -1
  150. package/lib/module/views/w3m-upgrade-to-smart-account-view/index.js +0 -96
  151. package/lib/module/views/w3m-upgrade-to-smart-account-view/index.js.map +0 -1
  152. package/lib/module/views/w3m-upgrade-to-smart-account-view/styles.js +0 -29
  153. package/lib/module/views/w3m-upgrade-to-smart-account-view/styles.js.map +0 -1
  154. package/lib/typescript/views/w3m-email-verify-device-view/index.d.ts +0 -2
  155. package/lib/typescript/views/w3m-email-verify-device-view/index.d.ts.map +0 -1
  156. package/lib/typescript/views/w3m-email-verify-device-view/styles.d.ts +0 -18
  157. package/lib/typescript/views/w3m-email-verify-device-view/styles.d.ts.map +0 -1
  158. package/lib/typescript/views/w3m-email-verify-otp-view/index.d.ts +0 -2
  159. package/lib/typescript/views/w3m-email-verify-otp-view/index.d.ts.map +0 -1
  160. package/lib/typescript/views/w3m-upgrade-to-smart-account-view/index.d.ts +0 -2
  161. package/lib/typescript/views/w3m-upgrade-to-smart-account-view/index.d.ts.map +0 -1
  162. package/lib/typescript/views/w3m-upgrade-to-smart-account-view/styles.d.ts +0 -28
  163. package/lib/typescript/views/w3m-upgrade-to-smart-account-view/styles.d.ts.map +0 -1
  164. package/src/views/w3m-email-verify-device-view/index.tsx +0 -80
  165. package/src/views/w3m-email-verify-device-view/styles.ts +0 -19
  166. package/src/views/w3m-email-verify-otp-view/index.tsx +0 -75
  167. package/src/views/w3m-upgrade-to-smart-account-view/index.tsx +0 -106
  168. 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
- });