@reown/appkit-core-react-native 0.0.0-feat-wallet-features-20240925132010 → 0.0.0-feat-smart-account-20241016175931

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/lib/commonjs/controllers/AccountController.js +11 -1
  2. package/lib/commonjs/controllers/AccountController.js.map +1 -1
  3. package/lib/commonjs/controllers/ConnectionController.js +11 -1
  4. package/lib/commonjs/controllers/ConnectionController.js.map +1 -1
  5. package/lib/commonjs/controllers/ModalController.js +3 -1
  6. package/lib/commonjs/controllers/ModalController.js.map +1 -1
  7. package/lib/commonjs/controllers/NetworkController.js +14 -1
  8. package/lib/commonjs/controllers/NetworkController.js.map +1 -1
  9. package/lib/commonjs/controllers/OptionsController.js +9 -1
  10. package/lib/commonjs/controllers/OptionsController.js.map +1 -1
  11. package/lib/commonjs/controllers/RouterController.js.map +1 -1
  12. package/lib/commonjs/controllers/SendController.js +4 -4
  13. package/lib/commonjs/controllers/SendController.js.map +1 -1
  14. package/lib/commonjs/controllers/TransactionsController.js +2 -2
  15. package/lib/commonjs/controllers/TransactionsController.js.map +1 -1
  16. package/lib/commonjs/controllers/WebviewController.js +40 -0
  17. package/lib/commonjs/controllers/WebviewController.js.map +1 -0
  18. package/lib/commonjs/index.js +7 -0
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/utils/ConstantsUtil.js +7 -1
  21. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  22. package/lib/commonjs/utils/StorageUtil.js +24 -0
  23. package/lib/commonjs/utils/StorageUtil.js.map +1 -1
  24. package/lib/module/controllers/AccountController.js +11 -1
  25. package/lib/module/controllers/AccountController.js.map +1 -1
  26. package/lib/module/controllers/ConnectionController.js +11 -1
  27. package/lib/module/controllers/ConnectionController.js.map +1 -1
  28. package/lib/module/controllers/ModalController.js +3 -1
  29. package/lib/module/controllers/ModalController.js.map +1 -1
  30. package/lib/module/controllers/NetworkController.js +14 -1
  31. package/lib/module/controllers/NetworkController.js.map +1 -1
  32. package/lib/module/controllers/OptionsController.js +9 -1
  33. package/lib/module/controllers/OptionsController.js.map +1 -1
  34. package/lib/module/controllers/RouterController.js.map +1 -1
  35. package/lib/module/controllers/SendController.js +4 -4
  36. package/lib/module/controllers/SendController.js.map +1 -1
  37. package/lib/module/controllers/TransactionsController.js +2 -2
  38. package/lib/module/controllers/TransactionsController.js.map +1 -1
  39. package/lib/module/controllers/WebviewController.js +35 -0
  40. package/lib/module/controllers/WebviewController.js.map +1 -0
  41. package/lib/module/index.js +1 -0
  42. package/lib/module/index.js.map +1 -1
  43. package/lib/module/utils/ConstantsUtil.js +7 -1
  44. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  45. package/lib/module/utils/StorageUtil.js +24 -0
  46. package/lib/module/utils/StorageUtil.js.map +1 -1
  47. package/lib/typescript/controllers/AccountController.d.ts +5 -1
  48. package/lib/typescript/controllers/AccountController.d.ts.map +1 -1
  49. package/lib/typescript/controllers/ApiController.d.ts +1 -1
  50. package/lib/typescript/controllers/ConnectionController.d.ts +3 -0
  51. package/lib/typescript/controllers/ConnectionController.d.ts.map +1 -1
  52. package/lib/typescript/controllers/ModalController.d.ts.map +1 -1
  53. package/lib/typescript/controllers/NetworkController.d.ts +3 -0
  54. package/lib/typescript/controllers/NetworkController.d.ts.map +1 -1
  55. package/lib/typescript/controllers/OptionsController.d.ts +4 -2
  56. package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
  57. package/lib/typescript/controllers/RouterController.d.ts +3 -1
  58. package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
  59. package/lib/typescript/controllers/TransactionsController.d.ts.map +1 -1
  60. package/lib/typescript/controllers/WebviewController.d.ts +18 -0
  61. package/lib/typescript/controllers/WebviewController.d.ts.map +1 -0
  62. package/lib/typescript/index.d.ts +1 -0
  63. package/lib/typescript/index.d.ts.map +1 -1
  64. package/lib/typescript/utils/ConstantsUtil.d.ts +2 -0
  65. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  66. package/lib/typescript/utils/StorageUtil.d.ts +4 -0
  67. package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
  68. package/lib/typescript/utils/TypeUtil.d.ts +103 -3
  69. package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
  70. package/package.json +2 -2
  71. package/src/controllers/AccountController.ts +16 -2
  72. package/src/controllers/ConnectionController.ts +15 -1
  73. package/src/controllers/ModalController.ts +3 -1
  74. package/src/controllers/NetworkController.ts +21 -1
  75. package/src/controllers/OptionsController.ts +18 -3
  76. package/src/controllers/RouterController.ts +7 -0
  77. package/src/controllers/SendController.ts +4 -4
  78. package/src/controllers/TransactionsController.ts +2 -2
  79. package/src/controllers/WebviewController.ts +48 -0
  80. package/src/index.ts +2 -0
  81. package/src/utils/ConstantsUtil.ts +11 -1
  82. package/src/utils/StorageUtil.ts +30 -0
  83. package/src/utils/TypeUtil.ts +105 -3
@@ -1,6 +1,7 @@
1
1
  import { proxy, ref } from 'valtio';
2
2
  import type { CaipNetwork, CaipNetworkId } from '../utils/TypeUtil';
3
3
  import { PublicStateController } from './PublicStateController';
4
+ import { NetworkUtil } from '@reown/appkit-common-react-native';
4
5
 
5
6
  // -- Types --------------------------------------------- //
6
7
  export interface NetworkControllerClient {
@@ -18,12 +19,14 @@ export interface NetworkControllerState {
18
19
  caipNetwork?: CaipNetwork;
19
20
  requestedCaipNetworks?: CaipNetwork[];
20
21
  approvedCaipNetworkIds?: CaipNetworkId[];
22
+ smartAccountEnabledNetworks: number[];
21
23
  }
22
24
 
23
25
  // -- State --------------------------------------------- //
24
26
  const state = proxy<NetworkControllerState>({
25
27
  supportsAllNetworks: true,
26
- isDefaultCaipNetwork: false
28
+ isDefaultCaipNetwork: false,
29
+ smartAccountEnabledNetworks: []
27
30
  });
28
31
 
29
32
  // -- Controller ---------------------------------------- //
@@ -57,6 +60,22 @@ export const NetworkController = {
57
60
  state.requestedCaipNetworks = requestedNetworks;
58
61
  },
59
62
 
63
+ setSmartAccountEnabledNetworks(
64
+ smartAccountEnabledNetworks: NetworkControllerState['smartAccountEnabledNetworks']
65
+ ) {
66
+ state.smartAccountEnabledNetworks = smartAccountEnabledNetworks;
67
+ },
68
+
69
+ checkIfSmartAccountEnabled() {
70
+ const networkId = NetworkUtil.caipNetworkIdToNumber(state.caipNetwork?.id);
71
+
72
+ if (!networkId) {
73
+ return false;
74
+ }
75
+
76
+ return Boolean(state.smartAccountEnabledNetworks?.includes(Number(networkId)));
77
+ },
78
+
60
79
  async getApprovedCaipNetworksData() {
61
80
  const data = await this._getClient().getApprovedCaipNetworksData();
62
81
  state.supportsAllNetworks = data.supportsAllNetworks;
@@ -81,5 +100,6 @@ export const NetworkController = {
81
100
  }
82
101
  state.approvedCaipNetworkIds = undefined;
83
102
  state.supportsAllNetworks = true;
103
+ state.smartAccountEnabledNetworks = [];
84
104
  }
85
105
  };
@@ -1,5 +1,14 @@
1
1
  import { proxy, ref } from 'valtio';
2
- import type { CustomWallet, Metadata, ProjectId, SdkVersion, Tokens } from '../utils/TypeUtil';
2
+ import type {
3
+ CustomWallet,
4
+ Features,
5
+ Metadata,
6
+ ProjectId,
7
+ SdkType,
8
+ SdkVersion,
9
+ Tokens
10
+ } from '../utils/TypeUtil';
11
+ import { ConstantsUtil } from '../utils/ConstantsUtil';
3
12
 
4
13
  // -- Types --------------------------------------------- //
5
14
  export interface ClipboardClient {
@@ -15,17 +24,19 @@ export interface OptionsControllerState {
15
24
  customWallets?: CustomWallet[];
16
25
  tokens?: Tokens;
17
26
  enableAnalytics?: boolean;
18
- sdkType: string;
27
+ sdkType: SdkType;
19
28
  sdkVersion: SdkVersion;
20
29
  metadata?: Metadata;
21
30
  isSiweEnabled?: boolean;
31
+ features?: Features;
22
32
  }
23
33
 
24
34
  // -- State --------------------------------------------- //
25
35
  const state = proxy<OptionsControllerState>({
26
36
  projectId: '',
27
37
  sdkType: 'appkit',
28
- sdkVersion: 'react-native-wagmi-undefined'
38
+ sdkVersion: 'react-native-wagmi-undefined',
39
+ features: ConstantsUtil.DEFAULT_FEATURES
29
40
  });
30
41
 
31
42
  // -- Controller ---------------------------------------- //
@@ -76,6 +87,10 @@ export const OptionsController = {
76
87
  state.isSiweEnabled = isSiweEnabled;
77
88
  },
78
89
 
90
+ setFeatures(features: OptionsControllerState['features']) {
91
+ state.features = { ...ConstantsUtil.DEFAULT_FEATURES, ...features };
92
+ },
93
+
79
94
  isClipboardAvailable() {
80
95
  return !!state._clipboardClient;
81
96
  },
@@ -1,5 +1,6 @@
1
1
  import { proxy } from 'valtio';
2
2
  import type { WcWallet, CaipNetwork, Connector } from '../utils/TypeUtil';
3
+ import type { SocialProvider } from '@reown/appkit-common-react-native';
3
4
 
4
5
  // -- Types --------------------------------------------- //
5
6
  type TransactionAction = {
@@ -17,9 +18,13 @@ export interface RouterControllerState {
17
18
  | 'AccountDefault'
18
19
  | 'AllWallets'
19
20
  | 'Connect'
21
+ | 'ConnectSocials'
20
22
  | 'ConnectingExternal'
21
23
  | 'ConnectingSiwe'
24
+ | 'ConnectingSocial'
25
+ | 'ConnectingFarcaster'
22
26
  | 'ConnectingWalletConnect'
27
+ | 'Create'
23
28
  | 'EmailVerifyDevice'
24
29
  | 'EmailVerifyOtp'
25
30
  | 'GetWallet'
@@ -30,6 +35,7 @@ export interface RouterControllerState {
30
35
  | 'UpdateEmailSecondaryOtp'
31
36
  | 'UpdateEmailWallet'
32
37
  | 'UpgradeEmailWallet'
38
+ | 'UpgradeToSmartAccount'
33
39
  | 'WalletCompatibleNetworks'
34
40
  | 'WalletReceive'
35
41
  | 'WalletSend'
@@ -44,6 +50,7 @@ export interface RouterControllerState {
44
50
  network?: CaipNetwork;
45
51
  email?: string;
46
52
  newEmail?: string;
53
+ socialProvider?: SocialProvider;
47
54
  };
48
55
  transactionStack: TransactionAction[];
49
56
  }
@@ -97,7 +97,7 @@ export const SendController = {
97
97
  type: 'track',
98
98
  event: 'SEND_INITIATED',
99
99
  properties: {
100
- isSmartAccount: false,
100
+ isSmartAccount: AccountController.state.preferredAccountType === 'smartAccount',
101
101
  token: this.state.token.address,
102
102
  amount: this.state.sendTokenAmount,
103
103
  network: NetworkController.state.caipNetwork?.id || ''
@@ -120,7 +120,7 @@ export const SendController = {
120
120
  type: 'track',
121
121
  event: 'SEND_INITIATED',
122
122
  properties: {
123
- isSmartAccount: false,
123
+ isSmartAccount: AccountController.state.preferredAccountType === 'smartAccount',
124
124
  token: this.state.token?.symbol,
125
125
  amount: this.state.sendTokenAmount,
126
126
  network: NetworkController.state.caipNetwork?.id || ''
@@ -162,7 +162,7 @@ export const SendController = {
162
162
  type: 'track',
163
163
  event: 'SEND_SUCCESS',
164
164
  properties: {
165
- isSmartAccount: false,
165
+ isSmartAccount: AccountController.state.preferredAccountType === 'smartAccount',
166
166
  token: this.state.token?.symbol || '',
167
167
  amount: params.sendTokenAmount,
168
168
  network: NetworkController.state.caipNetwork?.id || ''
@@ -175,7 +175,7 @@ export const SendController = {
175
175
  type: 'track',
176
176
  event: 'SEND_ERROR',
177
177
  properties: {
178
- isSmartAccount: false,
178
+ isSmartAccount: AccountController.state.preferredAccountType === 'smartAccount',
179
179
  token: this.state.token?.symbol || '',
180
180
  amount: params.sendTokenAmount,
181
181
  network: NetworkController.state.caipNetwork?.id || ''
@@ -5,6 +5,7 @@ import { EventsController } from './EventsController';
5
5
  import { SnackController } from './SnackController';
6
6
  import { NetworkController } from './NetworkController';
7
7
  import { BlockchainApiController } from './BlockchainApiController';
8
+ import { AccountController } from './AccountController';
8
9
 
9
10
  // -- Types --------------------------------------------- //
10
11
  type TransactionByMonthMap = Record<string, Transaction[]>;
@@ -55,7 +56,6 @@ export const TransactionsController = {
55
56
 
56
57
  const nonSpamTransactions = this.filterSpamTransactions(response?.data ?? []);
57
58
  let filteredTransactions = [...state.transactions, ...nonSpamTransactions];
58
- filteredTransactions = [...state.transactions, ...nonSpamTransactions];
59
59
 
60
60
  if (reset) {
61
61
  filteredTransactions = nonSpamTransactions;
@@ -75,7 +75,7 @@ export const TransactionsController = {
75
75
  address: accountAddress,
76
76
  projectId,
77
77
  cursor: state.next,
78
- isSmartAccount: false
78
+ isSmartAccount: AccountController.state.preferredAccountType === 'smartAccount'
79
79
  }
80
80
  });
81
81
  SnackController.showError('Failed to fetch transactions');
@@ -0,0 +1,48 @@
1
+ import type { SocialProvider } from '@reown/appkit-common-react-native';
2
+ import { proxy, subscribe as sub } from 'valtio';
3
+
4
+ // -- Types --------------------------------------------- //
5
+ export interface WebviewControllerState {
6
+ frameViewVisible: boolean;
7
+ webviewVisible: boolean;
8
+ webviewUrl?: string;
9
+ connecting?: boolean;
10
+ connectingProvider?: SocialProvider;
11
+ }
12
+
13
+ // -- State --------------------------------------------- //
14
+ const state = proxy<WebviewControllerState>({
15
+ frameViewVisible: false,
16
+ webviewVisible: false,
17
+ connecting: false,
18
+ connectingProvider: undefined
19
+ });
20
+
21
+ // -- Controller ---------------------------------------- //
22
+ export const WebviewController = {
23
+ state,
24
+
25
+ subscribe(callback: (newState: WebviewControllerState) => void) {
26
+ return sub(state, () => callback(state));
27
+ },
28
+
29
+ setFrameViewVisible(frameViewVisible: WebviewControllerState['frameViewVisible']) {
30
+ state.frameViewVisible = frameViewVisible;
31
+ },
32
+
33
+ setWebviewVisible(visible: WebviewControllerState['webviewVisible']) {
34
+ state.webviewVisible = visible;
35
+ },
36
+
37
+ setWebviewUrl(url: WebviewControllerState['webviewUrl']) {
38
+ state.webviewUrl = url;
39
+ },
40
+
41
+ setConnecting(connecting: WebviewControllerState['connecting']) {
42
+ state.connecting = connecting;
43
+ },
44
+
45
+ setConnectingProvider(provider: WebviewControllerState['connectingProvider']) {
46
+ state.connectingProvider = provider;
47
+ }
48
+ };
package/src/index.ts CHANGED
@@ -56,6 +56,8 @@ export {
56
56
 
57
57
  export { SendController, type SendControllerState } from './controllers/SendController';
58
58
 
59
+ export { WebviewController, type WebviewControllerState } from './controllers/WebviewController';
60
+
59
61
  // -- Utils -------------------------------------------------------------------
60
62
  export { ApiUtil } from './utils/ApiUtil';
61
63
  export { AssetUtil } from './utils/AssetUtil';
@@ -1,3 +1,11 @@
1
+ import type { Features } from './TypeUtil';
2
+
3
+ const defaultFeatures: Features = {
4
+ email: true,
5
+ emailShowWallets: true,
6
+ socials: ['x', 'discord', 'apple', 'facebook', 'farcaster']
7
+ };
8
+
1
9
  export const ConstantsUtil = {
2
10
  FOUR_MINUTES_MS: 240000,
3
11
 
@@ -9,5 +17,7 @@ export const ConstantsUtil = {
9
17
 
10
18
  LINKING_ERROR: 'LINKING_ERROR',
11
19
 
12
- NATIVE_TOKEN_ADDRESS: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
20
+ NATIVE_TOKEN_ADDRESS: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
21
+
22
+ DEFAULT_FEATURES: defaultFeatures
13
23
  };
@@ -1,12 +1,14 @@
1
1
  /* eslint-disable no-console */
2
2
  import AsyncStorage from '@react-native-async-storage/async-storage';
3
3
  import type { ConnectorType, WcWallet } from './TypeUtil';
4
+ import type { SocialProvider } from '@reown/appkit-common-react-native';
4
5
 
5
6
  // -- Helpers -----------------------------------------------------------------
6
7
  const WC_DEEPLINK = 'WALLETCONNECT_DEEPLINK_CHOICE';
7
8
  const RECENT_WALLET = '@w3m/recent';
8
9
  const CONNECTED_WALLET_IMAGE_URL = '@w3m/connected_wallet_image_url';
9
10
  const CONNECTED_CONNECTOR = '@w3m/connected_connector';
11
+ const CONNECTED_SOCIAL = '@appkit/connected_social';
10
12
 
11
13
  // -- Utility -----------------------------------------------------------------
12
14
  export const StorageUtil = {
@@ -134,5 +136,33 @@ export const StorageUtil = {
134
136
  } catch {
135
137
  console.info('Unable to remove Connected Wallet Image URL');
136
138
  }
139
+ },
140
+
141
+ async setConnectedSocialProvider(provider: SocialProvider) {
142
+ try {
143
+ await AsyncStorage.setItem(CONNECTED_SOCIAL, JSON.stringify(provider));
144
+ } catch {
145
+ console.info('Unable to set Connected Social Provider');
146
+ }
147
+ },
148
+
149
+ async getConnectedSocialProvider() {
150
+ try {
151
+ const provider = (await AsyncStorage.getItem(CONNECTED_SOCIAL)) as SocialProvider;
152
+
153
+ return provider ? JSON.parse(provider) : undefined;
154
+ } catch {
155
+ console.info('Unable to get Connected Social Provider');
156
+ }
157
+
158
+ return undefined;
159
+ },
160
+
161
+ async removeConnectedSocialProvider() {
162
+ try {
163
+ await AsyncStorage.removeItem(CONNECTED_SOCIAL);
164
+ } catch {
165
+ console.info('Unable to remove Connected Social Provider');
166
+ }
137
167
  }
138
168
  };
@@ -1,4 +1,5 @@
1
- import type { Balance, Transaction } from '@reown/appkit-common-react-native';
1
+ import { type EventEmitter } from 'events';
2
+ import type { Balance, SocialProvider, Transaction } from '@reown/appkit-common-react-native';
2
3
 
3
4
  export interface BaseError {
4
5
  message?: string;
@@ -55,11 +56,31 @@ export type CaipNamespaces = Record<
55
56
  }
56
57
  >;
57
58
 
59
+ export type SdkType = 'appkit';
60
+
58
61
  export type SdkVersion =
59
62
  | `react-native-wagmi-${string}`
60
63
  | `react-native-ethers5-${string}`
61
64
  | `react-native-ethers-${string}`;
62
65
 
66
+ export type Features = {
67
+ /**
68
+ * @description Enable or disable the email feature. Enabled by default.
69
+ * @type {boolean}
70
+ */
71
+ email?: boolean;
72
+ /**
73
+ * @description Show or hide the regular wallet options when email is enabled. Enabled by default.
74
+ * @type {boolean}
75
+ */
76
+ emailShowWallets?: boolean;
77
+ /**
78
+ * @description Enable or disable the socials feature. Enabled by default.
79
+ * @type {FeaturesSocials[]}
80
+ */
81
+ socials?: SocialProvider[] | false;
82
+ };
83
+
63
84
  // -- ApiController Types -------------------------------------------------------
64
85
  export interface WcWallet {
65
86
  id: string;
@@ -356,18 +377,34 @@ export type Event =
356
377
  | {
357
378
  type: 'track';
358
379
  event: 'CLICK_SIGN_SIWE_MESSAGE';
380
+ properties: {
381
+ network: string;
382
+ isSmartAccount: boolean;
383
+ };
359
384
  }
360
385
  | {
361
386
  type: 'track';
362
387
  event: 'CLICK_CANCEL_SIWE';
388
+ properties: {
389
+ network: string;
390
+ isSmartAccount: boolean;
391
+ };
363
392
  }
364
393
  | {
365
394
  type: 'track';
366
395
  event: 'SIWE_AUTH_SUCCESS';
396
+ properties: {
397
+ network: string;
398
+ isSmartAccount: boolean;
399
+ };
367
400
  }
368
401
  | {
369
402
  type: 'track';
370
403
  event: 'SIWE_AUTH_ERROR';
404
+ properties: {
405
+ network: string;
406
+ isSmartAccount: boolean;
407
+ };
371
408
  }
372
409
  | {
373
410
  type: 'track';
@@ -433,6 +470,35 @@ export type Event =
433
470
  token: string;
434
471
  amount: number;
435
472
  };
473
+ }
474
+ | {
475
+ type: 'track';
476
+ event: 'SOCIAL_LOGIN_STARTED';
477
+ properties: {
478
+ provider: SocialProvider;
479
+ };
480
+ }
481
+ | {
482
+ type: 'track';
483
+ event: 'SOCIAL_LOGIN_SUCCESS';
484
+ properties: {
485
+ provider: SocialProvider;
486
+ };
487
+ }
488
+ | {
489
+ type: 'track';
490
+ event: 'SOCIAL_LOGIN_ERROR';
491
+ properties: {
492
+ provider: SocialProvider;
493
+ };
494
+ }
495
+ | {
496
+ type: 'track';
497
+ event: 'SET_PREFERRED_ACCOUNT_TYPE';
498
+ properties: {
499
+ accountType: AppKitFrameAccountType;
500
+ network: string;
501
+ };
436
502
  };
437
503
 
438
504
  // -- Send Controller Types -------------------------------------
@@ -457,24 +523,46 @@ export interface WriteContractArgs {
457
523
 
458
524
  // -- Email Types ------------------------------------------------
459
525
  /**
460
- * Matches type defined for packages/email/src/AppKitFrameProvider.ts
526
+ * Matches type defined for packages/wallet/src/AppKitFrameProvider.ts
461
527
  * It's duplicated in order to decouple scaffold from email package
462
528
  */
529
+
530
+ export type AppKitFrameAccountType = 'eoa' | 'smartAccount';
531
+
463
532
  export interface AppKitFrameProvider {
464
533
  readonly id: string;
465
534
  readonly name: string;
535
+ getEventEmitter(): EventEmitter;
466
536
  getSecureSiteURL(): string;
467
537
  getSecureSiteDashboardURL(): string;
468
538
  getSecureSiteIconURL(): string;
469
539
  getSecureSiteHeaders(): Record<string, string>;
470
- getLoginEmailUsed(): Promise<boolean>;
471
540
  getEmail(): string | undefined;
541
+ getUsername(): string | undefined;
542
+ getLastUsedChainId(): Promise<number | undefined>;
472
543
  rejectRpcRequest(): void;
473
544
  connectEmail(payload: { email: string }): Promise<{
474
545
  action: 'VERIFY_DEVICE' | 'VERIFY_OTP';
475
546
  }>;
476
547
  connectDevice(): Promise<unknown>;
548
+ connectSocial(uri: string): Promise<{
549
+ chainId: string | number;
550
+ email: string;
551
+ address: string;
552
+ accounts?:
553
+ | {
554
+ type: AppKitFrameAccountType;
555
+ address: string;
556
+ }[]
557
+ | undefined;
558
+ userName?: string | undefined;
559
+ }>;
560
+ getSocialRedirectUri(payload: { provider: SocialProvider }): Promise<{
561
+ uri: string;
562
+ }>;
477
563
  connectOtp(payload: { otp: string }): Promise<unknown>;
564
+ connectFarcaster: () => Promise<{ username: string }>;
565
+ getFarcasterUri(): Promise<{ url: string }>;
478
566
  isConnected(): Promise<{
479
567
  isConnected: boolean;
480
568
  }>;
@@ -495,17 +583,31 @@ export interface AppKitFrameProvider {
495
583
  syncDappData(payload: {
496
584
  projectId: string;
497
585
  sdkVersion: SdkVersion;
586
+ sdkType: SdkType;
498
587
  metadata?: Metadata;
499
588
  }): Promise<unknown>;
500
589
  connect(payload?: { chainId: number | undefined }): Promise<{
501
590
  chainId: number;
502
591
  email: string;
503
592
  address: string;
593
+ smartAccountDeployed: boolean;
594
+ preferredAccountType: AppKitFrameAccountType;
504
595
  }>;
505
596
  switchNetwork(chainId: number): Promise<{
506
597
  chainId: number;
507
598
  }>;
599
+ setPreferredAccount(type: AppKitFrameAccountType): Promise<{
600
+ type: AppKitFrameAccountType;
601
+ address: string;
602
+ }>;
603
+ getSmartAccountEnabledNetworks(): Promise<{
604
+ smartAccountEnabledNetworks: number[];
605
+ }>;
508
606
  disconnect(): Promise<unknown>;
509
607
  request(req: any): Promise<any>;
510
608
  AuthView: () => JSX.Element | null;
609
+ Webview: () => JSX.Element | null;
610
+ onSetPreferredAccount: (
611
+ callback: (values: { type: AppKitFrameAccountType; address: string }) => void
612
+ ) => void;
511
613
  }