@reown/appkit-controllers 1.8.14-signet-fix.0 → 1.8.14-wallet-button-fix.0

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 (44) hide show
  1. package/dist/esm/exports/index.js +2 -0
  2. package/dist/esm/exports/index.js.map +1 -1
  3. package/dist/esm/exports/react.js +70 -28
  4. package/dist/esm/exports/react.js.map +1 -1
  5. package/dist/esm/src/controllers/ConnectionController.js +3 -0
  6. package/dist/esm/src/controllers/ConnectionController.js.map +1 -1
  7. package/dist/esm/src/controllers/OptionsController.js +0 -3
  8. package/dist/esm/src/controllers/OptionsController.js.map +1 -1
  9. package/dist/esm/src/controllers/PublicStateController.js +2 -1
  10. package/dist/esm/src/controllers/PublicStateController.js.map +1 -1
  11. package/dist/esm/src/utils/ApiControllerUtil.js +34 -0
  12. package/dist/esm/src/utils/ApiControllerUtil.js.map +1 -0
  13. package/dist/esm/src/utils/ConnectUtil.js +83 -68
  14. package/dist/esm/src/utils/ConnectUtil.js.map +1 -1
  15. package/dist/esm/src/utils/ConnectionControllerUtil.js +36 -0
  16. package/dist/esm/src/utils/ConnectionControllerUtil.js.map +1 -1
  17. package/dist/esm/src/utils/ConnectorUtil.js +287 -0
  18. package/dist/esm/src/utils/ConnectorUtil.js.map +1 -0
  19. package/dist/esm/src/utils/ConstantsUtil.js +13 -3
  20. package/dist/esm/src/utils/ConstantsUtil.js.map +1 -1
  21. package/dist/esm/src/utils/WalletUtil.js +161 -0
  22. package/dist/esm/src/utils/WalletUtil.js.map +1 -0
  23. package/dist/esm/tests/controllers/ConnectionController.test.js +3 -1
  24. package/dist/esm/tests/controllers/ConnectionController.test.js.map +1 -1
  25. package/dist/esm/tests/hooks/react.test.js +497 -3
  26. package/dist/esm/tests/hooks/react.test.js.map +1 -1
  27. package/dist/esm/tests/utils/ControllerUtil.test.js +500 -0
  28. package/dist/esm/tests/utils/ControllerUtil.test.js.map +1 -0
  29. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  30. package/dist/types/exports/index.d.ts +2 -0
  31. package/dist/types/exports/react.d.ts +26 -10
  32. package/dist/types/src/controllers/AdapterController/ChainAdapterBlueprint.d.ts +0 -1
  33. package/dist/types/src/controllers/OptionsController.d.ts +1 -12
  34. package/dist/types/src/controllers/PublicStateController.d.ts +6 -0
  35. package/dist/types/src/utils/ApiControllerUtil.d.ts +8 -0
  36. package/dist/types/src/utils/ConnectUtil.d.ts +22 -6
  37. package/dist/types/src/utils/ConnectionControllerUtil.d.ts +2 -0
  38. package/dist/types/src/utils/ConnectorUtil.d.ts +58 -0
  39. package/dist/types/src/utils/ConstantsUtil.d.ts +4 -0
  40. package/dist/types/src/utils/TypeUtil.d.ts +17 -1
  41. package/dist/types/src/utils/ViemUtil.d.ts +12 -12
  42. package/dist/types/src/utils/WalletUtil.d.ts +81 -0
  43. package/dist/types/tests/utils/ControllerUtil.test.d.ts +1 -0
  44. package/package.json +3 -3
@@ -55,7 +55,9 @@ export { ExchangeController } from '../src/controllers/ExchangeController.js';
55
55
  export type { ExchangeControllerState } from '../src/controllers/ExchangeController.js';
56
56
  export { AssetUtil } from '../src/utils/AssetUtil.js';
57
57
  export { ConstantsUtil } from '../src/utils/ConstantsUtil.js';
58
+ export { WalletUtil } from '../src/utils/WalletUtil.js';
58
59
  export { CoreHelperUtil, type OpenTarget } from '../src/utils/CoreHelperUtil.js';
60
+ export { ConnectorUtil } from '../src/utils/ConnectorUtil.js';
59
61
  export { StorageUtil } from '../src/utils/StorageUtil.js';
60
62
  export { RouterUtil } from '../src/utils/RouterUtil.js';
61
63
  export { OptionsUtil } from '../src/utils/OptionsUtil.js';
@@ -78,9 +78,14 @@ export declare function useAppKitConnection({ namespace, onSuccess, onError }: U
78
78
  };
79
79
  export interface UseAppKitWalletsReturn {
80
80
  /**
81
- * List of all wallets (injected wallets and WalletConnect wallets combined)
81
+ * List of wallets for the initial connect view including WalletConnect wallet and injected wallets together. If user doesn't have any injected wallets, it'll fill the list with most ranked WalletConnect wallets.
82
82
  */
83
- data: WalletItem[];
83
+ wallets: WalletItem[];
84
+ /**
85
+ * List of WalletConnect wallets from Wallet Guide API. Useful to display all available WalletConnect wallets in a separate Search Wallets view.
86
+ * @see https://walletguide.walletconnect.network/.
87
+ */
88
+ wcWallets: WalletItem[];
84
89
  /**
85
90
  * Boolean that indicates if WalletConnect wallets are being fetched.
86
91
  */
@@ -90,23 +95,30 @@ export interface UseAppKitWalletsReturn {
90
95
  */
91
96
  isFetchingWcUri: boolean;
92
97
  /**
93
- * The current WalletConnect URI for QR code display.
94
- * This is set when connecting to a WalletConnect wallet.
98
+ * Boolean that indicates if the AppKit is initialized. It's useful to render a fallback UI when the AppKit initializes and detects all injected wallets.
99
+ */
100
+ isInitialized: boolean;
101
+ /**
102
+ * The current WalletConnect URI for QR code display. This is set when connecting to a WalletConnect wallet. Reset with resetWcUri().
95
103
  */
96
104
  wcUri?: string;
97
105
  /**
98
- * The current page number.
106
+ * The wallet currently being connected to. This is set when a connection is initiated and cleared when it completes or fails. For WalletConnect wallets, resetWcUri() should be called to clear the state.
107
+ */
108
+ connectingWallet?: WalletItem;
109
+ /**
110
+ * The current page number of WalletConnect wallets.
99
111
  */
100
112
  page: number;
101
113
  /**
102
- * The total number of available wallets.
114
+ * The total number of available WalletConnect wallets based on the AppKit configurations and given parameters.
103
115
  */
104
116
  count: number;
105
117
  /**
106
- * Function to fetch WalletConnect wallets from the explorer API.
107
- * This is useful for pagination or initial load.
118
+ * Function to fetch WalletConnect wallets from the explorer API. Allows to list, search and paginate through the wallets.
108
119
  * @param options - Options for fetching wallets
109
120
  * @param options.page - Page number to fetch (default: 1)
121
+ * @param options.query - Search query to filter wallets (default: '')
110
122
  */
111
123
  fetchWallets: (options?: {
112
124
  page?: number;
@@ -114,14 +126,18 @@ export interface UseAppKitWalletsReturn {
114
126
  }) => Promise<void>;
115
127
  /**
116
128
  * Function to connect to a wallet.
117
- * - For WalletConnect wallets: initiates WC connection and returns the URI in the onSuccess callback
118
- * - For injected connectors: triggers the extension/wallet directly
129
+ * - For WalletConnect wallets: initiates WC connection and returns the URI with the `wcUri` state.
130
+ * - For injected connectors: triggers the extension/wallet directly.
119
131
  *
120
132
  * @param wallet - The wallet item to connect to
121
133
  * @param callbacks - Success and error callbacks
122
134
  * @returns Promise that resolves when connection completes or rejects on error
123
135
  */
124
136
  connect: (wallet: WalletItem, namespace?: ChainNamespace) => Promise<void>;
137
+ /**
138
+ * Function to reset the WC URI. Useful to keep `connectingWallet` state sync with the WC URI. Can be called when the QR code is closed.
139
+ */
140
+ resetWcUri: () => void;
125
141
  }
126
142
  /**
127
143
  * Headless hook for wallet connection.
@@ -445,7 +445,6 @@ export declare namespace AdapterBlueprint {
445
445
  type GetAccountsParams = {
446
446
  id: AppKitConnector['id'];
447
447
  namespace?: ChainNamespace;
448
- caipNetworkId?: CaipNetwork['caipNetworkId'];
449
448
  };
450
449
  interface GetConnectionParams<C extends ChainAdapterConnector = ChainAdapterConnector> {
451
450
  connectorId?: string;
@@ -85,11 +85,6 @@ export interface OptionsControllerStatePublic {
85
85
  * @default true
86
86
  */
87
87
  enableCoinbase?: boolean;
88
- /**
89
- * Enable or disable the AppKit Headless mode to build custom connect user interfaces.
90
- * @default true
91
- */
92
- enableHeadless?: boolean;
93
88
  /**
94
89
  * Enable or disable the Injected wallet.
95
90
  * @default true
@@ -231,7 +226,6 @@ export declare const OptionsController: {
231
226
  setAllowUnsupportedChain(allowUnsupportedChain: OptionsControllerState["allowUnsupportedChain"]): void;
232
227
  setManualWCControl(manualWCControl: OptionsControllerState["manualWCControl"]): void;
233
228
  setEnableNetworkSwitch(enableNetworkSwitch: OptionsControllerState["enableNetworkSwitch"]): void;
234
- setEnableHeadless(enableHeadless: OptionsControllerState["enableHeadless"]): void;
235
229
  setEnableMobileFullScreen(enableMobileFullScreen: OptionsControllerState["enableMobileFullScreen"]): void;
236
230
  setEnableReconnect(enableReconnect: OptionsControllerState["enableReconnect"]): void;
237
231
  setCoinbasePreference(coinbasePreference: OptionsControllerState["coinbasePreference"]): void;
@@ -1635,12 +1629,6 @@ export declare const OptionsController: {
1635
1629
  */
1636
1630
  | undefined;
1637
1631
  readonly enableCoinbase?: boolean
1638
- /**
1639
- * Enable or disable the AppKit Headless mode to build custom connect user interfaces.
1640
- * @default true
1641
- */
1642
- | undefined;
1643
- readonly enableHeadless?: boolean
1644
1632
  /**
1645
1633
  * Enable or disable the Injected wallet.
1646
1634
  * @default true
@@ -1709,6 +1697,7 @@ export declare const OptionsController: {
1709
1697
  readonly collapseWallets?: boolean | undefined;
1710
1698
  readonly pay?: boolean | undefined;
1711
1699
  readonly reownAuthentication?: boolean | undefined;
1700
+ readonly headless?: boolean | undefined;
1712
1701
  } | undefined;
1713
1702
  readonly siwx?: {
1714
1703
  readonly createMessage: (input: import("../utils/SIWXUtil.js").SIWXMessage.Input) => Promise<import("../utils/SIWXUtil.js").SIWXMessage>;
@@ -1,4 +1,5 @@
1
1
  import type { CaipNetworkId, ChainNamespace } from '@reown/appkit-common';
2
+ import type { WalletItem } from '../utils/ConnectUtil.js';
2
3
  export interface PublicStateControllerState {
3
4
  /**
4
5
  * @description Indicates if the AppKit is loading.
@@ -25,6 +26,11 @@ export interface PublicStateControllerState {
25
26
  * @type {boolean}
26
27
  */
27
28
  initialized: boolean;
29
+ /**
30
+ * @description Indicates the wallet item that is currently being connecting.
31
+ * @type {WalletItem | undefined}
32
+ */
33
+ connectingWallet: WalletItem | undefined;
28
34
  }
29
35
  export declare const PublicStateController: {
30
36
  state: PublicStateControllerState;
@@ -0,0 +1,8 @@
1
+ import type { WcWallet } from './TypeUtil.js';
2
+ export declare const ApiControllerUtil: {
3
+ /**
4
+ * Finds a wallet by ID across all wallet arrays (wallets, recommended, featured, search, etc.)
5
+ * This is useful when a wallet might be in different arrays depending on the context
6
+ */
7
+ getWalletById(walletId: string | undefined): WcWallet | undefined;
8
+ };
@@ -1,5 +1,5 @@
1
1
  import type { ChainNamespace } from '@reown/appkit-common';
2
- import type { WcWallet } from './TypeUtil.js';
2
+ import type { ConnectorItemWithKind, ConnectorWithProviders, WcWallet } from './TypeUtil.js';
3
3
  export type WalletItem = {
4
4
  id: string;
5
5
  name: string;
@@ -29,10 +29,26 @@ export type WalletItem = {
29
29
  };
30
30
  export declare const ConnectUtil: {
31
31
  /**
32
- * Transforms connectors and wallets into a unified list of wallet items
32
+ * Maps the initial connect view wallets into WalletItems. Includes WalletConnect wallet and injected wallets. If user doesn't have any injected wallets, it'll fill the list with most ranked WalletConnect wallets.
33
+ * @returns The WalletItems for the initial connect view.
33
34
  */
34
- getUnifiedWalletList(params: {
35
- wcWallets: WcWallet[];
36
- search: WcWallet[];
37
- }): WalletItem[];
35
+ getInitialWallets(): WalletItem[];
36
+ /**
37
+ * Maps the WalletGuide explorer wallets to WalletItems including search results.
38
+ * @returns The WalletItems for the WalletGuide explorer wallets.
39
+ */
40
+ getWalletConnectWallets(wcAllWallets: WcWallet[], wcSearchWallets: WcWallet[]): WalletItem[];
41
+ /**
42
+ * Maps the connector to a WalletItem.
43
+ * @param connector - The connector to map to a WalletItem.
44
+ * @param subType - The subtype of the connector.
45
+ * @returns The WalletItem for the connector.
46
+ */
47
+ mapConnectorToWalletItem(connector: ConnectorWithProviders, subType: ConnectorItemWithKind["subtype"]): WalletItem;
48
+ /**
49
+ * Maps the WalletGuide explorer wallet to a WalletItem.
50
+ * @param w - The WalletGuide explorer wallet.
51
+ * @returns The WalletItem for the WalletGuide explorer wallet.
52
+ */
53
+ mapWalletToWalletItem(w: WcWallet): WalletItem;
38
54
  };
@@ -1,5 +1,6 @@
1
1
  import { type ChainNamespace } from '@reown/appkit-common';
2
2
  import type { Connection } from '@reown/appkit-common';
3
+ import type { WcWallet } from './TypeUtil.js';
3
4
  interface ExcludeConnectorAddressFromConnectionsParamters {
4
5
  connections: Connection[];
5
6
  connectorId?: string;
@@ -14,5 +15,6 @@ export declare const ConnectionControllerUtil: {
14
15
  connections: Connection[];
15
16
  recentConnections: Connection[];
16
17
  };
18
+ onConnectMobile(wallet: WcWallet | undefined): void;
17
19
  };
18
20
  export {};
@@ -0,0 +1,58 @@
1
+ import type { Connector, ConnectorOrWalletItem, ConnectorTypeOrder, ConnectorWithProviders, CustomWallet, SocialProvider, WcWallet } from './TypeUtil.js';
2
+ interface GetConnectorTypeOrderParameters {
3
+ recommended: WcWallet[];
4
+ featured: WcWallet[];
5
+ custom: CustomWallet[] | undefined;
6
+ recent: WcWallet[];
7
+ announced: WcWallet[];
8
+ injected: WcWallet[];
9
+ multiChain: WcWallet[];
10
+ external: WcWallet[];
11
+ overriddenConnectors?: ConnectorTypeOrder[];
12
+ }
13
+ export declare const ConnectorUtil: {
14
+ getConnectorsByType(connectors: ConnectorWithProviders[], recommended: WcWallet[], featured: WcWallet[]): {
15
+ custom: CustomWallet[] | undefined;
16
+ recent: WcWallet[];
17
+ external: ConnectorWithProviders[];
18
+ multiChain: ConnectorWithProviders[];
19
+ announced: ConnectorWithProviders[];
20
+ injected: ConnectorWithProviders[];
21
+ recommended: WcWallet[];
22
+ featured: WcWallet[];
23
+ };
24
+ showConnector(connector: ConnectorWithProviders): boolean;
25
+ /**
26
+ * Returns true if the user is connected to a WalletConnect connector in the any of the available namespaces.
27
+ * @returns boolean
28
+ */
29
+ getIsConnectedWithWC(): boolean;
30
+ /**
31
+ * Returns the connector positions in the order of the user's preference.
32
+ * @returns ConnectorTypeOrder[]
33
+ */
34
+ getConnectorTypeOrder({ recommended, featured, custom, recent, announced, injected, multiChain, external, overriddenConnectors }: GetConnectorTypeOrderParameters): string[];
35
+ sortConnectorsByExplorerWallet(connectors: ConnectorWithProviders[]): ConnectorWithProviders[];
36
+ getAuthName({ email, socialUsername, socialProvider }: {
37
+ email: string;
38
+ socialUsername?: string | null;
39
+ socialProvider?: SocialProvider | null;
40
+ }): string;
41
+ fetchProviderData(connector: Connector): Promise<{
42
+ accounts: string[];
43
+ chainId: number | undefined;
44
+ }>;
45
+ /**
46
+ * Filter out duplicate custom wallets by RDNS
47
+ * @param wallets
48
+ */
49
+ getFilteredCustomWallets(wallets: WcWallet[]): WcWallet[];
50
+ hasWalletConnector(wallet: WcWallet): boolean;
51
+ isWalletCompatibleWithCurrentChain(wallet: WcWallet): boolean;
52
+ getFilteredRecentWallets(): WcWallet[];
53
+ getCappedRecommendedWallets(wallets: WcWallet[]): WcWallet[];
54
+ processConnectorsByType(connectors: ConnectorWithProviders[], shouldFilter?: boolean): ConnectorWithProviders[];
55
+ connectorList(): ConnectorOrWalletItem[];
56
+ hasInjectedConnectors(): number;
57
+ };
58
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { type ChainNamespace, type OnRampProvider, type SocialProvider, type SwapProvider } from '@reown/appkit-common';
2
+ import type { ConnectMethod } from './TypeUtil.js';
2
3
  export declare const ONRAMP_PROVIDERS: {
3
4
  label: string;
4
5
  name: string;
@@ -85,6 +86,7 @@ export declare const ConstantsUtil: {
85
86
  connectMethodsOrder: undefined;
86
87
  pay: false;
87
88
  reownAuthentication: false;
89
+ headless: false;
88
90
  };
89
91
  DEFAULT_SOCIALS: SocialProvider[];
90
92
  DEFAULT_ACCOUNT_TYPES: {
@@ -105,4 +107,6 @@ export declare const ConstantsUtil: {
105
107
  SIWX_DEFAULTS: {
106
108
  readonly signOutOnDisconnect: true;
107
109
  };
110
+ MANDATORY_WALLET_IDS_ON_MOBILE: (string | undefined)[];
111
+ DEFAULT_CONNECT_METHOD_ORDER: ConnectMethod[];
108
112
  };
@@ -1047,7 +1047,6 @@ export interface RequestArguments {
1047
1047
  }
1048
1048
  export interface Provider {
1049
1049
  connect: (params?: {
1050
- caipNetworkId?: CaipNetworkId;
1051
1050
  onUri?: (uri: string) => void;
1052
1051
  }) => Promise<string>;
1053
1052
  disconnect: () => Promise<void>;
@@ -1171,6 +1170,12 @@ export type Features = {
1171
1170
  * @type {boolean}
1172
1171
  */
1173
1172
  reownAuthentication?: boolean;
1173
+ /**
1174
+ * @description Enable or disable the AppKit Headless mode to build custom connect user interfaces.
1175
+ * @default false
1176
+ * @type {boolean}
1177
+ */
1178
+ headless?: boolean;
1174
1179
  };
1175
1180
  export type FeaturesKeys = Exclude<keyof Features, 'swaps' | 'onramp' | 'email' | 'socials' | 'history'>;
1176
1181
  export type WalletGuideType = 'get-started' | 'explore';
@@ -1297,4 +1302,15 @@ export type ProjectLimits = {
1297
1302
  isAboveRpcLimit: boolean;
1298
1303
  isAboveMauLimit: boolean;
1299
1304
  };
1305
+ export type ConnectorItemWithKind = {
1306
+ kind: 'connector';
1307
+ subtype: 'injected' | 'announced' | 'multiChain' | 'external' | 'walletConnect';
1308
+ connector: ConnectorWithProviders;
1309
+ };
1310
+ export type WalletItemWithKind = {
1311
+ kind: 'wallet';
1312
+ subtype: 'featured' | 'recommended' | 'custom' | 'recent';
1313
+ wallet: WcWallet;
1314
+ };
1315
+ export type ConnectorOrWalletItem = ConnectorItemWithKind | WalletItemWithKind;
1300
1316
  export {};
@@ -338,6 +338,7 @@ export declare const ViemUtil: {
338
338
  type: "legacy";
339
339
  hash: import("viem").Hash;
340
340
  input: import("viem").Hex;
341
+ chainId?: number | undefined;
341
342
  yParity?: undefined | undefined;
342
343
  from: import("viem").Address;
343
344
  gas: bigint;
@@ -350,7 +351,6 @@ export declare const ViemUtil: {
350
351
  accessList?: undefined | undefined;
351
352
  authorizationList?: undefined | undefined;
352
353
  blobVersionedHashes?: undefined | undefined;
353
- chainId?: number | undefined;
354
354
  gasPrice: bigint;
355
355
  maxFeePerBlobGas?: undefined | undefined;
356
356
  maxFeePerGas?: undefined | undefined;
@@ -363,6 +363,7 @@ export declare const ViemUtil: {
363
363
  type: "eip2930";
364
364
  hash: import("viem").Hash;
365
365
  input: import("viem").Hex;
366
+ chainId: number;
366
367
  yParity: number;
367
368
  from: import("viem").Address;
368
369
  gas: bigint;
@@ -375,7 +376,6 @@ export declare const ViemUtil: {
375
376
  accessList: import("viem").AccessList;
376
377
  authorizationList?: undefined | undefined;
377
378
  blobVersionedHashes?: undefined | undefined;
378
- chainId: number;
379
379
  gasPrice: bigint;
380
380
  maxFeePerBlobGas?: undefined | undefined;
381
381
  maxFeePerGas?: undefined | undefined;
@@ -388,6 +388,7 @@ export declare const ViemUtil: {
388
388
  type: "eip1559";
389
389
  hash: import("viem").Hash;
390
390
  input: import("viem").Hex;
391
+ chainId: number;
391
392
  yParity: number;
392
393
  from: import("viem").Address;
393
394
  gas: bigint;
@@ -400,7 +401,6 @@ export declare const ViemUtil: {
400
401
  accessList: import("viem").AccessList;
401
402
  authorizationList?: undefined | undefined;
402
403
  blobVersionedHashes?: undefined | undefined;
403
- chainId: number;
404
404
  gasPrice?: undefined | undefined;
405
405
  maxFeePerBlobGas?: undefined | undefined;
406
406
  maxFeePerGas: bigint;
@@ -413,6 +413,7 @@ export declare const ViemUtil: {
413
413
  type: "eip4844";
414
414
  hash: import("viem").Hash;
415
415
  input: import("viem").Hex;
416
+ chainId: number;
416
417
  yParity: number;
417
418
  from: import("viem").Address;
418
419
  gas: bigint;
@@ -425,7 +426,6 @@ export declare const ViemUtil: {
425
426
  accessList: import("viem").AccessList;
426
427
  authorizationList?: undefined | undefined;
427
428
  blobVersionedHashes: readonly import("viem").Hex[];
428
- chainId: number;
429
429
  gasPrice?: undefined | undefined;
430
430
  maxFeePerBlobGas: bigint;
431
431
  maxFeePerGas: bigint;
@@ -438,6 +438,7 @@ export declare const ViemUtil: {
438
438
  type: "eip7702";
439
439
  hash: import("viem").Hash;
440
440
  input: import("viem").Hex;
441
+ chainId: number;
441
442
  yParity: number;
442
443
  from: import("viem").Address;
443
444
  gas: bigint;
@@ -450,7 +451,6 @@ export declare const ViemUtil: {
450
451
  accessList: import("viem").AccessList;
451
452
  authorizationList: import("viem").SignedAuthorizationList;
452
453
  blobVersionedHashes?: undefined | undefined;
453
- chainId: number;
454
454
  gasPrice?: undefined | undefined;
455
455
  maxFeePerBlobGas?: undefined | undefined;
456
456
  maxFeePerGas: bigint;
@@ -542,6 +542,7 @@ export declare const ViemUtil: {
542
542
  type: "legacy";
543
543
  hash: import("viem").Hash;
544
544
  input: import("viem").Hex;
545
+ chainId?: number | undefined;
545
546
  yParity?: undefined | undefined;
546
547
  from: import("viem").Address;
547
548
  gas: bigint;
@@ -554,7 +555,6 @@ export declare const ViemUtil: {
554
555
  accessList?: undefined | undefined;
555
556
  authorizationList?: undefined | undefined;
556
557
  blobVersionedHashes?: undefined | undefined;
557
- chainId?: number | undefined;
558
558
  gasPrice: bigint;
559
559
  maxFeePerBlobGas?: undefined | undefined;
560
560
  maxFeePerGas?: undefined | undefined;
@@ -567,6 +567,7 @@ export declare const ViemUtil: {
567
567
  type: "eip2930";
568
568
  hash: import("viem").Hash;
569
569
  input: import("viem").Hex;
570
+ chainId: number;
570
571
  yParity: number;
571
572
  from: import("viem").Address;
572
573
  gas: bigint;
@@ -579,7 +580,6 @@ export declare const ViemUtil: {
579
580
  accessList: import("viem").AccessList;
580
581
  authorizationList?: undefined | undefined;
581
582
  blobVersionedHashes?: undefined | undefined;
582
- chainId: number;
583
583
  gasPrice: bigint;
584
584
  maxFeePerBlobGas?: undefined | undefined;
585
585
  maxFeePerGas?: undefined | undefined;
@@ -592,6 +592,7 @@ export declare const ViemUtil: {
592
592
  type: "eip1559";
593
593
  hash: import("viem").Hash;
594
594
  input: import("viem").Hex;
595
+ chainId: number;
595
596
  yParity: number;
596
597
  from: import("viem").Address;
597
598
  gas: bigint;
@@ -604,7 +605,6 @@ export declare const ViemUtil: {
604
605
  accessList: import("viem").AccessList;
605
606
  authorizationList?: undefined | undefined;
606
607
  blobVersionedHashes?: undefined | undefined;
607
- chainId: number;
608
608
  gasPrice?: undefined | undefined;
609
609
  maxFeePerBlobGas?: undefined | undefined;
610
610
  maxFeePerGas: bigint;
@@ -617,6 +617,7 @@ export declare const ViemUtil: {
617
617
  type: "eip4844";
618
618
  hash: import("viem").Hash;
619
619
  input: import("viem").Hex;
620
+ chainId: number;
620
621
  yParity: number;
621
622
  from: import("viem").Address;
622
623
  gas: bigint;
@@ -629,7 +630,6 @@ export declare const ViemUtil: {
629
630
  accessList: import("viem").AccessList;
630
631
  authorizationList?: undefined | undefined;
631
632
  blobVersionedHashes: readonly import("viem").Hex[];
632
- chainId: number;
633
633
  gasPrice?: undefined | undefined;
634
634
  maxFeePerBlobGas: bigint;
635
635
  maxFeePerGas: bigint;
@@ -642,6 +642,7 @@ export declare const ViemUtil: {
642
642
  type: "eip7702";
643
643
  hash: import("viem").Hash;
644
644
  input: import("viem").Hex;
645
+ chainId: number;
645
646
  yParity: number;
646
647
  from: import("viem").Address;
647
648
  gas: bigint;
@@ -654,7 +655,6 @@ export declare const ViemUtil: {
654
655
  accessList: import("viem").AccessList;
655
656
  authorizationList: import("viem").SignedAuthorizationList;
656
657
  blobVersionedHashes?: undefined | undefined;
657
- chainId: number;
658
658
  gasPrice?: undefined | undefined;
659
659
  maxFeePerBlobGas?: undefined | undefined;
660
660
  maxFeePerGas: bigint;
@@ -4243,7 +4243,7 @@ export declare const ViemUtil: {
4243
4243
  authorizationList: import("viem").TransactionSerializableEIP7702["authorizationList"];
4244
4244
  } ? "eip7702" : never) | (request["type"] extends string | undefined ? Extract<request["type"], string> : never)>) ? T_25 extends "eip7702" ? import("viem").TransactionRequestEIP7702 : never : never : never)>> & {
4245
4245
  chainId?: number | undefined;
4246
- }, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "chainId") extends infer T_26 ? T_26 extends (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "chainId") ? T_26 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_26 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">) extends infer T ? { [K in keyof T]: (import("viem").UnionRequiredBy<Extract<import("viem").UnionOmit<import("viem").ExtractChainFormatterParameters<import("viem").DeriveChain<{
4246
+ }, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "chainId" | "gas" | "nonce" | "blobVersionedHashes") extends infer T_26 ? T_26 extends (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "chainId" | "gas" | "nonce" | "blobVersionedHashes") ? T_26 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_26 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">) extends infer T ? { [K in keyof T]: (import("viem").UnionRequiredBy<Extract<import("viem").UnionOmit<import("viem").ExtractChainFormatterParameters<import("viem").DeriveChain<{
4247
4247
  blockExplorers?: {
4248
4248
  [key: string]: {
4249
4249
  name: string;
@@ -7657,7 +7657,7 @@ export declare const ViemUtil: {
7657
7657
  authorizationList: import("viem").TransactionSerializableEIP7702["authorizationList"];
7658
7658
  } ? "eip7702" : never) | (request["type"] extends string | undefined ? Extract<request["type"], string> : never)>) ? T_12 extends "eip7702" ? import("viem").TransactionRequestEIP7702 : never : never : never)>> & {
7659
7659
  chainId?: number | undefined;
7660
- }, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "chainId") extends infer T_13 ? T_13 extends (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "chainId") ? T_13 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_13 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">))[K]; } : never>;
7660
+ }, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "chainId" | "gas" | "nonce" | "blobVersionedHashes") extends infer T_13 ? T_13 extends (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "fees" | "type" | "chainId" | "gas" | "nonce" | "blobVersionedHashes") ? T_13 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_13 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">))[K]; } : never>;
7661
7661
  readContract: <const abi extends import("viem").Abi | readonly unknown[], functionName extends import("viem").ContractFunctionName<abi, "pure" | "view">, const args extends import("viem").ContractFunctionArgs<abi, "pure" | "view", functionName>>(args: import("viem").ReadContractParameters<abi, functionName, args>) => Promise<import("viem").ReadContractReturnType<abi, functionName, args>>;
7662
7662
  sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<import("viem").SendRawTransactionReturnType>;
7663
7663
  simulate: <const calls extends readonly unknown[]>(args: import("viem").SimulateBlocksParameters<calls>) => Promise<import("viem").SimulateBlocksReturnType<calls>>;
@@ -0,0 +1,81 @@
1
+ import type { ConnectMethod, Connector, Features, WcWallet } from './TypeUtil.js';
2
+ interface AppKitWallet extends WcWallet {
3
+ installed: boolean;
4
+ }
5
+ export declare const WalletUtil: {
6
+ filterOutDuplicatesByRDNS(wallets: WcWallet[]): WcWallet[];
7
+ filterOutDuplicatesByIds(wallets: WcWallet[]): WcWallet[];
8
+ filterOutDuplicateWallets(wallets: WcWallet[]): WcWallet[];
9
+ /**
10
+ * Marks wallets as installed based on available connectors and sorts them
11
+ * according to both installation status and featuredWalletIds order.
12
+ *
13
+ * @param wallets - Array of wallets to process
14
+ * @returns Array of wallets marked as installed and sorted by priority
15
+ */
16
+ markWalletsAsInstalled(wallets: WcWallet[]): AppKitWallet[];
17
+ getConnectOrderMethod(_features: Features | undefined, _connectors: Connector[]): ConnectMethod[];
18
+ isExcluded(wallet: WcWallet): boolean;
19
+ markWalletsWithDisplayIndex(wallets: WcWallet[]): {
20
+ display_index: number;
21
+ id: string;
22
+ name: string;
23
+ badge_type?: import("./TypeUtil.js").BadgeType;
24
+ description?: string;
25
+ chains?: import("@reown/appkit-common").CaipNetworkId[];
26
+ homepage?: string;
27
+ image_id?: string;
28
+ image_url?: string;
29
+ order?: number;
30
+ link_mode?: string | null;
31
+ mobile_link?: string | null;
32
+ desktop_link?: string | null;
33
+ webapp_link?: string | null;
34
+ app_store?: string | null;
35
+ play_store?: string | null;
36
+ chrome_store?: string | null;
37
+ rdns?: string | null;
38
+ injected?: {
39
+ namespace?: string;
40
+ injected_id?: string;
41
+ }[] | null;
42
+ supports_wc?: boolean;
43
+ }[];
44
+ /**
45
+ * Filters wallets based on WalletConnect support and platform requirements.
46
+ *
47
+ * On mobile only wallets with WalletConnect support and some mandatory wallets are shown.
48
+ * On desktop with Appkit Core only wallets with WalletConnect support are shown.
49
+ * On desktop with Appkit all wallets are shown.
50
+ *
51
+ * @param wallets - Array of wallets to filter
52
+ * @returns Filtered array of wallets based on WalletConnect support and platform
53
+ */
54
+ filterWalletsByWcSupport(wallets: WcWallet[]): WcWallet[];
55
+ getWalletConnectWallets(allWallets: WcWallet[]): {
56
+ display_index: number;
57
+ id: string;
58
+ name: string;
59
+ badge_type?: import("./TypeUtil.js").BadgeType;
60
+ description?: string;
61
+ chains?: import("@reown/appkit-common").CaipNetworkId[];
62
+ homepage?: string;
63
+ image_id?: string;
64
+ image_url?: string;
65
+ order?: number;
66
+ link_mode?: string | null;
67
+ mobile_link?: string | null;
68
+ desktop_link?: string | null;
69
+ webapp_link?: string | null;
70
+ app_store?: string | null;
71
+ play_store?: string | null;
72
+ chrome_store?: string | null;
73
+ rdns?: string | null;
74
+ injected?: {
75
+ namespace?: string;
76
+ injected_id?: string;
77
+ }[] | null;
78
+ supports_wc?: boolean;
79
+ }[];
80
+ };
81
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reown/appkit-controllers",
3
- "version": "1.8.14-signet-fix.0",
3
+ "version": "1.8.14-wallet-button-fix.0",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "main": "./dist/esm/exports/index.js",
@@ -56,8 +56,8 @@
56
56
  "@walletconnect/universal-provider": "2.23.0",
57
57
  "valtio": "2.1.7",
58
58
  "viem": ">=2.37.9",
59
- "@reown/appkit-common": "1.8.14-signet-fix.0",
60
- "@reown/appkit-wallet": "1.8.14-signet-fix.0"
59
+ "@reown/appkit-common": "1.8.14-wallet-button-fix.0",
60
+ "@reown/appkit-wallet": "1.8.14-wallet-button-fix.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@vitest/coverage-v8": "2.1.9",