@reown/appkit-react-native 0.0.0-feat-multi-social-20250714211631 → 0.0.0-feat-coinbase-20250722173213
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 +45 -14
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/modal/w3m-account-button/index.js +4 -1
- package/lib/commonjs/modal/w3m-account-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-button/index.js +1 -1
- package/lib/commonjs/modal/w3m-button/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-modal/index.js +2 -1
- package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
- package/lib/commonjs/modal/w3m-network-button/index.js +11 -5
- package/lib/commonjs/modal/w3m-network-button/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-activity/index.js +13 -4
- package/lib/commonjs/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-tokens/index.js +4 -1
- package/lib/commonjs/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js +4 -2
- package/lib/commonjs/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-header/index.js +3 -1
- package/lib/commonjs/partials/w3m-header/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-selector-modal/index.js +4 -1
- package/lib/commonjs/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/index.js +10 -7
- package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-send-input-token/styles.js +3 -0
- package/lib/commonjs/partials/w3m-send-input-token/styles.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +6 -8
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/views/w3m-account-default-view/index.js +42 -15
- package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-account-view/index.js +6 -2
- package/lib/commonjs/views/w3m-account-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js +3 -1
- package/lib/commonjs/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-external-view/index.js +4 -3
- package/lib/commonjs/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js +3 -1
- package/lib/commonjs/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-network-switch-view/index.js +5 -1
- package/lib/commonjs/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-networks-view/index.js +20 -12
- package/lib/commonjs/views/w3m-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js +4 -1
- package/lib/commonjs/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-onramp-view/index.js +4 -1
- package/lib/commonjs/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +4 -1
- package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js +4 -1
- package/lib/commonjs/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +4 -1
- package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js +5 -2
- package/lib/commonjs/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js +5 -12
- package/lib/commonjs/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
- package/lib/commonjs/views/w3m-wallet-send-preview-view/index.js +0 -2
- 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 +4 -5
- 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 +12 -21
- package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/module/AppKit.js +46 -15
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/modal/w3m-account-button/index.js +5 -2
- package/lib/module/modal/w3m-account-button/index.js.map +1 -1
- package/lib/module/modal/w3m-button/index.js +2 -2
- package/lib/module/modal/w3m-button/index.js.map +1 -1
- package/lib/module/modal/w3m-modal/index.js +2 -1
- package/lib/module/modal/w3m-modal/index.js.map +1 -1
- package/lib/module/modal/w3m-network-button/index.js +12 -6
- package/lib/module/modal/w3m-network-button/index.js.map +1 -1
- package/lib/module/partials/w3m-account-activity/index.js +14 -5
- package/lib/module/partials/w3m-account-activity/index.js.map +1 -1
- package/lib/module/partials/w3m-account-tokens/index.js +5 -2
- package/lib/module/partials/w3m-account-tokens/index.js.map +1 -1
- package/lib/module/partials/w3m-account-wallet-features/index.js +4 -2
- package/lib/module/partials/w3m-account-wallet-features/index.js.map +1 -1
- package/lib/module/partials/w3m-header/index.js +3 -1
- package/lib/module/partials/w3m-header/index.js.map +1 -1
- package/lib/module/partials/w3m-selector-modal/index.js +5 -2
- package/lib/module/partials/w3m-selector-modal/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/index.js +12 -9
- package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
- package/lib/module/partials/w3m-send-input-token/styles.js +3 -0
- package/lib/module/partials/w3m-send-input-token/styles.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +6 -8
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/views/w3m-account-default-view/index.js +42 -16
- package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
- package/lib/module/views/w3m-account-view/index.js +7 -3
- package/lib/module/views/w3m-account-view/index.js.map +1 -1
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js +4 -2
- package/lib/module/views/w3m-connect-view/components/custom-wallet-list.js.map +1 -1
- package/lib/module/views/w3m-connecting-external-view/index.js +4 -3
- package/lib/module/views/w3m-connecting-external-view/index.js.map +1 -1
- package/lib/module/views/w3m-connecting-view/index.js +3 -1
- package/lib/module/views/w3m-connecting-view/index.js.map +1 -1
- package/lib/module/views/w3m-network-switch-view/index.js +6 -2
- package/lib/module/views/w3m-network-switch-view/index.js.map +1 -1
- package/lib/module/views/w3m-networks-view/index.js +21 -13
- package/lib/module/views/w3m-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-checkout-view/index.js +5 -2
- package/lib/module/views/w3m-onramp-checkout-view/index.js.map +1 -1
- package/lib/module/views/w3m-onramp-view/index.js +5 -2
- package/lib/module/views/w3m-onramp-view/index.js.map +1 -1
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +5 -2
- package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +1 -1
- package/lib/module/views/w3m-unsupported-chain-view/index.js +5 -2
- package/lib/module/views/w3m-unsupported-chain-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +5 -2
- package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-receive-view/index.js +6 -3
- package/lib/module/views/w3m-wallet-receive-view/index.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js +6 -13
- package/lib/module/views/w3m-wallet-send-preview-view/components/preview-send-details.js.map +1 -1
- package/lib/module/views/w3m-wallet-send-preview-view/index.js +0 -2
- 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 +5 -6
- 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 +14 -23
- package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
- package/lib/typescript/AppKit.d.ts +3 -3
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/AppKitContext.d.ts +1 -1
- package/lib/typescript/modal/w3m-account-button/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
- package/lib/typescript/modal/w3m-network-button/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/partials/w3m-selector-modal/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-send-input-token/index.d.ts +2 -2
- package/lib/typescript/partials/w3m-send-input-token/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-send-input-token/styles.d.ts +3 -0
- package/lib/typescript/partials/w3m-send-input-token/styles.d.ts.map +1 -1
- package/lib/typescript/utils/NetworkUtil.d.ts +2 -1
- package/lib/typescript/utils/NetworkUtil.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-connect-view/components/custom-wallet-list.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/lib/typescript/views/w3m-network-switch-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-networks-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-checkout-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-onramp-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-swap-view/components/select-token-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-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-preview-view/components/preview-send-details.d.ts +1 -1
- package/lib/typescript/views/w3m-wallet-send-preview-view/components/preview-send-details.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-preview-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-select-token-view/index.d.ts.map +1 -1
- package/lib/typescript/views/w3m-wallet-send-view/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/AppKit.ts +72 -24
- package/src/modal/w3m-account-button/index.tsx +4 -3
- package/src/modal/w3m-button/index.tsx +2 -2
- package/src/modal/w3m-modal/index.tsx +2 -0
- package/src/modal/w3m-network-button/index.tsx +10 -6
- package/src/partials/w3m-account-activity/index.tsx +16 -5
- package/src/partials/w3m-account-tokens/index.tsx +3 -2
- package/src/partials/w3m-account-wallet-features/index.tsx +15 -11
- package/src/partials/w3m-header/index.tsx +3 -1
- package/src/partials/w3m-selector-modal/index.tsx +3 -2
- package/src/partials/w3m-send-input-token/index.tsx +17 -19
- package/src/partials/w3m-send-input-token/styles.ts +3 -0
- package/src/utils/NetworkUtil.ts +13 -10
- package/src/views/w3m-account-default-view/index.tsx +44 -17
- package/src/views/w3m-account-view/index.tsx +5 -3
- package/src/views/w3m-connect-view/components/custom-wallet-list.tsx +5 -2
- package/src/views/w3m-connecting-external-view/index.tsx +4 -3
- package/src/views/w3m-connecting-view/index.tsx +3 -1
- package/src/views/w3m-network-switch-view/index.tsx +4 -2
- package/src/views/w3m-networks-view/index.tsx +23 -12
- package/src/views/w3m-onramp-checkout-view/index.tsx +3 -2
- package/src/views/w3m-onramp-view/index.tsx +4 -3
- package/src/views/w3m-swap-view/components/select-token-view/index.tsx +3 -2
- package/src/views/w3m-unsupported-chain-view/index.tsx +7 -2
- package/src/views/w3m-wallet-compatible-networks-view/index.tsx +7 -2
- package/src/views/w3m-wallet-receive-view/index.tsx +4 -3
- package/src/views/w3m-wallet-send-preview-view/components/preview-send-details.tsx +4 -11
- package/src/views/w3m-wallet-send-preview-view/index.tsx +2 -9
- package/src/views/w3m-wallet-send-select-token-view/index.tsx +3 -4
- package/src/views/w3m-wallet-send-view/index.tsx +19 -22
|
@@ -23,10 +23,12 @@ export interface AccountWalletFeaturesProps {
|
|
|
23
23
|
export function AccountWalletFeatures({ isBalanceLoading }: AccountWalletFeaturesProps) {
|
|
24
24
|
const [activeTab, setActiveTab] = useState(0);
|
|
25
25
|
const { features, isOnRampEnabled } = useSnapshot(OptionsController.state);
|
|
26
|
-
const { activeNetwork, balances } = useSnapshot(ConnectionsController.state);
|
|
26
|
+
const { activeNetwork, balances, activeNamespace } = useSnapshot(ConnectionsController.state);
|
|
27
27
|
const balance = CoreHelperUtil.calculateAndFormatBalance(balances as BalanceType[]);
|
|
28
28
|
const network = ConnectionsController.state.activeNetwork?.caipNetworkId || '';
|
|
29
29
|
const isSmartAccount = ConnectionsController.state.accountType === 'smartAccount';
|
|
30
|
+
const showSend =
|
|
31
|
+
activeNamespace && ConstantsUtil.SEND_SUPPORTED_NAMESPACES.includes(activeNamespace);
|
|
30
32
|
const isSwapsEnabled =
|
|
31
33
|
features?.swaps &&
|
|
32
34
|
activeNetwork?.caipNetworkId &&
|
|
@@ -122,16 +124,18 @@ export function AccountWalletFeatures({ isBalanceLoading }: AccountWalletFeature
|
|
|
122
124
|
style={[styles.action, isSwapsEnabled ? styles.actionCenter : styles.actionLeft]}
|
|
123
125
|
onPress={onReceivePress}
|
|
124
126
|
/>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
{showSend && (
|
|
128
|
+
<IconLink
|
|
129
|
+
icon="paperplane"
|
|
130
|
+
size="lg"
|
|
131
|
+
iconColor="accent-100"
|
|
132
|
+
background
|
|
133
|
+
backgroundColor="accent-glass-010"
|
|
134
|
+
pressedColor="accent-glass-020"
|
|
135
|
+
style={[styles.action, styles.actionRight]}
|
|
136
|
+
onPress={onSendPress}
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
135
139
|
</FlexView>
|
|
136
140
|
<FlexView style={styles.tab}>
|
|
137
141
|
<Tabs tabs={['Tokens', 'Activity']} onTabChange={onTabChange} />
|
|
@@ -18,7 +18,9 @@ export function Header() {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const headings = (_data: RouterControllerState['data'], _view: RouterControllerState['view']) => {
|
|
21
|
-
|
|
21
|
+
// TODO: check if this is needed wiht Coinbase
|
|
22
|
+
// const connectorName = _data?.connector?.name;
|
|
23
|
+
const connectorName = undefined;
|
|
22
24
|
const walletName = _data?.wallet?.name;
|
|
23
25
|
const networkName = _data?.network?.name;
|
|
24
26
|
const socialName = _data?.socialProvider
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
useTheme
|
|
14
14
|
} from '@reown/appkit-ui-react-native';
|
|
15
15
|
import styles from './styles';
|
|
16
|
-
import {
|
|
16
|
+
import { AssetController, ConnectionsController } from '@reown/appkit-core-react-native';
|
|
17
17
|
|
|
18
18
|
interface SelectorModalProps {
|
|
19
19
|
title?: string;
|
|
@@ -46,7 +46,8 @@ export function SelectorModal({
|
|
|
46
46
|
}: SelectorModalProps) {
|
|
47
47
|
const Theme = useTheme();
|
|
48
48
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
49
|
-
const
|
|
49
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
50
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
50
51
|
|
|
51
52
|
const renderSeparator = () => {
|
|
52
53
|
return <View style={{ height: SEPARATOR_HEIGHT }} />;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { useRef, useState } from 'react';
|
|
2
2
|
import { TextInput, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
FlexView,
|
|
5
|
+
Link,
|
|
6
|
+
Text,
|
|
7
|
+
useTheme,
|
|
8
|
+
TokenButton,
|
|
9
|
+
Shimmer
|
|
10
|
+
} from '@reown/appkit-ui-react-native';
|
|
4
11
|
import { NumberUtil, type Balance } from '@reown/appkit-common-react-native';
|
|
5
|
-
import {
|
|
12
|
+
import { SendController } from '@reown/appkit-core-react-native';
|
|
6
13
|
|
|
7
14
|
import { getMaxAmount, getSendValue } from './utils';
|
|
8
15
|
import styles from './styles';
|
|
@@ -10,17 +17,17 @@ import styles from './styles';
|
|
|
10
17
|
export interface SendInputTokenProps {
|
|
11
18
|
token?: Balance;
|
|
12
19
|
sendTokenAmount?: number;
|
|
13
|
-
gasPrice?: number;
|
|
14
20
|
style?: StyleProp<ViewStyle>;
|
|
15
21
|
onTokenPress?: () => void;
|
|
22
|
+
loading?: boolean;
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
export function SendInputToken({
|
|
19
26
|
token,
|
|
20
27
|
sendTokenAmount,
|
|
21
|
-
gasPrice,
|
|
22
28
|
style,
|
|
23
|
-
onTokenPress
|
|
29
|
+
onTokenPress,
|
|
30
|
+
loading
|
|
24
31
|
}: SendInputTokenProps) {
|
|
25
32
|
const Theme = useTheme();
|
|
26
33
|
const valueInputRef = useRef<TextInput | null>(null);
|
|
@@ -39,26 +46,17 @@ export function SendInputToken({
|
|
|
39
46
|
};
|
|
40
47
|
|
|
41
48
|
const onMaxPress = () => {
|
|
42
|
-
if (token?.quantity?.numeric
|
|
43
|
-
const
|
|
44
|
-
token.address === undefined ||
|
|
45
|
-
Object.values(ConstantsUtil.NATIVE_TOKEN_ADDRESS).some(
|
|
46
|
-
nativeAddress => token?.address?.split(':')[2] === nativeAddress
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
const numericGas = NumberUtil.bigNumber(gasPrice).shiftedBy(-token.quantity.decimals);
|
|
50
|
-
|
|
51
|
-
const maxValue = isNetworkToken
|
|
52
|
-
? NumberUtil.bigNumber(token.quantity.numeric).minus(numericGas)
|
|
53
|
-
: NumberUtil.bigNumber(token.quantity.numeric);
|
|
54
|
-
|
|
49
|
+
if (token?.quantity?.numeric) {
|
|
50
|
+
const maxValue = NumberUtil.bigNumber(token.quantity.numeric);
|
|
55
51
|
SendController.setTokenAmount(Number(maxValue.toFixed(20)));
|
|
56
52
|
setInputValue(maxValue.toFixed(20));
|
|
57
53
|
valueInputRef.current?.blur();
|
|
58
54
|
}
|
|
59
55
|
};
|
|
60
56
|
|
|
61
|
-
return (
|
|
57
|
+
return loading ? (
|
|
58
|
+
<Shimmer width="100%" height={100} borderRadius={16} style={styles.inputLoading} />
|
|
59
|
+
) : (
|
|
62
60
|
<FlexView
|
|
63
61
|
style={[
|
|
64
62
|
styles.container,
|
package/src/utils/NetworkUtil.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConstantsUtil } from '@reown/appkit-common-react-native';
|
|
2
2
|
import type { AppKitNetwork, CaipNetworkId, Network } from '@reown/appkit-common-react-native';
|
|
3
|
+
import type { CaipNamespaces } from '@reown/appkit-core-react-native';
|
|
3
4
|
|
|
4
5
|
export const NetworkUtil = {
|
|
5
6
|
formatNetwork(network: Network, projectId: string): AppKitNetwork {
|
|
@@ -37,17 +38,19 @@ export const NetworkUtil = {
|
|
|
37
38
|
return url.toString();
|
|
38
39
|
},
|
|
39
40
|
|
|
40
|
-
getDefaultChainId(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
getDefaultChainId(
|
|
42
|
+
namespaces: CaipNamespaces,
|
|
43
|
+
defaultNetwork?: AppKitNetwork
|
|
44
|
+
): CaipNetworkId | undefined {
|
|
45
|
+
if (!defaultNetwork) return undefined;
|
|
46
|
+
|
|
47
|
+
const isValidDefaultNetwork = Object.values(namespaces).some(
|
|
48
|
+
namespace => namespace?.chains?.some(chain => chain === defaultNetwork.caipNetworkId)
|
|
49
|
+
);
|
|
50
|
+
if (isValidDefaultNetwork) {
|
|
51
|
+
return defaultNetwork.caipNetworkId;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
return
|
|
54
|
+
return undefined;
|
|
52
55
|
}
|
|
53
56
|
};
|
|
@@ -4,7 +4,6 @@ import { Linking, ScrollView } from 'react-native';
|
|
|
4
4
|
import {
|
|
5
5
|
AccountController,
|
|
6
6
|
ApiController,
|
|
7
|
-
AssetUtil,
|
|
8
7
|
CoreHelperUtil,
|
|
9
8
|
EventsController,
|
|
10
9
|
ModalController,
|
|
@@ -14,9 +13,10 @@ import {
|
|
|
14
13
|
ConstantsUtil,
|
|
15
14
|
SwapController,
|
|
16
15
|
OnRampController,
|
|
17
|
-
ConnectionsController
|
|
16
|
+
ConnectionsController,
|
|
17
|
+
AssetController
|
|
18
18
|
} from '@reown/appkit-core-react-native';
|
|
19
|
-
import { ConstantsUtil as CommonConstantsUtil } from '@reown/appkit-common-react-native';
|
|
19
|
+
// import { ConstantsUtil as CommonConstantsUtil } from '@reown/appkit-common-react-native';
|
|
20
20
|
import {
|
|
21
21
|
Avatar,
|
|
22
22
|
Button,
|
|
@@ -50,7 +50,8 @@ export function AccountDefaultView() {
|
|
|
50
50
|
const [disconnecting, setDisconnecting] = useState(false);
|
|
51
51
|
const { features, isOnRampEnabled } = useSnapshot(OptionsController.state);
|
|
52
52
|
const { history } = useSnapshot(RouterController.state);
|
|
53
|
-
const
|
|
53
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
54
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
54
55
|
const showCopy = OptionsController.isClipboardAvailable();
|
|
55
56
|
const isAuth = !!connection?.properties?.provider;
|
|
56
57
|
const showBalance = balance && !isAuth;
|
|
@@ -66,6 +67,10 @@ export function AccountDefaultView() {
|
|
|
66
67
|
features?.swaps &&
|
|
67
68
|
activeNetwork?.caipNetworkId &&
|
|
68
69
|
ConstantsUtil.SWAP_SUPPORTED_NETWORKS.includes(activeNetwork.caipNetworkId);
|
|
70
|
+
|
|
71
|
+
const showSend =
|
|
72
|
+
!isAuth && activeNamespace && ConstantsUtil.SEND_SUPPORTED_NAMESPACES.includes(activeNamespace);
|
|
73
|
+
|
|
69
74
|
const { padding } = useCustomDimensions();
|
|
70
75
|
|
|
71
76
|
async function onDisconnect() {
|
|
@@ -96,7 +101,7 @@ export function AccountDefaultView() {
|
|
|
96
101
|
const onCopyAddress = () => {
|
|
97
102
|
//TODO: Check ENS name
|
|
98
103
|
if (OptionsController.isClipboardAvailable() && ConnectionsController.state.activeAddress) {
|
|
99
|
-
const _address = ConnectionsController.state.activeAddress
|
|
104
|
+
const _address = CoreHelperUtil.getPlainAddress(ConnectionsController.state.activeAddress);
|
|
100
105
|
if (_address) {
|
|
101
106
|
OptionsController.copyToClipboard(_address);
|
|
102
107
|
SnackController.showSuccess('Address copied');
|
|
@@ -145,20 +150,29 @@ export function AccountDefaultView() {
|
|
|
145
150
|
RouterController.push('UpgradeEmailWallet');
|
|
146
151
|
};
|
|
147
152
|
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
if (provider !== 'email' || !email) return;
|
|
152
|
-
|
|
153
|
-
const sessionTopic = ConnectionsController.state.connection?.properties?.sessionTopic;
|
|
154
|
-
|
|
155
|
-
if (!sessionTopic) {
|
|
156
|
-
throw new Error('Session topic not found');
|
|
157
|
-
}
|
|
153
|
+
const onSendPress = () => {
|
|
154
|
+
const network = ConnectionsController.state.activeNetwork?.caipNetworkId || '';
|
|
155
|
+
const isSmartAccount = ConnectionsController.state.accountType === 'smartAccount';
|
|
158
156
|
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
EventsController.sendEvent({
|
|
158
|
+
type: 'track',
|
|
159
|
+
event: 'OPEN_SEND',
|
|
160
|
+
properties: { network, isSmartAccount }
|
|
161
|
+
});
|
|
162
|
+
RouterController.push('WalletSend');
|
|
163
|
+
};
|
|
161
164
|
|
|
165
|
+
const onEmailPress = async () => {
|
|
166
|
+
// TODO: Uncomment when email update is enabled
|
|
167
|
+
// const email = ConnectionsController.state.connection?.properties?.email;
|
|
168
|
+
// const provider = ConnectionsController.state.connection?.properties?.provider;
|
|
169
|
+
// if (provider !== 'email' || !email) return;
|
|
170
|
+
// const sessionTopic = ConnectionsController.state.connection?.properties?.sessionTopic;
|
|
171
|
+
// if (!sessionTopic) {
|
|
172
|
+
// throw new Error('Session topic not found');
|
|
173
|
+
// }
|
|
174
|
+
// const link = `${CommonConstantsUtil.WEB_WALLET_URL}/emailUpdate/${sessionTopic}`;
|
|
175
|
+
// await CoreHelperUtil.openLink(link);
|
|
162
176
|
// Subscribe to email update event
|
|
163
177
|
};
|
|
164
178
|
|
|
@@ -262,6 +276,19 @@ export function AccountDefaultView() {
|
|
|
262
276
|
<Text color="fg-100">Buy crypto</Text>
|
|
263
277
|
</ListItem>
|
|
264
278
|
)}
|
|
279
|
+
{showSend && (
|
|
280
|
+
<ListItem
|
|
281
|
+
chevron
|
|
282
|
+
icon="paperplane"
|
|
283
|
+
iconColor="accent-100"
|
|
284
|
+
iconBackgroundColor="accent-glass-015"
|
|
285
|
+
onPress={onSendPress}
|
|
286
|
+
testID="button-send"
|
|
287
|
+
style={styles.actionButton}
|
|
288
|
+
>
|
|
289
|
+
<Text color="fg-100">Send</Text>
|
|
290
|
+
</ListItem>
|
|
291
|
+
)}
|
|
265
292
|
{showSwaps && (
|
|
266
293
|
<ListItem
|
|
267
294
|
chevron
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from '@reown/appkit-ui-react-native';
|
|
12
12
|
import {
|
|
13
13
|
ApiController,
|
|
14
|
-
|
|
14
|
+
AssetController,
|
|
15
15
|
ConnectionsController,
|
|
16
16
|
CoreHelperUtil,
|
|
17
17
|
ModalController,
|
|
@@ -28,7 +28,9 @@ export function AccountView() {
|
|
|
28
28
|
const [isLoading, setIsLoading] = useState(false);
|
|
29
29
|
const { padding } = useCustomDimensions();
|
|
30
30
|
const { activeNetwork, activeAddress } = useSnapshot(ConnectionsController.state);
|
|
31
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
31
32
|
const address = CoreHelperUtil.getPlainAddress(activeAddress);
|
|
33
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
32
34
|
|
|
33
35
|
const onProfilePress = () => {
|
|
34
36
|
RouterController.push('AccountDefault');
|
|
@@ -46,7 +48,7 @@ export function AccountView() {
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
fetchBalance();
|
|
49
|
-
SendController.
|
|
51
|
+
SendController.resetState();
|
|
50
52
|
|
|
51
53
|
const balanceInterval = setInterval(() => {
|
|
52
54
|
fetchBalance();
|
|
@@ -68,7 +70,7 @@ export function AccountView() {
|
|
|
68
70
|
]}
|
|
69
71
|
>
|
|
70
72
|
<NetworkButton
|
|
71
|
-
imageSrc={
|
|
73
|
+
imageSrc={networkImage}
|
|
72
74
|
imageHeaders={ApiController._getApiHeaders()}
|
|
73
75
|
onPress={onNetworkPress}
|
|
74
76
|
style={styles.networkIcon}
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
type OptionsControllerState,
|
|
7
7
|
ApiController,
|
|
8
8
|
ConnectionController,
|
|
9
|
-
type ConnectionControllerState
|
|
9
|
+
type ConnectionControllerState,
|
|
10
|
+
AssetUtil
|
|
10
11
|
} from '@reown/appkit-core-react-native';
|
|
11
12
|
import { ListWallet } from '@reown/appkit-ui-react-native';
|
|
12
13
|
import { filterOutRecentWallets } from '../utils';
|
|
@@ -19,6 +20,7 @@ interface Props {
|
|
|
19
20
|
|
|
20
21
|
export function CustomWalletList({ itemStyle, onWalletPress, isWalletConnectEnabled }: Props) {
|
|
21
22
|
const { installed } = useSnapshot(ApiController.state);
|
|
23
|
+
const imageHeaders = ApiController._getApiHeaders();
|
|
22
24
|
const { recentWallets } = useSnapshot(ConnectionController.state) as ConnectionControllerState;
|
|
23
25
|
const { customWallets } = useSnapshot(OptionsController.state) as OptionsControllerState;
|
|
24
26
|
const RECENT_COUNT = recentWallets?.length && installed.length ? 1 : recentWallets?.length ?? 0;
|
|
@@ -32,7 +34,8 @@ export function CustomWalletList({ itemStyle, onWalletPress, isWalletConnectEnab
|
|
|
32
34
|
return list.map(wallet => (
|
|
33
35
|
<ListWallet
|
|
34
36
|
key={wallet.id}
|
|
35
|
-
imageSrc={wallet
|
|
37
|
+
imageSrc={AssetUtil.getWalletImage(wallet)}
|
|
38
|
+
imageHeaders={imageHeaders}
|
|
36
39
|
name={wallet.name}
|
|
37
40
|
onPress={() => onWalletPress(wallet)}
|
|
38
41
|
style={itemStyle}
|
|
@@ -22,7 +22,8 @@ import styles from './styles';
|
|
|
22
22
|
//TODO: check if this view is needed with Coinbase
|
|
23
23
|
export function ConnectingExternalView() {
|
|
24
24
|
const { data } = RouterController.state;
|
|
25
|
-
const connector = data?.connector;
|
|
25
|
+
// const connector = data?.connector;
|
|
26
|
+
const connector = undefined;
|
|
26
27
|
const { maxWidth: width } = useCustomDimensions();
|
|
27
28
|
const [errorType, setErrorType] = useState<BodyErrorType>();
|
|
28
29
|
const bodyMessage = getMessage({ walletName: data?.wallet?.name, errorType });
|
|
@@ -60,9 +61,9 @@ export function ConnectingExternalView() {
|
|
|
60
61
|
type: 'track',
|
|
61
62
|
event: 'CONNECT_SUCCESS',
|
|
62
63
|
properties: {
|
|
63
|
-
name: data
|
|
64
|
+
name: data?.wallet?.name ?? 'Unknown',
|
|
64
65
|
method: 'mobile',
|
|
65
|
-
explorer_id: data
|
|
66
|
+
explorer_id: data?.wallet?.id
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
}
|
|
@@ -11,6 +11,7 @@ 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';
|
|
14
15
|
import { useAppKit } from '../../AppKitContext';
|
|
15
16
|
import { ConnectingQrCode } from '../../partials/w3m-connecting-qrcode';
|
|
16
17
|
import { ConnectingMobile } from '../../partials/w3m-connecting-mobile';
|
|
@@ -47,9 +48,10 @@ export function ConnectingView() {
|
|
|
47
48
|
ConnectionController.setWcError(false);
|
|
48
49
|
|
|
49
50
|
let connectPromise: Promise<void>;
|
|
50
|
-
// TODO: check phantom wallet id from cloud
|
|
51
51
|
if (data?.wallet?.id === 'phantom-wallet') {
|
|
52
52
|
connectPromise = connect('phantom');
|
|
53
|
+
} else if (data?.wallet?.id === CommonConstantsUtil.COINBASE_EXPLORER_ID) {
|
|
54
|
+
connectPromise = connect('coinbase');
|
|
53
55
|
} else {
|
|
54
56
|
connectPromise = connect('walletconnect', {
|
|
55
57
|
universalLink: routeData?.wallet?.link_mode ?? undefined
|
|
@@ -2,7 +2,7 @@ import { useSnapshot } from 'valtio';
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
ApiController,
|
|
5
|
-
|
|
5
|
+
AssetController,
|
|
6
6
|
ConnectionController,
|
|
7
7
|
ConnectionsController,
|
|
8
8
|
RouterController,
|
|
@@ -24,10 +24,12 @@ export function NetworkSwitchView() {
|
|
|
24
24
|
const { data } = useSnapshot(RouterController.state);
|
|
25
25
|
const { recentWallets } = useSnapshot(ConnectionController.state);
|
|
26
26
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
27
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
27
28
|
const [error, setError] = useState<boolean>(false);
|
|
28
29
|
const [showRetry, setShowRetry] = useState<boolean>(false);
|
|
29
30
|
const network = data?.network;
|
|
30
31
|
const wallet = recentWallets?.[0];
|
|
32
|
+
const networkImage = network ? networkImages[network.id] : undefined;
|
|
31
33
|
|
|
32
34
|
const onSwitchNetwork = async () => {
|
|
33
35
|
try {
|
|
@@ -105,7 +107,7 @@ export function NetworkSwitchView() {
|
|
|
105
107
|
<FlexView alignItems="center" padding={['2xl', 's', '4xl', 's']}>
|
|
106
108
|
<LoadingHexagon paused={error}>
|
|
107
109
|
<NetworkImage
|
|
108
|
-
imageSrc={
|
|
110
|
+
imageSrc={networkImage}
|
|
109
111
|
imageHeaders={ApiController._getApiHeaders()}
|
|
110
112
|
size="lg"
|
|
111
113
|
/>
|
|
@@ -10,19 +10,22 @@ import {
|
|
|
10
10
|
} from '@reown/appkit-ui-react-native';
|
|
11
11
|
import {
|
|
12
12
|
ApiController,
|
|
13
|
-
NetworkController,
|
|
14
13
|
RouterController,
|
|
15
14
|
EventsController,
|
|
16
15
|
ConnectionsController,
|
|
17
|
-
|
|
16
|
+
ModalController,
|
|
17
|
+
OptionsController,
|
|
18
|
+
AssetController
|
|
18
19
|
} from '@reown/appkit-core-react-native';
|
|
19
20
|
import type { AppKitNetwork } from '@reown/appkit-common-react-native';
|
|
20
21
|
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
21
22
|
import styles from './styles';
|
|
22
23
|
import { useAppKit } from '../../AppKitContext';
|
|
24
|
+
import { useSnapshot } from 'valtio';
|
|
23
25
|
|
|
24
26
|
export function NetworksView() {
|
|
25
|
-
const {
|
|
27
|
+
const { networks, isConnected } = useSnapshot(ConnectionsController.state);
|
|
28
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
26
29
|
const imageHeaders = ApiController._getApiHeaders();
|
|
27
30
|
const { maxWidth: width, padding } = useCustomDimensions();
|
|
28
31
|
const numColumns = 4;
|
|
@@ -33,22 +36,31 @@ export function NetworksView() {
|
|
|
33
36
|
);
|
|
34
37
|
const { switchNetwork } = useAppKit();
|
|
35
38
|
|
|
39
|
+
const networkList = isConnected ? ConnectionsController.getConnectedNetworks() : networks;
|
|
40
|
+
|
|
36
41
|
const onHelpPress = () => {
|
|
37
42
|
RouterController.push('WhatIsANetwork');
|
|
38
43
|
EventsController.sendEvent({ type: 'track', event: 'CLICK_NETWORK_HELP' });
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
const networksTemplate = () => {
|
|
42
|
-
//TODO: should show requested networks disabled
|
|
43
|
-
// const networks = CoreHelperUtil.sortNetworks(approvedCaipNetworkIds, requestedCaipNetworks);
|
|
44
|
-
const networks = ConnectionsController.getConnectedNetworks();
|
|
45
|
-
|
|
46
47
|
const onNetworkPress = async (network: AppKitNetwork) => {
|
|
47
48
|
await switchNetwork(network);
|
|
48
|
-
|
|
49
|
+
|
|
50
|
+
if (RouterController.state.history.length > 1) {
|
|
51
|
+
RouterController.goBack();
|
|
52
|
+
} else {
|
|
53
|
+
ModalController.close();
|
|
54
|
+
}
|
|
49
55
|
};
|
|
50
56
|
|
|
51
|
-
return
|
|
57
|
+
return networkList.map(network => {
|
|
58
|
+
const isSelected = ConnectionsController.state.isConnected
|
|
59
|
+
? ConnectionsController.state.activeCaipNetworkId === network.caipNetworkId
|
|
60
|
+
: OptionsController.state.defaultNetwork?.caipNetworkId === network.caipNetworkId;
|
|
61
|
+
// eslint-disable-next-line valtio/state-snapshot-rule
|
|
62
|
+
const networkImage = network ? networkImages[network.id] : undefined;
|
|
63
|
+
|
|
52
64
|
return (
|
|
53
65
|
<View
|
|
54
66
|
key={network.id}
|
|
@@ -64,10 +76,9 @@ export function NetworksView() {
|
|
|
64
76
|
testID={`w3m-network-switch-${network.name ?? network.id}`}
|
|
65
77
|
name={network.name ?? 'Unknown'}
|
|
66
78
|
type="network"
|
|
67
|
-
imageSrc={
|
|
79
|
+
imageSrc={networkImage}
|
|
68
80
|
imageHeaders={imageHeaders}
|
|
69
|
-
|
|
70
|
-
selected={caipNetwork?.id === network.id}
|
|
81
|
+
selected={isSelected}
|
|
71
82
|
onPress={() => onNetworkPress(network)}
|
|
72
83
|
/>
|
|
73
84
|
</View>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
AssetController,
|
|
3
3
|
ConnectionsController,
|
|
4
4
|
OnRampController,
|
|
5
5
|
RouterController,
|
|
@@ -23,12 +23,13 @@ import { NumberUtil, StringUtil } from '@reown/appkit-common-react-native';
|
|
|
23
23
|
export function OnRampCheckoutView() {
|
|
24
24
|
const Theme = useTheme();
|
|
25
25
|
const { themeMode } = useSnapshot(ThemeController.state);
|
|
26
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
26
27
|
const { selectedQuote, selectedPaymentMethod, purchaseCurrency } = useSnapshot(
|
|
27
28
|
OnRampController.state
|
|
28
29
|
);
|
|
29
30
|
|
|
30
31
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
31
|
-
const networkImage =
|
|
32
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
32
33
|
|
|
33
34
|
const value = NumberUtil.roundNumber(selectedQuote?.destinationAmount ?? 0, 6, 5);
|
|
34
35
|
const symbol = selectedQuote?.destinationCurrencyCode;
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
ThemeController,
|
|
8
8
|
RouterController,
|
|
9
9
|
type OnRampControllerState,
|
|
10
|
-
AssetUtil,
|
|
11
10
|
SnackController,
|
|
12
11
|
ConstantsUtil,
|
|
13
|
-
ConnectionsController
|
|
12
|
+
ConnectionsController,
|
|
13
|
+
AssetController
|
|
14
14
|
} from '@reown/appkit-core-react-native';
|
|
15
15
|
import {
|
|
16
16
|
Button,
|
|
@@ -52,6 +52,7 @@ export function OnRampView() {
|
|
|
52
52
|
initialLoading
|
|
53
53
|
} = useSnapshot(OnRampController.state) as OnRampControllerState;
|
|
54
54
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
55
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
55
56
|
const [searchValue, setSearchValue] = useState('');
|
|
56
57
|
const [isCurrencyModalVisible, setIsCurrencyModalVisible] = useState(false);
|
|
57
58
|
const [isPaymentMethodModalVisible, setIsPaymentMethodModalVisible] = useState(false);
|
|
@@ -59,7 +60,7 @@ export function OnRampView() {
|
|
|
59
60
|
const suggestedValues = getCurrencySuggestedValues(paymentCurrency);
|
|
60
61
|
const purchaseCurrencyCode =
|
|
61
62
|
purchaseCurrency?.currencyCode?.split('_')[0] ?? purchaseCurrency?.currencyCode;
|
|
62
|
-
const networkImage =
|
|
63
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
63
64
|
|
|
64
65
|
const getQuotes = useCallback(() => {
|
|
65
66
|
if (OnRampController.canGenerateQuote()) {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@reown/appkit-ui-react-native';
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
AssetController,
|
|
18
18
|
ConnectionsController,
|
|
19
19
|
SwapController,
|
|
20
20
|
type SwapControllerState,
|
|
@@ -36,11 +36,12 @@ export function SwapSelectTokenView({ onClose, type }: Props) {
|
|
|
36
36
|
const { padding } = useCustomDimensions();
|
|
37
37
|
const Theme = useTheme();
|
|
38
38
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
39
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
39
40
|
const { sourceToken, suggestedTokens, myTokensWithBalance } = useSnapshot(
|
|
40
41
|
SwapController.state
|
|
41
42
|
) as SwapControllerState;
|
|
42
43
|
|
|
43
|
-
const networkImage =
|
|
44
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
44
45
|
const [tokenSearch, setTokenSearch] = useState<string>('');
|
|
45
46
|
const isSourceToken = type === 'sourceToken';
|
|
46
47
|
|
|
@@ -2,13 +2,18 @@ import { useSnapshot } from 'valtio';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { FlatList } from 'react-native';
|
|
4
4
|
import { Icon, ListItem, Separator, Text } from '@reown/appkit-ui-react-native';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ApiController,
|
|
7
|
+
AssetController,
|
|
8
|
+
ConnectionsController
|
|
9
|
+
} from '@reown/appkit-core-react-native';
|
|
6
10
|
import type { AppKitNetwork } from '@reown/appkit-common-react-native';
|
|
7
11
|
import { useAppKit } from '../../AppKitContext';
|
|
8
12
|
import styles from './styles';
|
|
9
13
|
|
|
10
14
|
export function UnsupportedChainView() {
|
|
11
15
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
16
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
12
17
|
const [disconnecting, setDisconnecting] = useState(false);
|
|
13
18
|
//TODO: should show requested networks disabled
|
|
14
19
|
// const networks = CoreHelperUtil.sortNetworks(approvedCaipNetworkIds, requestedCaipNetworks);
|
|
@@ -43,7 +48,7 @@ export function UnsupportedChainView() {
|
|
|
43
48
|
key={item.id}
|
|
44
49
|
icon="networkPlaceholder"
|
|
45
50
|
iconBackgroundColor="gray-glass-010"
|
|
46
|
-
imageSrc={
|
|
51
|
+
imageSrc={networkImages[item.id]}
|
|
47
52
|
imageHeaders={imageHeaders}
|
|
48
53
|
onPress={() => onNetworkPress(item)}
|
|
49
54
|
testID="button-network"
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { ScrollView } from 'react-native';
|
|
2
2
|
import { useSnapshot } from 'valtio';
|
|
3
3
|
import { FlexView, Text, Banner, NetworkImage } from '@reown/appkit-ui-react-native';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ApiController,
|
|
6
|
+
AssetController,
|
|
7
|
+
ConnectionsController
|
|
8
|
+
} from '@reown/appkit-core-react-native';
|
|
5
9
|
import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
6
10
|
import styles from './styles';
|
|
7
11
|
|
|
8
12
|
export function WalletCompatibleNetworks() {
|
|
9
13
|
const { padding } = useCustomDimensions();
|
|
10
14
|
const { networks, accountType } = useSnapshot(ConnectionsController.state);
|
|
15
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
11
16
|
const isSmartAccount = accountType === 'smartAccount';
|
|
12
17
|
|
|
13
18
|
const approvedNetworks = isSmartAccount
|
|
@@ -30,7 +35,7 @@ export function WalletCompatibleNetworks() {
|
|
|
30
35
|
padding={['s', 's', 's', 's']}
|
|
31
36
|
>
|
|
32
37
|
<NetworkImage
|
|
33
|
-
imageSrc={
|
|
38
|
+
imageSrc={networkImages[network.id]}
|
|
34
39
|
imageHeaders={imageHeaders}
|
|
35
40
|
size="sm"
|
|
36
41
|
style={styles.image}
|