@reown/appkit-react-native 0.0.0-feat-multi-social-20250715153550 → 0.0.0-feat-coinbase-20250722174423
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-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 +30 -3
- 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-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-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 +31 -4
- 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-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 +1 -1
- package/lib/typescript/AppKit.d.ts.map +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-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-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 +69 -21
- 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-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 +34 -4
- 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-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
package/src/AppKit.ts
CHANGED
|
@@ -12,7 +12,9 @@ import {
|
|
|
12
12
|
ThemeController,
|
|
13
13
|
ConnectionController,
|
|
14
14
|
SwapController,
|
|
15
|
-
OnRampController
|
|
15
|
+
OnRampController,
|
|
16
|
+
CoreHelperUtil,
|
|
17
|
+
SendController
|
|
16
18
|
} from '@reown/appkit-core-react-native';
|
|
17
19
|
|
|
18
20
|
import {
|
|
@@ -71,7 +73,6 @@ export class AppKit {
|
|
|
71
73
|
private projectId: string;
|
|
72
74
|
private adapters: BlockchainAdapter[];
|
|
73
75
|
private networks: AppKitNetwork[];
|
|
74
|
-
private defaultNetwork?: AppKitNetwork;
|
|
75
76
|
private namespaces: ProposalNamespaces;
|
|
76
77
|
private config: AppKitConfig;
|
|
77
78
|
private extraConnectors: WalletConnector[];
|
|
@@ -79,7 +80,7 @@ export class AppKit {
|
|
|
79
80
|
|
|
80
81
|
constructor(config: AppKitConfig) {
|
|
81
82
|
this.projectId = config.projectId;
|
|
82
|
-
this.adapters = config.adapters;
|
|
83
|
+
this.adapters = config.adapters ?? [];
|
|
83
84
|
|
|
84
85
|
// Validate adapters to ensure no duplicate chainNamespaces
|
|
85
86
|
const namespaceMap = new Map<ChainNamespace, string>();
|
|
@@ -97,9 +98,6 @@ export class AppKit {
|
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
this.networks = NetworkUtil.formatNetworks(config.networks, this.projectId); //TODO: check this
|
|
100
|
-
this.defaultNetwork = config.defaultNetwork
|
|
101
|
-
? NetworkUtil.formatNetwork(config.defaultNetwork, this.projectId)
|
|
102
|
-
: undefined;
|
|
103
101
|
this.namespaces = WcHelpersUtil.createNamespaces(this.networks) as ProposalNamespaces;
|
|
104
102
|
this.config = config;
|
|
105
103
|
this.extraConnectors = config.extraConnectors || [];
|
|
@@ -118,9 +116,13 @@ export class AppKit {
|
|
|
118
116
|
const { namespaces, defaultChain, universalLink } = options ?? {};
|
|
119
117
|
const connector = await this.createConnector(type);
|
|
120
118
|
|
|
119
|
+
const chain =
|
|
120
|
+
defaultChain ??
|
|
121
|
+
NetworkUtil.getDefaultChainId(this.namespaces, OptionsController.state.defaultNetwork);
|
|
122
|
+
|
|
121
123
|
const approvedNamespaces = await connector.connect({
|
|
122
124
|
namespaces: namespaces ?? this.namespaces,
|
|
123
|
-
defaultChain,
|
|
125
|
+
defaultChain: chain,
|
|
124
126
|
universalLink,
|
|
125
127
|
siweConfig: this.config?.siweConfig
|
|
126
128
|
});
|
|
@@ -202,9 +204,16 @@ export class AppKit {
|
|
|
202
204
|
RouterController.reset('Connect');
|
|
203
205
|
TransactionsController.resetState();
|
|
204
206
|
SwapController.resetState();
|
|
207
|
+
SendController.resetState();
|
|
205
208
|
OnRampController.resetState();
|
|
206
209
|
ConnectionController.disconnect();
|
|
207
210
|
|
|
211
|
+
if (ConnectionsController.state.activeNamespace === undefined) {
|
|
212
|
+
ConnectionsController.setActiveNamespace(
|
|
213
|
+
OptionsController.state.defaultNetwork?.chainNamespace
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
208
217
|
if (OptionsController.state.isSiweEnabled) {
|
|
209
218
|
await SIWEController.signOut();
|
|
210
219
|
}
|
|
@@ -243,6 +252,14 @@ export class AppKit {
|
|
|
243
252
|
}
|
|
244
253
|
|
|
245
254
|
async switchNetwork(network: AppKitNetwork): Promise<void> {
|
|
255
|
+
const { isConnected } = ConnectionsController.state;
|
|
256
|
+
|
|
257
|
+
if (!isConnected) {
|
|
258
|
+
OptionsController.setDefaultNetwork(network);
|
|
259
|
+
|
|
260
|
+
return Promise.resolve();
|
|
261
|
+
}
|
|
262
|
+
|
|
246
263
|
const adapter = this.getAdapterByNamespace(network.chainNamespace);
|
|
247
264
|
if (!adapter) throw new Error('No active adapter');
|
|
248
265
|
|
|
@@ -256,10 +273,7 @@ export class AppKit {
|
|
|
256
273
|
}
|
|
257
274
|
});
|
|
258
275
|
|
|
259
|
-
ConnectionsController.setActiveNetwork(
|
|
260
|
-
adapter.getSupportedNamespace(),
|
|
261
|
-
`${adapter.getSupportedNamespace()}:${network.id}` as CaipNetworkId
|
|
262
|
-
);
|
|
276
|
+
ConnectionsController.setActiveNetwork(network.chainNamespace, network.caipNetworkId);
|
|
263
277
|
|
|
264
278
|
if (ConnectionsController.state.activeNamespace !== network.chainNamespace) {
|
|
265
279
|
ConnectionsController.setActiveNamespace(network.chainNamespace);
|
|
@@ -365,6 +379,13 @@ export class AppKit {
|
|
|
365
379
|
this.syncAccounts(initializedAdapters);
|
|
366
380
|
|
|
367
381
|
AccountController.setIsConnected(true);
|
|
382
|
+
|
|
383
|
+
if (
|
|
384
|
+
OptionsController.state.isSiweEnabled &&
|
|
385
|
+
ConnectionsController.state.activeNamespace === 'eip155'
|
|
386
|
+
) {
|
|
387
|
+
this.handleSiweChange();
|
|
388
|
+
}
|
|
368
389
|
}
|
|
369
390
|
} catch (error) {
|
|
370
391
|
// Use console.warn for non-critical initialization failures
|
|
@@ -464,8 +485,8 @@ export class AppKit {
|
|
|
464
485
|
});
|
|
465
486
|
});
|
|
466
487
|
|
|
467
|
-
const updateActiveNamespace = !Object.keys(approvedNamespaces).
|
|
468
|
-
|
|
488
|
+
const updateActiveNamespace = !Object.keys(approvedNamespaces).some(
|
|
489
|
+
namespace => namespace === ConnectionsController.state.activeNamespace
|
|
469
490
|
);
|
|
470
491
|
|
|
471
492
|
// If the active namespace is not in the approved namespaces or is undefined, set the first connected adapter's namespace as active
|
|
@@ -492,12 +513,15 @@ export class AppKit {
|
|
|
492
513
|
const namespace = adapter.getSupportedNamespace();
|
|
493
514
|
const chain = `${namespace}:${chainId}` as CaipNetworkId;
|
|
494
515
|
ConnectionsController.setActiveNetwork(namespace, chain);
|
|
516
|
+
const connection = ConnectionsController.state.connections.get(namespace);
|
|
517
|
+
const isAuth = !!connection?.properties?.provider;
|
|
495
518
|
|
|
496
519
|
const network = this.networks.find(n => n.id?.toString() === chainId);
|
|
497
520
|
this.syncBalances(adapter, network);
|
|
521
|
+
SendController.resetState();
|
|
498
522
|
|
|
499
|
-
if (
|
|
500
|
-
|
|
523
|
+
if (isAuth) {
|
|
524
|
+
ConnectionsController.fetchBalance();
|
|
501
525
|
}
|
|
502
526
|
|
|
503
527
|
if (namespace === 'eip155') {
|
|
@@ -526,20 +550,25 @@ export class AppKit {
|
|
|
526
550
|
OptionsController.setMetadata(options.metadata);
|
|
527
551
|
OptionsController.setIncludeWalletIds(options.includeWalletIds);
|
|
528
552
|
this.setExcludedWallets(options);
|
|
553
|
+
this.setCustomWallets(options);
|
|
529
554
|
OptionsController.setFeaturedWalletIds(options.featuredWalletIds);
|
|
530
555
|
OptionsController.setTokens(options.tokens);
|
|
531
|
-
OptionsController.setCustomWallets(options.customWallets);
|
|
532
556
|
OptionsController.setEnableAnalytics(options.enableAnalytics);
|
|
533
557
|
OptionsController.setDebug(options.debug);
|
|
534
558
|
OptionsController.setFeatures(options.features);
|
|
535
559
|
OptionsController.setStorage(options.storage);
|
|
536
560
|
|
|
561
|
+
if (options.defaultNetwork) {
|
|
562
|
+
const network = NetworkUtil.formatNetwork(options.defaultNetwork, this.projectId);
|
|
563
|
+
OptionsController.setDefaultNetwork(network);
|
|
564
|
+
}
|
|
565
|
+
|
|
537
566
|
ThemeController.setThemeMode(options.themeMode);
|
|
538
567
|
ThemeController.setThemeVariables(options.themeVariables);
|
|
539
568
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
569
|
+
OptionsController.setSdkVersion(
|
|
570
|
+
CoreHelperUtil.generateSdkVersion(this.adapters, ConstantsUtil.VERSION)
|
|
571
|
+
);
|
|
543
572
|
|
|
544
573
|
if (options.clipboardClient) {
|
|
545
574
|
OptionsController.setClipboardClient(options.clipboardClient);
|
|
@@ -563,8 +592,10 @@ export class AppKit {
|
|
|
563
592
|
const activeNamespace = await StorageUtil.getActiveNamespace();
|
|
564
593
|
if (activeNamespace) {
|
|
565
594
|
ConnectionsController.setActiveNamespace(activeNamespace);
|
|
566
|
-
} else if (
|
|
567
|
-
ConnectionsController.setActiveNamespace(
|
|
595
|
+
} else if (OptionsController.state.defaultNetwork) {
|
|
596
|
+
ConnectionsController.setActiveNamespace(
|
|
597
|
+
OptionsController.state.defaultNetwork?.chainNamespace
|
|
598
|
+
);
|
|
568
599
|
}
|
|
569
600
|
}
|
|
570
601
|
|
|
@@ -605,6 +636,23 @@ export class AppKit {
|
|
|
605
636
|
OptionsController.setExcludeWalletIds(excludedWallets);
|
|
606
637
|
}
|
|
607
638
|
|
|
639
|
+
private setCustomWallets(options: AppKitConfig) {
|
|
640
|
+
const { customWallets, extraConnectors, adapters } = options;
|
|
641
|
+
|
|
642
|
+
const customList = [...(customWallets ?? [])];
|
|
643
|
+
|
|
644
|
+
const addPhantom =
|
|
645
|
+
adapters.some(adapter => adapter.getSupportedNamespace() === 'solana') &&
|
|
646
|
+
extraConnectors?.some(connector => connector.type.toLowerCase() === 'phantom') &&
|
|
647
|
+
!customList.some(wallet => wallet.id === ConstantsUtil.PHANTOM_CUSTOM_WALLET.id);
|
|
648
|
+
|
|
649
|
+
if (addPhantom) {
|
|
650
|
+
customList.push(ConstantsUtil.PHANTOM_CUSTOM_WALLET);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
OptionsController.setCustomWallets(customList);
|
|
654
|
+
}
|
|
655
|
+
|
|
608
656
|
private async initAsyncValues(options: AppKitConfig) {
|
|
609
657
|
await this.initActiveNamespace();
|
|
610
658
|
await this.initRecentWallets(options);
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
AccountController,
|
|
4
4
|
CoreHelperUtil,
|
|
5
5
|
ModalController,
|
|
6
|
-
AssetUtil,
|
|
7
6
|
ThemeController,
|
|
8
|
-
ConnectionsController
|
|
7
|
+
ConnectionsController,
|
|
8
|
+
AssetController
|
|
9
9
|
} from '@reown/appkit-core-react-native';
|
|
10
10
|
|
|
11
11
|
import { AccountButton as AccountButtonUI, ThemeProvider } from '@reown/appkit-ui-react-native';
|
|
@@ -22,13 +22,14 @@ export interface AccountButtonProps {
|
|
|
22
22
|
export function AccountButton({ balance, disabled, style, testID }: AccountButtonProps) {
|
|
23
23
|
const { profileImage, profileName } = useSnapshot(AccountController.state);
|
|
24
24
|
const { themeMode, themeVariables } = useSnapshot(ThemeController.state);
|
|
25
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
25
26
|
const {
|
|
26
27
|
activeAddress: address,
|
|
27
28
|
activeBalance,
|
|
28
29
|
activeNetwork
|
|
29
30
|
} = useSnapshot(ConnectionsController.state);
|
|
30
31
|
|
|
31
|
-
const networkImage =
|
|
32
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
32
33
|
const showBalance = balance === 'show';
|
|
33
34
|
|
|
34
35
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSnapshot } from 'valtio';
|
|
2
2
|
import { AccountButton, type AccountButtonProps } from '../w3m-account-button';
|
|
3
3
|
import { ConnectButton, type ConnectButtonProps } from '../w3m-connect-button';
|
|
4
|
-
import {
|
|
4
|
+
import { ConnectionsController, ModalController } from '@reown/appkit-core-react-native';
|
|
5
5
|
|
|
6
6
|
export interface AppKitButtonProps {
|
|
7
7
|
balance?: AccountButtonProps['balance'];
|
|
@@ -22,7 +22,7 @@ export function AppKitButton({
|
|
|
22
22
|
accountStyle,
|
|
23
23
|
connectStyle
|
|
24
24
|
}: AppKitButtonProps) {
|
|
25
|
-
const { isConnected } = useSnapshot(
|
|
25
|
+
const { isConnected } = useSnapshot(ConnectionsController.state);
|
|
26
26
|
const { loading } = useSnapshot(ModalController.state);
|
|
27
27
|
|
|
28
28
|
return !loading && isConnected ? (
|
|
@@ -46,7 +46,9 @@ export function AppKit() {
|
|
|
46
46
|
|
|
47
47
|
const handleClose = async () => {
|
|
48
48
|
if (OptionsController.state.isSiweEnabled) {
|
|
49
|
+
const session = await SIWEController.getSession();
|
|
49
50
|
if (
|
|
51
|
+
!session &&
|
|
50
52
|
SIWEController.state.status !== 'success' &&
|
|
51
53
|
ConnectionsController.state.activeNamespace === 'eip155' &&
|
|
52
54
|
!!ConnectionsController.state.activeAddress
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useSnapshot } from 'valtio';
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import {
|
|
4
|
-
AccountController,
|
|
5
4
|
ApiController,
|
|
6
|
-
|
|
5
|
+
AssetController,
|
|
7
6
|
ConnectionsController,
|
|
8
7
|
EventsController,
|
|
9
8
|
ModalController,
|
|
9
|
+
OptionsController,
|
|
10
10
|
ThemeController
|
|
11
11
|
} from '@reown/appkit-core-react-native';
|
|
12
12
|
import { NetworkButton as NetworkButtonUI, ThemeProvider } from '@reown/appkit-ui-react-native';
|
|
@@ -17,11 +17,15 @@ export interface NetworkButtonProps {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function NetworkButton({ disabled, style }: NetworkButtonProps) {
|
|
20
|
-
const { isConnected } = useSnapshot(
|
|
21
|
-
const {
|
|
20
|
+
const { activeNetwork, isConnected } = useSnapshot(ConnectionsController.state);
|
|
21
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
22
|
+
const { defaultNetwork } = useSnapshot(OptionsController.state);
|
|
22
23
|
const { loading } = useSnapshot(ModalController.state);
|
|
23
24
|
const { themeMode, themeVariables } = useSnapshot(ThemeController.state);
|
|
24
25
|
|
|
26
|
+
const network = isConnected ? activeNetwork : defaultNetwork;
|
|
27
|
+
const networkImage = network ? networkImages[network.id] : undefined;
|
|
28
|
+
|
|
25
29
|
const onNetworkPress = () => {
|
|
26
30
|
ModalController.open({ view: 'Networks' });
|
|
27
31
|
EventsController.sendEvent({
|
|
@@ -33,7 +37,7 @@ export function NetworkButton({ disabled, style }: NetworkButtonProps) {
|
|
|
33
37
|
return (
|
|
34
38
|
<ThemeProvider themeMode={themeMode} themeVariables={themeVariables}>
|
|
35
39
|
<NetworkButtonUI
|
|
36
|
-
imageSrc={
|
|
40
|
+
imageSrc={networkImage}
|
|
37
41
|
imageHeaders={ApiController._getApiHeaders()}
|
|
38
42
|
disabled={disabled || loading}
|
|
39
43
|
style={style}
|
|
@@ -41,7 +45,7 @@ export function NetworkButton({ disabled, style }: NetworkButtonProps) {
|
|
|
41
45
|
loading={loading}
|
|
42
46
|
testID="network-button"
|
|
43
47
|
>
|
|
44
|
-
{
|
|
48
|
+
{network?.name ?? (isConnected ? 'Unknown Network' : 'Select Network')}
|
|
45
49
|
</NetworkButtonUI>
|
|
46
50
|
</ThemeProvider>
|
|
47
51
|
);
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@reown/appkit-ui-react-native';
|
|
13
13
|
import { type Transaction, type TransactionImage } from '@reown/appkit-common-react-native';
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
AssetController,
|
|
16
16
|
ConnectionsController,
|
|
17
17
|
ConstantsUtil,
|
|
18
18
|
EventsController,
|
|
@@ -33,13 +33,19 @@ export function AccountActivity({ style }: Props) {
|
|
|
33
33
|
const [initialLoad, setInitialLoad] = useState(true);
|
|
34
34
|
const { loading, transactions, next } = useSnapshot(TransactionsController.state);
|
|
35
35
|
const { activeNetwork } = useSnapshot(ConnectionsController.state);
|
|
36
|
-
const
|
|
36
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
37
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
37
38
|
const isSupported =
|
|
38
39
|
activeNetwork?.caipNetworkId &&
|
|
39
40
|
ConstantsUtil.ACTIVITY_SUPPORTED_CHAINS.includes(activeNetwork.caipNetworkId);
|
|
40
41
|
|
|
41
42
|
const handleLoadMore = () => {
|
|
42
43
|
const address = ConnectionsController.state.activeAddress;
|
|
44
|
+
|
|
45
|
+
if (!address) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
TransactionsController.fetchTransactions(address);
|
|
44
50
|
EventsController.sendEvent({
|
|
45
51
|
type: 'track',
|
|
@@ -54,8 +60,13 @@ export function AccountActivity({ style }: Props) {
|
|
|
54
60
|
};
|
|
55
61
|
|
|
56
62
|
const onRefresh = useCallback(async () => {
|
|
57
|
-
setRefreshing(true);
|
|
58
63
|
const address = ConnectionsController.state.activeAddress;
|
|
64
|
+
|
|
65
|
+
if (!address) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
setRefreshing(true);
|
|
59
70
|
await TransactionsController.fetchTransactions(address, true);
|
|
60
71
|
setRefreshing(false);
|
|
61
72
|
}, []);
|
|
@@ -65,8 +76,8 @@ export function AccountActivity({ style }: Props) {
|
|
|
65
76
|
}, [transactions]);
|
|
66
77
|
|
|
67
78
|
useEffect(() => {
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
const address = ConnectionsController.state.activeAddress;
|
|
80
|
+
if (!TransactionsController.state.transactions.length && address) {
|
|
70
81
|
TransactionsController.fetchTransactions(address, true);
|
|
71
82
|
}
|
|
72
83
|
// Set initial load to false after first fetch
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import { useSnapshot } from 'valtio';
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
AssetController,
|
|
12
12
|
ConnectionsController,
|
|
13
13
|
RouterController
|
|
14
14
|
} from '@reown/appkit-core-react-native';
|
|
@@ -31,7 +31,8 @@ export function AccountTokens({ style, isLoading }: Props) {
|
|
|
31
31
|
const Theme = useTheme();
|
|
32
32
|
const [refreshing, setRefreshing] = useState(false);
|
|
33
33
|
const { activeNetwork, balances } = useSnapshot(ConnectionsController.state);
|
|
34
|
-
const
|
|
34
|
+
const { networkImages } = useSnapshot(AssetController.state);
|
|
35
|
+
const networkImage = activeNetwork ? networkImages[activeNetwork.id] : undefined;
|
|
35
36
|
|
|
36
37
|
const getBalance = useCallback(async () => {
|
|
37
38
|
setRefreshing(true);
|
|
@@ -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} />
|
|
@@ -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,7 +13,8 @@ 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
19
|
// import { ConstantsUtil as CommonConstantsUtil } from '@reown/appkit-common-react-native';
|
|
20
20
|
import {
|
|
@@ -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,6 +150,18 @@ export function AccountDefaultView() {
|
|
|
145
150
|
RouterController.push('UpgradeEmailWallet');
|
|
146
151
|
};
|
|
147
152
|
|
|
153
|
+
const onSendPress = () => {
|
|
154
|
+
const network = ConnectionsController.state.activeNetwork?.caipNetworkId || '';
|
|
155
|
+
const isSmartAccount = ConnectionsController.state.accountType === 'smartAccount';
|
|
156
|
+
|
|
157
|
+
EventsController.sendEvent({
|
|
158
|
+
type: 'track',
|
|
159
|
+
event: 'OPEN_SEND',
|
|
160
|
+
properties: { network, isSmartAccount }
|
|
161
|
+
});
|
|
162
|
+
RouterController.push('WalletSend');
|
|
163
|
+
};
|
|
164
|
+
|
|
148
165
|
const onEmailPress = async () => {
|
|
149
166
|
// TODO: Uncomment when email update is enabled
|
|
150
167
|
// const email = ConnectionsController.state.connection?.properties?.email;
|
|
@@ -259,6 +276,19 @@ export function AccountDefaultView() {
|
|
|
259
276
|
<Text color="fg-100">Buy crypto</Text>
|
|
260
277
|
</ListItem>
|
|
261
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
|
+
)}
|
|
262
292
|
{showSwaps && (
|
|
263
293
|
<ListItem
|
|
264
294
|
chevron
|