@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
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
AccountController,
|
|
14
14
|
ApiController,
|
|
15
|
-
|
|
15
|
+
AssetController,
|
|
16
16
|
ConnectionsController,
|
|
17
17
|
CoreHelperUtil,
|
|
18
18
|
OptionsController,
|
|
@@ -23,11 +23,12 @@ import { useCustomDimensions } from '../../hooks/useCustomDimensions';
|
|
|
23
23
|
|
|
24
24
|
export function WalletReceiveView() {
|
|
25
25
|
const { profileName } = useSnapshot(AccountController.state);
|
|
26
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
26
27
|
const { activeNetwork, networks, activeAddress, accountType } = useSnapshot(
|
|
27
28
|
ConnectionsController.state
|
|
28
29
|
);
|
|
29
30
|
const address = CoreHelperUtil.getPlainAddress(activeAddress);
|
|
30
|
-
const networkImage =
|
|
31
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
31
32
|
const { padding } = useCustomDimensions();
|
|
32
33
|
const canCopy = OptionsController.isClipboardAvailable();
|
|
33
34
|
const isSmartAccount = accountType === 'smartAccount';
|
|
@@ -41,7 +42,7 @@ export function WalletReceiveView() {
|
|
|
41
42
|
const imagesArray = approvedNetworks
|
|
42
43
|
.filter(network => network?.id)
|
|
43
44
|
.slice(0, 5)
|
|
44
|
-
.map(network =>
|
|
45
|
+
.map(network => AssetController.state.networkImages[network.id])
|
|
45
46
|
.filter(Boolean) as string[];
|
|
46
47
|
|
|
47
48
|
const label = UiUtil.getTruncateString({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AssetController } from '@reown/appkit-core-react-native';
|
|
2
2
|
import type { AppKitNetwork } from '@reown/appkit-common-react-native';
|
|
3
3
|
import {
|
|
4
4
|
BorderRadius,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useTheme
|
|
11
11
|
} from '@reown/appkit-ui-react-native';
|
|
12
12
|
import { StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
|
|
13
|
+
import { useSnapshot } from 'valtio';
|
|
13
14
|
|
|
14
15
|
export interface PreviewSendDetailsProps {
|
|
15
16
|
address?: string;
|
|
@@ -23,10 +24,10 @@ export function PreviewSendDetails({
|
|
|
23
24
|
address,
|
|
24
25
|
name,
|
|
25
26
|
activeNetwork,
|
|
26
|
-
networkFee,
|
|
27
27
|
style
|
|
28
28
|
}: PreviewSendDetailsProps) {
|
|
29
29
|
const Theme = useTheme();
|
|
30
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
30
31
|
|
|
31
32
|
const formattedName = UiUtil.getTruncateString({
|
|
32
33
|
string: name ?? '',
|
|
@@ -42,7 +43,7 @@ export function PreviewSendDetails({
|
|
|
42
43
|
truncate: 'middle'
|
|
43
44
|
});
|
|
44
45
|
|
|
45
|
-
const networkImage =
|
|
46
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
46
47
|
|
|
47
48
|
return (
|
|
48
49
|
<FlexView
|
|
@@ -52,14 +53,6 @@ export function PreviewSendDetails({
|
|
|
52
53
|
<Text variant="small-400" color="fg-200" style={styles.title}>
|
|
53
54
|
Details
|
|
54
55
|
</Text>
|
|
55
|
-
<FlexView style={[styles.item, { backgroundColor: Theme['gray-glass-002'] }]}>
|
|
56
|
-
<Text variant="small-400" color="fg-150">
|
|
57
|
-
Network cost
|
|
58
|
-
</Text>
|
|
59
|
-
<Text variant="small-400" color="fg-100">
|
|
60
|
-
${UiUtil.formatNumberToLocalString(networkFee, 2)}
|
|
61
|
-
</Text>
|
|
62
|
-
</FlexView>
|
|
63
56
|
<FlexView style={[styles.item, { backgroundColor: Theme['gray-glass-002'] }]}>
|
|
64
57
|
<Text variant="small-400" color="fg-150">
|
|
65
58
|
{formattedName || 'Address'}
|
|
@@ -15,14 +15,8 @@ import { PreviewSendDetails } from './components/preview-send-details';
|
|
|
15
15
|
export function WalletSendPreviewView() {
|
|
16
16
|
const { padding } = useCustomDimensions();
|
|
17
17
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
receiverAddress,
|
|
21
|
-
receiverProfileName,
|
|
22
|
-
receiverProfileImageUrl,
|
|
23
|
-
gasPriceInUSD,
|
|
24
|
-
loading
|
|
25
|
-
} = useSnapshot(SendController.state);
|
|
18
|
+
const { token, receiverAddress, receiverProfileName, receiverProfileImageUrl, loading } =
|
|
19
|
+
useSnapshot(SendController.state);
|
|
26
20
|
|
|
27
21
|
const getSendValue = () => {
|
|
28
22
|
if (SendController.state.token?.price && SendController.state.sendTokenAmount) {
|
|
@@ -109,7 +103,6 @@ export function WalletSendPreviewView() {
|
|
|
109
103
|
</FlexView>
|
|
110
104
|
<PreviewSendDetails
|
|
111
105
|
style={styles.details}
|
|
112
|
-
networkFee={gasPriceInUSD}
|
|
113
106
|
address={receiverAddress}
|
|
114
107
|
name={receiverProfileName}
|
|
115
108
|
activeNetwork={activeNetwork}
|
|
@@ -3,7 +3,7 @@ import { useSnapshot } from 'valtio';
|
|
|
3
3
|
import { ScrollView } from 'react-native';
|
|
4
4
|
import { FlexView, InputText, ListToken, Text } from '@reown/appkit-ui-react-native';
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
AssetController,
|
|
7
7
|
ConnectionsController,
|
|
8
8
|
RouterController,
|
|
9
9
|
SendController
|
|
@@ -17,8 +17,8 @@ import styles from './styles';
|
|
|
17
17
|
export function WalletSendSelectTokenView() {
|
|
18
18
|
const { padding } = useCustomDimensions();
|
|
19
19
|
const { activeNetwork, balances } = useSnapshot(ConnectionsController.state);
|
|
20
|
-
const {
|
|
21
|
-
const networkImage =
|
|
20
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
21
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
22
22
|
const [tokenSearch, setTokenSearch] = useState<string>('');
|
|
23
23
|
const [filteredTokens, setFilteredTokens] = useState(balances ?? []);
|
|
24
24
|
|
|
@@ -65,7 +65,6 @@ export function WalletSendSelectTokenView() {
|
|
|
65
65
|
amount={_token.quantity?.numeric || '0'}
|
|
66
66
|
currency={_token.symbol}
|
|
67
67
|
onPress={() => onTokenPress(_token)}
|
|
68
|
-
disabled={_token.address === token?.address}
|
|
69
68
|
/>
|
|
70
69
|
))
|
|
71
70
|
) : (
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import { Platform, ScrollView } from 'react-native';
|
|
3
3
|
import { useSnapshot } from 'valtio';
|
|
4
4
|
import {
|
|
5
5
|
ConnectionsController,
|
|
6
6
|
CoreHelperUtil,
|
|
7
7
|
RouterController,
|
|
8
|
-
SendController
|
|
9
|
-
SwapController
|
|
8
|
+
SendController
|
|
10
9
|
} from '@reown/appkit-core-react-native';
|
|
11
10
|
import { Button, FlexView, IconBox, Spacing } from '@reown/appkit-ui-react-native';
|
|
12
11
|
import { SendInputToken } from '../../partials/w3m-send-input-token';
|
|
@@ -18,24 +17,16 @@ import styles from './styles';
|
|
|
18
17
|
export function WalletSendView() {
|
|
19
18
|
const { padding } = useCustomDimensions();
|
|
20
19
|
const { keyboardShown, keyboardHeight } = useKeyboard();
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const [isBalanceLoading, setBalanceLoading] = useState(false);
|
|
21
|
+
const { token, sendTokenAmount, receiverAddress, receiverProfileName, loading } = useSnapshot(
|
|
22
|
+
SendController.state
|
|
23
|
+
);
|
|
24
24
|
|
|
25
25
|
const paddingBottom = Platform.select({
|
|
26
26
|
android: keyboardShown ? keyboardHeight + Spacing['2xl'] : Spacing['2xl'],
|
|
27
27
|
default: Spacing['2xl']
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
const fetchNetworkPrice = useCallback(async () => {
|
|
31
|
-
await SwapController.getNetworkTokenPrice();
|
|
32
|
-
const gas = await SwapController.getInitialGasPrice();
|
|
33
|
-
if (gas?.gasPrice && gas?.gasPriceInUSD) {
|
|
34
|
-
SendController.setGasPrice(gas.gasPrice);
|
|
35
|
-
SendController.setGasPriceInUsd(gas.gasPriceInUSD);
|
|
36
|
-
}
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
30
|
const onSendPress = () => {
|
|
40
31
|
RouterController.push('WalletSendPreview');
|
|
41
32
|
};
|
|
@@ -66,7 +57,10 @@ export function WalletSendView() {
|
|
|
66
57
|
|
|
67
58
|
if (
|
|
68
59
|
SendController.state.receiverAddress &&
|
|
69
|
-
!CoreHelperUtil.isAddress(
|
|
60
|
+
!CoreHelperUtil.isAddress(
|
|
61
|
+
SendController.state.receiverAddress,
|
|
62
|
+
ConnectionsController.state.activeNamespace
|
|
63
|
+
)
|
|
70
64
|
) {
|
|
71
65
|
return 'Invalid address';
|
|
72
66
|
}
|
|
@@ -79,11 +73,14 @@ export function WalletSendView() {
|
|
|
79
73
|
};
|
|
80
74
|
|
|
81
75
|
useEffect(() => {
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
async function fetchBalance() {
|
|
77
|
+
setBalanceLoading(true);
|
|
78
|
+
await ConnectionsController.fetchBalance();
|
|
79
|
+
setBalanceLoading(false);
|
|
84
80
|
}
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
|
|
82
|
+
fetchBalance();
|
|
83
|
+
}, []);
|
|
87
84
|
|
|
88
85
|
const actionText = getActionText();
|
|
89
86
|
|
|
@@ -97,9 +94,9 @@ export function WalletSendView() {
|
|
|
97
94
|
<SendInputToken
|
|
98
95
|
token={token}
|
|
99
96
|
sendTokenAmount={sendTokenAmount}
|
|
100
|
-
gasPrice={Number(gasPrice)}
|
|
101
97
|
style={styles.tokenInput}
|
|
102
98
|
onTokenPress={() => RouterController.push('WalletSendSelectToken')}
|
|
99
|
+
loading={isBalanceLoading}
|
|
103
100
|
/>
|
|
104
101
|
<FlexView alignItems="center" justifyContent="center" style={styles.addressContainer}>
|
|
105
102
|
<SendInputAddress value={receiverProfileName || receiverAddress} />
|
|
@@ -119,7 +116,7 @@ export function WalletSendView() {
|
|
|
119
116
|
style={styles.sendButton}
|
|
120
117
|
onPress={onSendPress}
|
|
121
118
|
disabled={!actionText.includes('Preview send')}
|
|
122
|
-
loading={loading}
|
|
119
|
+
loading={loading || isBalanceLoading}
|
|
123
120
|
>
|
|
124
121
|
{actionText}
|
|
125
122
|
</Button>
|