@reown/appkit-react-native 0.0.0-feat-multichain-20250902153701 → 0.0.0-feat-multichain-20250903180809

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 (70) hide show
  1. package/lib/commonjs/connectors/WalletConnectConnector.js +6 -3
  2. package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
  3. package/lib/commonjs/partials/w3m-connecting-mobile/styles.js +2 -1
  4. package/lib/commonjs/partials/w3m-connecting-mobile/styles.js.map +1 -1
  5. package/lib/commonjs/partials/w3m-connecting-web/index.js +1 -0
  6. package/lib/commonjs/partials/w3m-connecting-web/index.js.map +1 -1
  7. package/lib/commonjs/partials/w3m-connecting-web/styles.js +3 -0
  8. package/lib/commonjs/partials/w3m-connecting-web/styles.js.map +1 -1
  9. package/lib/commonjs/partials/w3m-header/index.js +2 -2
  10. package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
  11. package/lib/commonjs/views/w3m-connecting-external-view/styles.js +2 -1
  12. package/lib/commonjs/views/w3m-connecting-external-view/styles.js.map +1 -1
  13. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js +55 -54
  14. package/lib/commonjs/views/w3m-connecting-siwe-view/index.js.map +1 -1
  15. package/lib/commonjs/views/w3m-connecting-siwe-view/styles.js +3 -7
  16. package/lib/commonjs/views/w3m-connecting-siwe-view/styles.js.map +1 -1
  17. package/lib/commonjs/views/w3m-connecting-social-view/index.js +1 -0
  18. package/lib/commonjs/views/w3m-connecting-social-view/index.js.map +1 -1
  19. package/lib/commonjs/views/w3m-connecting-social-view/styles.js +3 -0
  20. package/lib/commonjs/views/w3m-connecting-social-view/styles.js.map +1 -1
  21. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js +1 -2
  22. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -1
  23. package/lib/module/connectors/WalletConnectConnector.js +6 -3
  24. package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
  25. package/lib/module/partials/w3m-connecting-mobile/styles.js +2 -1
  26. package/lib/module/partials/w3m-connecting-mobile/styles.js.map +1 -1
  27. package/lib/module/partials/w3m-connecting-web/index.js +1 -0
  28. package/lib/module/partials/w3m-connecting-web/index.js.map +1 -1
  29. package/lib/module/partials/w3m-connecting-web/styles.js +3 -0
  30. package/lib/module/partials/w3m-connecting-web/styles.js.map +1 -1
  31. package/lib/module/partials/w3m-header/index.js +2 -2
  32. package/lib/module/partials/w3m-header/index.js.map +1 -1
  33. package/lib/module/views/w3m-connecting-external-view/styles.js +2 -1
  34. package/lib/module/views/w3m-connecting-external-view/styles.js.map +1 -1
  35. package/lib/module/views/w3m-connecting-siwe-view/index.js +56 -55
  36. package/lib/module/views/w3m-connecting-siwe-view/index.js.map +1 -1
  37. package/lib/module/views/w3m-connecting-siwe-view/styles.js +3 -7
  38. package/lib/module/views/w3m-connecting-siwe-view/styles.js.map +1 -1
  39. package/lib/module/views/w3m-connecting-social-view/index.js +1 -0
  40. package/lib/module/views/w3m-connecting-social-view/index.js.map +1 -1
  41. package/lib/module/views/w3m-connecting-social-view/styles.js +3 -0
  42. package/lib/module/views/w3m-connecting-social-view/styles.js.map +1 -1
  43. package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js +1 -2
  44. package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -1
  45. package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
  46. package/lib/typescript/partials/w3m-connecting-mobile/styles.d.ts +1 -0
  47. package/lib/typescript/partials/w3m-connecting-mobile/styles.d.ts.map +1 -1
  48. package/lib/typescript/partials/w3m-connecting-web/styles.d.ts +3 -0
  49. package/lib/typescript/partials/w3m-connecting-web/styles.d.ts.map +1 -1
  50. package/lib/typescript/views/w3m-connecting-external-view/styles.d.ts +1 -0
  51. package/lib/typescript/views/w3m-connecting-external-view/styles.d.ts.map +1 -1
  52. package/lib/typescript/views/w3m-connecting-siwe-view/index.d.ts.map +1 -1
  53. package/lib/typescript/views/w3m-connecting-siwe-view/styles.d.ts +3 -7
  54. package/lib/typescript/views/w3m-connecting-siwe-view/styles.d.ts.map +1 -1
  55. package/lib/typescript/views/w3m-connecting-social-view/index.d.ts.map +1 -1
  56. package/lib/typescript/views/w3m-connecting-social-view/styles.d.ts +3 -0
  57. package/lib/typescript/views/w3m-connecting-social-view/styles.d.ts.map +1 -1
  58. package/lib/typescript/views/w3m-swap-view/components/select-token-modal/index.d.ts.map +1 -1
  59. package/package.json +5 -5
  60. package/src/connectors/WalletConnectConnector.ts +7 -4
  61. package/src/partials/w3m-connecting-mobile/styles.ts +2 -1
  62. package/src/partials/w3m-connecting-web/index.tsx +1 -1
  63. package/src/partials/w3m-connecting-web/styles.ts +3 -0
  64. package/src/partials/w3m-header/index.tsx +2 -2
  65. package/src/views/w3m-connecting-external-view/styles.ts +2 -1
  66. package/src/views/w3m-connecting-siwe-view/index.tsx +46 -42
  67. package/src/views/w3m-connecting-siwe-view/styles.ts +3 -7
  68. package/src/views/w3m-connecting-social-view/index.tsx +6 -1
  69. package/src/views/w3m-connecting-social-view/styles.ts +3 -0
  70. package/src/views/w3m-swap-view/components/select-token-modal/index.tsx +2 -4
@@ -207,13 +207,16 @@ export class WalletConnectConnector extends WalletConnector {
207
207
  throw new Error('WalletConnectConnector: Provider not initialized. Call init() first.');
208
208
  }
209
209
 
210
- const provider = this.provider as IUniversalProvider;
210
+ const provider = this.provider;
211
211
 
212
212
  if (namespace) {
213
- // @ts-ignore
214
213
  return {
215
- ...provider,
216
- request: (args: RequestArguments, chainId?: CaipNetworkId) => {
214
+ ...this.provider,
215
+ connect: async (params?: any) => provider.connect(params) as Promise<any>,
216
+ disconnect: provider.disconnect.bind(provider),
217
+ on: provider.on.bind(provider),
218
+ off: provider.off.bind(provider),
219
+ request: async (args: RequestArguments, chainId?: CaipNetworkId) => {
217
220
  const _chainId = this.getChainId(namespace);
218
221
 
219
222
  return provider.request(args, chainId || _chainId);
@@ -3,7 +3,8 @@ import { Spacing } from '@reown/appkit-ui-react-native';
3
3
 
4
4
  export default StyleSheet.create({
5
5
  container: {
6
- paddingBottom: Spacing['3xl']
6
+ paddingBottom: Spacing['3xl'],
7
+ minHeight: '30%'
7
8
  },
8
9
  retryButton: {
9
10
  marginTop: Spacing.m
@@ -65,7 +65,7 @@ export function ConnectingWeb({ onCopyUri }: ConnectingWebProps) {
65
65
  }, [data?.wallet, wcUri]);
66
66
 
67
67
  return (
68
- <ScrollView bounces={false} fadingEdgeLength={20}>
68
+ <ScrollView bounces={false} fadingEdgeLength={20} contentContainerStyle={styles.container}>
69
69
  <FlexView alignItems="center" padding={['2xl', 'm', '3xl', 'm']}>
70
70
  <LoadingThumbnail paused={wcError}>
71
71
  <WalletImage
@@ -2,6 +2,9 @@ import { Spacing } from '@reown/appkit-ui-react-native';
2
2
  import { StyleSheet } from 'react-native';
3
3
 
4
4
  export default StyleSheet.create({
5
+ container: {
6
+ minHeight: '30%'
7
+ },
5
8
  openButton: {
6
9
  marginTop: Spacing.m
7
10
  },
@@ -32,7 +32,7 @@ export function Header() {
32
32
  Connect: 'Connect wallet',
33
33
  ConnectSocials: 'All socials',
34
34
  ConnectingExternal: walletName ?? 'Connect wallet',
35
- ConnectingSiwe: undefined,
35
+ ConnectingSiwe: 'Sign in',
36
36
  ConnectingSocial: socialName ?? 'Connecting Social',
37
37
  ConnectingWalletConnect: walletName ?? 'WalletConnect',
38
38
  GetWallet: 'Get a wallet',
@@ -58,7 +58,7 @@ export function Header() {
58
58
  }[_view];
59
59
  };
60
60
 
61
- const noCloseViews = ['OnRampSettings'];
61
+ const noCloseViews = ['OnRampSettings', 'ConnectingSiwe'];
62
62
  const noBackViews = ['UnsupportedChain'];
63
63
  const showClose = !noCloseViews.includes(view);
64
64
  const header = headings(data, view);
@@ -3,7 +3,8 @@ import { StyleSheet } from 'react-native';
3
3
 
4
4
  export default StyleSheet.create({
5
5
  container: {
6
- paddingBottom: Spacing['3xl']
6
+ paddingBottom: Spacing['3xl'],
7
+ minHeight: '30%'
7
8
  },
8
9
  retryButton: {
9
10
  marginTop: Spacing.m
@@ -5,8 +5,8 @@ import {
5
5
  Button,
6
6
  DoubleImageLoader,
7
7
  FlexView,
8
- IconLink,
9
- Text
8
+ Text,
9
+ useCustomDimensions
10
10
  } from '@reown/appkit-ui-react-native';
11
11
  import {
12
12
  ConnectionsController,
@@ -20,9 +20,11 @@ import { SIWEController } from '@reown/appkit-siwe-react-native';
20
20
 
21
21
  import { useInternalAppKit } from '../../AppKitContext';
22
22
  import styles from './styles';
23
+ import { ScrollView } from 'react-native';
23
24
 
24
25
  export function ConnectingSiweView() {
25
26
  const { disconnect } = useInternalAppKit();
27
+ const { padding } = useCustomDimensions();
26
28
  const { metadata } = useSnapshot(OptionsController.state);
27
29
  const { activeAddress, identity, walletInfo } = useSnapshot(ConnectionsController.state);
28
30
  const [isSigning, setIsSigning] = useState(false);
@@ -84,46 +86,48 @@ export function ConnectingSiweView() {
84
86
  };
85
87
 
86
88
  return (
87
- <FlexView padding={['2xl', 's', '3xl', 's']}>
88
- <IconLink
89
- icon="close"
90
- size="md"
91
- onPress={onCancel}
92
- testID="header-close"
93
- style={styles.closeButton}
94
- />
95
- <Text variant="paragraph-600" numberOfLines={1} center>
96
- Sign in
97
- </Text>
98
- <DoubleImageLoader
99
- style={styles.logoContainer}
100
- leftImage={dappIcon}
101
- rightImage={walletIcon}
102
- renderRightPlaceholder={() => (
103
- <Avatar imageSrc={identity?.avatar} address={activeAddress} size={60} borderWidth={0} />
104
- )}
105
- rightItemStyle={!walletIcon && styles.walletAvatar}
106
- />
107
- <Text center variant="medium-600" color="fg-100" style={styles.title}>
108
- {dappName} needs to connect to your wallet
109
- </Text>
110
- <Text center variant="small-400" color="fg-200" style={styles.subtitle}>
111
- Sign this message to prove you own this wallet and proceed. Cancelling will disconnect you
112
- </Text>
113
- <FlexView flexDirection="row" justifyContent="space-between" margin={['s', '0', '0', '0']}>
114
- <Button variant="shade" onPress={onCancel} style={styles.button} loading={isDisconnecting}>
115
- Cancel
116
- </Button>
117
- <Button
118
- variant="fill"
119
- loading={isSigning}
120
- disabled={isDisconnecting}
121
- onPress={onSign}
122
- style={styles.button}
123
- >
124
- Sign
125
- </Button>
89
+ <ScrollView
90
+ bounces={false}
91
+ fadingEdgeLength={20}
92
+ style={{ paddingHorizontal: padding }}
93
+ contentContainerStyle={styles.container}
94
+ >
95
+ <FlexView padding={['0', 's', '3xl', 's']}>
96
+ <DoubleImageLoader
97
+ style={styles.logoContainer}
98
+ leftImage={dappIcon}
99
+ rightImage={walletIcon}
100
+ renderRightPlaceholder={() => (
101
+ <Avatar imageSrc={identity?.avatar} address={activeAddress} size={60} borderWidth={0} />
102
+ )}
103
+ rightItemStyle={!walletIcon && styles.walletAvatar}
104
+ />
105
+ <Text center variant="medium-600" color="fg-100" style={styles.title}>
106
+ {dappName} needs to connect to your wallet
107
+ </Text>
108
+ <Text center variant="small-400" color="fg-200" style={styles.subtitle}>
109
+ Sign this message to prove you own this wallet and proceed. Cancelling will disconnect you
110
+ </Text>
111
+ <FlexView flexDirection="row" justifyContent="space-between" margin={['s', '0', '0', '0']}>
112
+ <Button
113
+ variant="shade"
114
+ onPress={onCancel}
115
+ style={styles.button}
116
+ loading={isDisconnecting}
117
+ >
118
+ Cancel
119
+ </Button>
120
+ <Button
121
+ variant="fill"
122
+ loading={isSigning}
123
+ disabled={isDisconnecting}
124
+ onPress={onSign}
125
+ style={styles.button}
126
+ >
127
+ Sign
128
+ </Button>
129
+ </FlexView>
126
130
  </FlexView>
127
- </FlexView>
131
+ </ScrollView>
128
132
  );
129
133
  }
@@ -2,6 +2,9 @@ import { BorderRadius, Spacing } from '@reown/appkit-ui-react-native';
2
2
  import { StyleSheet } from 'react-native';
3
3
 
4
4
  export default StyleSheet.create({
5
+ container: {
6
+ minHeight: '30%'
7
+ },
5
8
  logoContainer: {
6
9
  marginTop: Spacing.xl,
7
10
  marginBottom: Spacing.m
@@ -16,13 +19,6 @@ export default StyleSheet.create({
16
19
  marginHorizontal: '10%',
17
20
  marginVertical: Spacing.l
18
21
  },
19
- closeButton: {
20
- alignSelf: 'flex-end',
21
- right: Spacing.xl,
22
- top: Spacing.l,
23
- position: 'absolute',
24
- zIndex: 2
25
- },
26
22
  walletAvatar: {
27
23
  borderRadius: BorderRadius.full
28
24
  }
@@ -75,7 +75,12 @@ export function ConnectingSocialView() {
75
75
  }, [wcUri, onConnect]);
76
76
 
77
77
  return (
78
- <ScrollView bounces={false} fadingEdgeLength={20} style={{ paddingHorizontal: padding }}>
78
+ <ScrollView
79
+ bounces={false}
80
+ fadingEdgeLength={20}
81
+ style={{ paddingHorizontal: padding }}
82
+ contentContainerStyle={styles.container}
83
+ >
79
84
  <FlexView alignItems="center" alignSelf="center" padding={['2xl', 'l', '2xl', 'l']}>
80
85
  <LoadingThumbnail paused={!!error}>
81
86
  <Logo logo={data?.socialProvider ?? 'more'} height={72} width={72} />
@@ -2,6 +2,9 @@ import { StyleSheet } from 'react-native';
2
2
  import { Spacing } from '@reown/appkit-ui-react-native';
3
3
 
4
4
  export default StyleSheet.create({
5
+ container: {
6
+ minHeight: '30%'
7
+ },
5
8
  errorIcon: {
6
9
  position: 'absolute',
7
10
  bottom: 8,
@@ -56,16 +56,14 @@ export function SwapSelectTokenModal({ onClose, type, style, visible }: Props) {
56
56
  const [tokenSearch, setTokenSearch] = useState<string>('');
57
57
  const isSourceToken = type === 'sourceToken';
58
58
 
59
- const [filteredTokens, setFilteredTokens] = useState(
60
- createSections(isSourceToken, tokenSearch, myTokensWithBalance)
61
- );
59
+ const filteredTokens = createSections(isSourceToken, tokenSearch, myTokensWithBalance);
60
+
62
61
  const suggestedList = suggestedTokens
63
62
  ?.filter(token => token.address !== SwapController.state.sourceToken?.address)
64
63
  .slice(0, 8);
65
64
 
66
65
  const onSearchChange = (value: string) => {
67
66
  setTokenSearch(value);
68
- setFilteredTokens(createSections(isSourceToken, value, myTokensWithBalance));
69
67
  };
70
68
 
71
69
  const onTokenPress = (token: SwapTokenWithBalance) => {