@reown/appkit-react-native 0.0.0-feat-coinbase-20250722174423 → 0.0.0-feat-coinbase-20250722202925
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 +2 -3
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/utils/UiUtil.js +7 -4
- package/lib/commonjs/utils/UiUtil.js.map +1 -1
- package/lib/commonjs/views/w3m-all-wallets-view/index.js +11 -10
- package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js +2 -3
- package/lib/commonjs/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/all-wallets-button.js +1 -5
- package/lib/commonjs/views/w3m-connect-view/components/all-wallets-button.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js +2 -3
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js +2 -3
- package/lib/commonjs/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/index.js +19 -26
- package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js +22 -28
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js +3 -11
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/AppKit.js +2 -3
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/utils/UiUtil.js +7 -4
- package/lib/module/utils/UiUtil.js.map +1 -1
- package/lib/module/views/w3m-all-wallets-view/index.js +11 -10
- package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js +2 -3
- package/lib/module/views/w3m-connect-view/components/all-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/all-wallets-button.js +1 -5
- package/lib/module/views/w3m-connect-view/components/all-wallets-button.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js +2 -3
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js +2 -3
- package/lib/module/views/w3m-connect-view/components/recent-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connect-view/index.js +19 -26
- package/lib/module/views/w3m-connect-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js +23 -30
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-view/index.js +3 -11
- package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/utils/UiUtil.d.ts +1 -0
- package/lib/typescript/utils/UiUtil.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/all-wallet-list.d.ts +1 -2
- package/lib/typescript/views/w3m-connect-view/components/all-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/all-wallets-button.d.ts +1 -2
- package/lib/typescript/views/w3m-connect-view/components/all-wallets-button.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/custom-wallet-list.d.ts +1 -2
- package/lib/typescript/views/w3m-connect-view/components/custom-wallet-list.d.ts.map +1 -1
- package/lib/typescript/views/w3m-connect-view/components/recent-wallet-list.d.ts +1 -2
- package/lib/typescript/views/w3m-connect-view/components/recent-wallet-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-connecting-view/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/AppKit.ts +2 -3
- package/src/utils/UiUtil.ts +8 -4
- package/src/views/w3m-all-wallets-view/index.tsx +9 -7
- package/src/views/w3m-connect-view/components/all-wallet-list.tsx +2 -3
- package/src/views/w3m-connect-view/components/all-wallets-button.tsx +1 -6
- package/src/views/w3m-connect-view/components/custom-wallet-list.tsx +2 -3
- package/src/views/w3m-connect-view/components/recent-wallet-list.tsx +2 -3
- package/src/views/w3m-connect-view/index.tsx +20 -34
- package/src/views/w3m-connecting-external-view/index.tsx +21 -30
- package/src/views/w3m-connecting-view/index.tsx +3 -11
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useSnapshot } from 'valtio';
|
|
1
2
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
3
|
import { ScrollView } from 'react-native';
|
|
3
4
|
import {
|
|
@@ -5,7 +6,8 @@ import {
|
|
|
5
6
|
ApiController,
|
|
6
7
|
ModalController,
|
|
7
8
|
EventsController,
|
|
8
|
-
|
|
9
|
+
ConnectionController,
|
|
10
|
+
AssetUtil
|
|
9
11
|
} from '@reown/appkit-core-react-native';
|
|
10
12
|
import {
|
|
11
13
|
Button,
|
|
@@ -18,12 +20,13 @@ import {
|
|
|
18
20
|
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
19
21
|
import { ConnectingBody, getMessage, type BodyErrorType } from '../../partials/w3m-connecting-body';
|
|
20
22
|
import styles from './styles';
|
|
23
|
+
import { useAppKit } from '../../AppKitContext';
|
|
24
|
+
import { ConstantsUtil } from '@reown/appkit-common-react-native';
|
|
25
|
+
import { UiUtil } from '../../utils/UiUtil';
|
|
21
26
|
|
|
22
|
-
//TODO: check if this view is needed with Coinbase
|
|
23
27
|
export function ConnectingExternalView() {
|
|
24
|
-
const { data } = RouterController.state;
|
|
25
|
-
|
|
26
|
-
const connector = undefined;
|
|
28
|
+
const { data } = useSnapshot(RouterController.state);
|
|
29
|
+
const { connect } = useAppKit();
|
|
27
30
|
const { maxWidth: width } = useCustomDimensions();
|
|
28
31
|
const [errorType, setErrorType] = useState<BodyErrorType>();
|
|
29
32
|
const bodyMessage = getMessage({ walletName: data?.wallet?.name, errorType });
|
|
@@ -33,37 +36,25 @@ export function ConnectingExternalView() {
|
|
|
33
36
|
onConnect();
|
|
34
37
|
};
|
|
35
38
|
|
|
36
|
-
const storeConnectedWallet = useCallback(
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
|
-
async (wallet?: WcWallet) => {
|
|
40
|
-
// if (wallet) {
|
|
41
|
-
// const recentWallets = await StorageUtil.addRecentWallet(wallet);
|
|
42
|
-
// if (recentWallets) {
|
|
43
|
-
// ConnectionController.setRecentWallets(recentWallets);
|
|
44
|
-
// }
|
|
45
|
-
// }
|
|
46
|
-
// if (connector) {
|
|
47
|
-
// const url = AssetUtil.getConnectorImage(connector);
|
|
48
|
-
// ConnectionController.setConnectedWalletImageUrl(url);
|
|
49
|
-
// }
|
|
50
|
-
},
|
|
51
|
-
[]
|
|
52
|
-
);
|
|
53
|
-
|
|
54
39
|
const onConnect = useCallback(async () => {
|
|
55
40
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
const wallet = RouterController.state.data?.wallet;
|
|
42
|
+
if (wallet) {
|
|
43
|
+
if (wallet.id === ConstantsUtil.PHANTOM_EXPLORER_ID) {
|
|
44
|
+
await connect('phantom');
|
|
45
|
+
} else if (wallet.id === ConstantsUtil.COINBASE_EXPLORER_ID) {
|
|
46
|
+
await connect('coinbase');
|
|
47
|
+
}
|
|
48
|
+
UiUtil.storeRecentWallet(wallet);
|
|
49
|
+
ConnectionController.setPressedWallet(wallet);
|
|
59
50
|
ModalController.close();
|
|
60
51
|
EventsController.sendEvent({
|
|
61
52
|
type: 'track',
|
|
62
53
|
event: 'CONNECT_SUCCESS',
|
|
63
54
|
properties: {
|
|
64
|
-
name:
|
|
55
|
+
name: wallet?.name ?? 'Unknown',
|
|
65
56
|
method: 'mobile',
|
|
66
|
-
explorer_id:
|
|
57
|
+
explorer_id: wallet?.id
|
|
67
58
|
}
|
|
68
59
|
});
|
|
69
60
|
}
|
|
@@ -81,7 +72,7 @@ export function ConnectingExternalView() {
|
|
|
81
72
|
properties: { message: (error as Error)?.message ?? 'Unknown' }
|
|
82
73
|
});
|
|
83
74
|
}
|
|
84
|
-
}, [
|
|
75
|
+
}, [connect]);
|
|
85
76
|
|
|
86
77
|
useEffect(() => {
|
|
87
78
|
onConnect();
|
|
@@ -98,7 +89,7 @@ export function ConnectingExternalView() {
|
|
|
98
89
|
<LoadingThumbnail paused={!!errorType}>
|
|
99
90
|
<WalletImage
|
|
100
91
|
size="xl"
|
|
101
|
-
|
|
92
|
+
imageSrc={AssetUtil.getWalletImage(data?.wallet)}
|
|
102
93
|
imageHeaders={ApiController._getApiHeaders()}
|
|
103
94
|
/>
|
|
104
95
|
{errorType && (
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
ApiController,
|
|
12
12
|
EventsController
|
|
13
13
|
} from '@reown/appkit-core-react-native';
|
|
14
|
-
import { ConstantsUtil as CommonConstantsUtil } from '@reown/appkit-common-react-native';
|
|
15
14
|
import { useAppKit } from '../../AppKitContext';
|
|
16
15
|
import { ConnectingQrCode } from '../../partials/w3m-connecting-qrcode';
|
|
17
16
|
import { ConnectingMobile } from '../../partials/w3m-connecting-mobile';
|
|
@@ -47,16 +46,9 @@ export function ConnectingView() {
|
|
|
47
46
|
if (retry || CoreHelperUtil.isPairingExpired(wcPairingExpiry)) {
|
|
48
47
|
ConnectionController.setWcError(false);
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} else if (data?.wallet?.id === CommonConstantsUtil.COINBASE_EXPLORER_ID) {
|
|
54
|
-
connectPromise = connect('coinbase');
|
|
55
|
-
} else {
|
|
56
|
-
connectPromise = connect('walletconnect', {
|
|
57
|
-
universalLink: routeData?.wallet?.link_mode ?? undefined
|
|
58
|
-
});
|
|
59
|
-
}
|
|
49
|
+
const connectPromise = connect('walletconnect', {
|
|
50
|
+
universalLink: routeData?.wallet?.link_mode ?? undefined
|
|
51
|
+
});
|
|
60
52
|
ConnectionController.setWcPromise(connectPromise);
|
|
61
53
|
}
|
|
62
54
|
} catch (error) {
|