@reown/appkit-controllers 1.8.14 → 1.8.15-1af3ed85cb2d75940977e3a13b5c5cf55e36ca11.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 (85) 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 +140 -21
  4. package/dist/esm/exports/react.js.map +1 -1
  5. package/dist/esm/src/controllers/AdapterController/ChainAdapterBlueprint.js.map +1 -1
  6. package/dist/esm/src/controllers/AlertController.js +18 -2
  7. package/dist/esm/src/controllers/AlertController.js.map +1 -1
  8. package/dist/esm/src/controllers/BlockchainApiController.js +2 -2
  9. package/dist/esm/src/controllers/BlockchainApiController.js.map +1 -1
  10. package/dist/esm/src/controllers/ConnectionController.js +12 -0
  11. package/dist/esm/src/controllers/ConnectionController.js.map +1 -1
  12. package/dist/esm/src/controllers/ConnectorController.js +54 -7
  13. package/dist/esm/src/controllers/ConnectorController.js.map +1 -1
  14. package/dist/esm/src/controllers/PublicStateController.js +2 -1
  15. package/dist/esm/src/controllers/PublicStateController.js.map +1 -1
  16. package/dist/esm/src/controllers/RouterController.js.map +1 -1
  17. package/dist/esm/src/controllers/SwapController.js +5 -1
  18. package/dist/esm/src/controllers/SwapController.js.map +1 -1
  19. package/dist/esm/src/controllers/TransactionsController.js +1 -1
  20. package/dist/esm/src/controllers/TransactionsController.js.map +1 -1
  21. package/dist/esm/src/utils/ApiControllerUtil.js +34 -0
  22. package/dist/esm/src/utils/ApiControllerUtil.js.map +1 -0
  23. package/dist/esm/src/utils/AssetUtil.js +79 -1
  24. package/dist/esm/src/utils/AssetUtil.js.map +1 -1
  25. package/dist/esm/src/utils/BalanceUtil.js +10 -7
  26. package/dist/esm/src/utils/BalanceUtil.js.map +1 -1
  27. package/dist/esm/src/utils/ChainControllerUtil.js +8 -0
  28. package/dist/esm/src/utils/ChainControllerUtil.js.map +1 -1
  29. package/dist/esm/src/utils/ConnectUtil.js +92 -0
  30. package/dist/esm/src/utils/ConnectUtil.js.map +1 -0
  31. package/dist/esm/src/utils/ConnectionControllerUtil.js +36 -0
  32. package/dist/esm/src/utils/ConnectionControllerUtil.js.map +1 -1
  33. package/dist/esm/src/utils/ConnectorUtil.js +314 -0
  34. package/dist/esm/src/utils/ConnectorUtil.js.map +1 -0
  35. package/dist/esm/src/utils/ConstantsUtil.js +21 -6
  36. package/dist/esm/src/utils/ConstantsUtil.js.map +1 -1
  37. package/dist/esm/src/utils/CoreHelperUtil.js +13 -0
  38. package/dist/esm/src/utils/CoreHelperUtil.js.map +1 -1
  39. package/dist/esm/src/utils/SwapApiUtil.js +5 -1
  40. package/dist/esm/src/utils/SwapApiUtil.js.map +1 -1
  41. package/dist/esm/src/utils/WalletUtil.js +161 -0
  42. package/dist/esm/src/utils/WalletUtil.js.map +1 -0
  43. package/dist/esm/tests/controllers/AlertController.test.js +62 -9
  44. package/dist/esm/tests/controllers/AlertController.test.js.map +1 -1
  45. package/dist/esm/tests/controllers/ChainController.test.js +1 -0
  46. package/dist/esm/tests/controllers/ChainController.test.js.map +1 -1
  47. package/dist/esm/tests/controllers/ConnectionController.test.js +7 -2
  48. package/dist/esm/tests/controllers/ConnectionController.test.js.map +1 -1
  49. package/dist/esm/tests/controllers/ConnectorController.test.js +8 -8
  50. package/dist/esm/tests/controllers/ConnectorController.test.js.map +1 -1
  51. package/dist/esm/tests/hooks/react.test.js +505 -3
  52. package/dist/esm/tests/hooks/react.test.js.map +1 -1
  53. package/dist/esm/tests/hooks/vue.test.js +8 -0
  54. package/dist/esm/tests/hooks/vue.test.js.map +1 -1
  55. package/dist/esm/tests/utils/BalanceUtil.test.js +0 -5
  56. package/dist/esm/tests/utils/BalanceUtil.test.js.map +1 -1
  57. package/dist/esm/tests/utils/ConnectorUtil.test.js +83 -0
  58. package/dist/esm/tests/utils/ConnectorUtil.test.js.map +1 -0
  59. package/dist/esm/tests/utils/ControllerUtil.test.js +500 -0
  60. package/dist/esm/tests/utils/ControllerUtil.test.js.map +1 -0
  61. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  62. package/dist/types/exports/index.d.ts +4 -1
  63. package/dist/types/exports/react.d.ts +69 -0
  64. package/dist/types/src/controllers/AdapterController/ChainAdapterBlueprint.d.ts +15 -1
  65. package/dist/types/src/controllers/BlockchainApiController.d.ts +1 -1
  66. package/dist/types/src/controllers/ConnectionController.d.ts +4 -1
  67. package/dist/types/src/controllers/ConnectorController.d.ts +18 -11
  68. package/dist/types/src/controllers/OptionsController.d.ts +3 -1
  69. package/dist/types/src/controllers/PublicStateController.d.ts +6 -0
  70. package/dist/types/src/controllers/RouterController.d.ts +1 -1
  71. package/dist/types/src/utils/ApiControllerUtil.d.ts +8 -0
  72. package/dist/types/src/utils/AssetUtil.d.ts +32 -0
  73. package/dist/types/src/utils/BalanceUtil.d.ts +6 -1
  74. package/dist/types/src/utils/ChainControllerUtil.d.ts +7 -1
  75. package/dist/types/src/utils/ConnectUtil.d.ts +54 -0
  76. package/dist/types/src/utils/ConnectionControllerUtil.d.ts +2 -0
  77. package/dist/types/src/utils/ConnectorUtil.d.ts +74 -0
  78. package/dist/types/src/utils/ConstantsUtil.d.ts +7 -1
  79. package/dist/types/src/utils/CoreHelperUtil.d.ts +1 -0
  80. package/dist/types/src/utils/TypeUtil.d.ts +43 -2
  81. package/dist/types/src/utils/ViemUtil.d.ts +53 -53
  82. package/dist/types/src/utils/WalletUtil.d.ts +81 -0
  83. package/dist/types/tests/utils/ConnectorUtil.test.d.ts +1 -0
  84. package/dist/types/tests/utils/ControllerUtil.test.d.ts +1 -0
  85. package/package.json +7 -7
@@ -19,7 +19,7 @@ export type { ConnectionControllerClient, ConnectionControllerState } from '../s
19
19
  export type { ConnectExternalOptions } from '../src/controllers/ConnectionController.js';
20
20
  export { ConnectorController } from '../src/controllers/ConnectorController.js';
21
21
  export { ConnectorControllerUtil } from '../src/utils/ConnectorControllerUtil.js';
22
- export type { ConnectorControllerState, ConnectorWithProviders } from '../src/controllers/ConnectorController.js';
22
+ export type { ConnectorControllerState } from '../src/controllers/ConnectorController.js';
23
23
  export { SnackController } from '../src/controllers/SnackController.js';
24
24
  export type { SnackControllerState } from '../src/controllers/SnackController.js';
25
25
  export { ApiController } from '../src/controllers/ApiController.js';
@@ -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';
@@ -69,5 +71,6 @@ export type { Exchange, GetExchangesParams, PayUrlParams, PaymentAsset, CurrentP
69
71
  export { FetchUtil } from '../src/utils/FetchUtil.js';
70
72
  export type * from '../src/utils/TypeUtil.js';
71
73
  export type * from '../src/utils/SIWXUtil.js';
74
+ export type { WalletItem } from '../src/utils/ConnectUtil.js';
72
75
  export * from '../src/utils/ChainControllerUtil.js';
73
76
  export * from '../src/utils/WalletConnectUtil.js';
@@ -1,4 +1,5 @@
1
1
  import { type ChainNamespace, type Connection } from '@reown/appkit-common';
2
+ import { type WalletItem } from '../src/utils/ConnectUtil.js';
2
3
  import type { UseAppKitAccountReturn, UseAppKitNetworkReturn } from '../src/utils/TypeUtil.js';
3
4
  export type { Connection } from '@reown/appkit-common';
4
5
  interface DisconnectParams {
@@ -75,3 +76,71 @@ export declare function useAppKitConnection({ namespace, onSuccess, onError }: U
75
76
  switchConnection: ({ connection: _connection, address }: SwitchConnectionParams) => Promise<void>;
76
77
  deleteConnection: ({ address, connectorId }: DeleteRecentConnectionProps) => void;
77
78
  };
79
+ export interface UseAppKitWalletsReturn {
80
+ /**
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
+ */
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[];
89
+ /**
90
+ * Boolean that indicates if WalletConnect wallets are being fetched.
91
+ */
92
+ isFetchingWallets: boolean;
93
+ /**
94
+ * Boolean that indicates if a WalletConnect URI is being fetched.
95
+ */
96
+ isFetchingWcUri: boolean;
97
+ /**
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().
103
+ */
104
+ wcUri?: string;
105
+ /**
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.
111
+ */
112
+ page: number;
113
+ /**
114
+ * The total number of available WalletConnect wallets based on the AppKit configurations and given parameters.
115
+ */
116
+ count: number;
117
+ /**
118
+ * Function to fetch WalletConnect wallets from the explorer API. Allows to list, search and paginate through the wallets.
119
+ * @param options - Options for fetching wallets
120
+ * @param options.page - Page number to fetch (default: 1)
121
+ * @param options.query - Search query to filter wallets (default: '')
122
+ */
123
+ fetchWallets: (options?: {
124
+ page?: number;
125
+ query?: string;
126
+ }) => Promise<void>;
127
+ /**
128
+ * Function to connect to a wallet.
129
+ * - For WalletConnect wallets: initiates WC connection and returns the URI with the `wcUri` state.
130
+ * - For injected connectors: triggers the extension/wallet directly.
131
+ *
132
+ * @param wallet - The wallet item to connect to
133
+ * @param callbacks - Success and error callbacks
134
+ * @returns Promise that resolves when connection completes or rejects on error
135
+ */
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;
141
+ }
142
+ /**
143
+ * Headless hook for wallet connection.
144
+ * Provides all the data and functions needed to build a custom connect UI.
145
+ */
146
+ export declare function useAppKitWallets(): UseAppKitWalletsReturn;
@@ -1,7 +1,7 @@
1
1
  import UniversalProvider from '@walletconnect/universal-provider';
2
2
  import { type Address, type CaipAddress, type CaipNetwork, type ChainNamespace, type Connection, type Hex, type ParsedCaipAddress } from '@reown/appkit-common';
3
3
  import type { W3mFrameProvider } from '@reown/appkit-wallet';
4
- import type { AccountType, Connector as AppKitConnector, CombinedProvider, Provider, Tokens, WriteContractArgs } from '../../utils/TypeUtil.js';
4
+ import type { AccountType, Connector as AppKitConnector, CombinedProvider, Provider, SolanaTransactionRequest, Tokens, WriteContractArgs } from '../../utils/TypeUtil.js';
5
5
  import { type AccountState } from '../ChainController.js';
6
6
  import type { WalletConnectConnector } from './WalletConnectConnector.js';
7
7
  import type { ChainAdapterConnector } from './types.js';
@@ -206,6 +206,12 @@ export declare abstract class AdapterBlueprint<Connector extends ChainAdapterCon
206
206
  * @returns {Promise<AdapterBlueprint.WriteContractResult>} Object containing the transaction hash
207
207
  */
208
208
  abstract writeContract(params: AdapterBlueprint.WriteContractParams): Promise<AdapterBlueprint.WriteContractResult>;
209
+ /**
210
+ * Writes a solana contract transaction.
211
+ * @param {AdapterBlueprint.WriteContractParams} params - Parameters including receiver address, token amount, token address, from address, method, and ABI
212
+ * @returns {Promise<AdapterBlueprint.WriteContractResult>} Object containing the transaction hash
213
+ */
214
+ abstract writeSolanaTransaction(params: AdapterBlueprint.WriteSolanaTransactionParams): Promise<AdapterBlueprint.WriteSolanaTransactionResult>;
209
215
  /**
210
216
  * Parses a decimal string value into a bigint with the specified number of decimals.
211
217
  * @param {AdapterBlueprint.ParseUnitsParams} params - Parameters including value and decimals
@@ -372,9 +378,17 @@ export declare namespace AdapterBlueprint {
372
378
  provider?: AppKitConnector['provider'];
373
379
  caipAddress: CaipAddress;
374
380
  };
381
+ type WriteSolanaTransactionParams = SolanaTransactionRequest & {
382
+ caipNetwork: CaipNetwork;
383
+ provider?: AppKitConnector['provider'];
384
+ caipAddress: CaipAddress;
385
+ };
375
386
  type WriteContractResult = {
376
387
  hash: string;
377
388
  };
389
+ type WriteSolanaTransactionResult = {
390
+ hash: string;
391
+ };
378
392
  type ParseUnitsParams = {
379
393
  value: string;
380
394
  decimals: number;
@@ -29,7 +29,7 @@ export declare const BlockchainApiController: {
29
29
  fetchSwapQuote({ amount, userAddress, from, to, gasPrice }: BlockchainApiSwapQuoteRequest): Promise<BlockchainApiSwapQuoteResponse>;
30
30
  fetchSwapTokens({ chainId }: BlockchainApiSwapTokensRequest): Promise<BlockchainApiSwapTokensResponse>;
31
31
  getAddressBalance({ caipNetworkId, address }: BlockchainApiGetAddressBalanceRequest): Promise<string>;
32
- fetchTokenPrice({ addresses }: BlockchainApiTokenPriceRequest): Promise<BlockchainApiTokenPriceResponse>;
32
+ fetchTokenPrice({ addresses, caipNetworkId }: BlockchainApiTokenPriceRequest): Promise<BlockchainApiTokenPriceResponse>;
33
33
  fetchSwapAllowance({ tokenAddress, userAddress }: BlockchainApiSwapAllowanceRequest): Promise<{
34
34
  allowance: string;
35
35
  }>;
@@ -1,6 +1,6 @@
1
1
  import { type CaipAddress, type CaipNetwork, type ChainNamespace, type Connection, type Hex } from '@reown/appkit-common';
2
2
  import type { W3mFrameTypes } from '@reown/appkit-wallet';
3
- import type { ChainAdapter, Connector, EstimateGasTransactionArgs, SendTransactionArgs, WalletGetAssetsParams, WalletGetAssetsResponse, WcWallet, WriteContractArgs } from '../utils/TypeUtil.js';
3
+ import type { ChainAdapter, Connector, EstimateGasTransactionArgs, SendTransactionArgs, WalletGetAssetsParams, WalletGetAssetsResponse, WcWallet, WriteContractArgs, WriteSolanaTransactionArgs } from '../utils/TypeUtil.js';
4
4
  import { type ChainControllerState } from './ChainController.js';
5
5
  interface SwitchConnectionParams {
6
6
  connection: Connection;
@@ -73,6 +73,7 @@ export interface ConnectionControllerClient {
73
73
  reconnectExternal?: (options: ConnectExternalOptions) => Promise<void>;
74
74
  checkInstalled?: (ids?: string[]) => boolean;
75
75
  writeContract: (args: WriteContractArgs) => Promise<`0x${string}` | null>;
76
+ writeSolanaTransaction: (args: WriteSolanaTransactionArgs) => Promise<string | null>;
76
77
  getEnsAddress: (value: string) => Promise<false | string>;
77
78
  getEnsAvatar: (value: string) => Promise<false | string>;
78
79
  grantPermissions: (params: readonly unknown[] | object) => Promise<unknown>;
@@ -99,6 +100,7 @@ export interface ConnectionControllerState {
99
100
  };
100
101
  wcBasic?: boolean;
101
102
  wcError?: boolean;
103
+ wcFetchingUri: boolean;
102
104
  recentWallet?: WcWallet;
103
105
  buffering: boolean;
104
106
  status?: 'connecting' | 'connected' | 'disconnected';
@@ -131,6 +133,7 @@ export declare const ConnectionController: {
131
133
  walletGetAssets(params: WalletGetAssetsParams): Promise<WalletGetAssetsResponse>;
132
134
  estimateGas(args: EstimateGasTransactionArgs): Promise<bigint | undefined>;
133
135
  writeContract(args: WriteContractArgs): Promise<`0x${string}` | null | undefined>;
136
+ writeSolanaTransaction(args: WriteSolanaTransactionArgs): Promise<string | null | undefined>;
134
137
  getEnsAddress(value: string): Promise<string | false | undefined>;
135
138
  getEnsAvatar(value: string): Promise<string | false | undefined>;
136
139
  checkInstalled(ids?: string[]): boolean;
@@ -1,8 +1,5 @@
1
- import { type ChainNamespace } from '@reown/appkit-common';
2
- import type { AuthConnector, Connector, WcWallet } from '../utils/TypeUtil.js';
3
- export interface ConnectorWithProviders extends Connector {
4
- connectors?: Connector[];
5
- }
1
+ import { type CaipAddress, type ChainNamespace } from '@reown/appkit-common';
2
+ import type { AuthConnector, Connector, ConnectorWithProviders, WcWallet } from '../utils/TypeUtil.js';
6
3
  export interface ConnectorControllerState {
7
4
  allConnectors: Connector[];
8
5
  connectors: ConnectorWithProviders[];
@@ -12,6 +9,9 @@ export interface ConnectorControllerState {
12
9
  activeConnectorIds: Record<ChainNamespace, string | undefined>;
13
10
  }
14
11
  type StateKey = keyof ConnectorControllerState;
12
+ export interface ConnectParameters {
13
+ namespace?: ChainNamespace;
14
+ }
15
15
  export declare const ConnectorController: {
16
16
  state: ConnectorControllerState;
17
17
  subscribe(callback: (value: ConnectorControllerState) => void): () => void;
@@ -32,12 +32,11 @@ export declare const ConnectorController: {
32
32
  addConnector(connector: Connector | AuthConnector): void;
33
33
  getAuthConnector(chainNamespace?: ChainNamespace): AuthConnector | undefined;
34
34
  getAnnouncedConnectorRdns(): (string | undefined)[];
35
- getConnectorById(id: string): Connector | undefined;
36
- getConnector({ id, rdns, namespace }: {
37
- id?: string;
38
- rdns?: string | null;
39
- namespace?: ChainNamespace;
40
- }): Connector | undefined;
35
+ getConnectorById(id: string): ConnectorWithProviders | undefined;
36
+ getConnector({ id, namespace }: {
37
+ id: string;
38
+ namespace: ChainNamespace;
39
+ }): ConnectorWithProviders | undefined;
41
40
  syncIfAuthConnector(connector: Connector | AuthConnector): void;
42
41
  /**
43
42
  * Returns the connectors filtered by namespace.
@@ -64,5 +63,13 @@ export declare const ConnectorController: {
64
63
  isConnected(namespace?: ChainNamespace): boolean;
65
64
  resetConnectorIds(): void;
66
65
  extendConnectorsWithExplorerWallets(explorerWallets: WcWallet[]): void;
66
+ /**
67
+ * Opens the connect modal and waits until the user connects their wallet.
68
+ * @param params - Connection parameters.
69
+ * @returns Promise resolving to the connected wallet's CAIP address.
70
+ */
71
+ connect(params?: ConnectParameters): Promise<{
72
+ caipAddress: CaipAddress;
73
+ }>;
67
74
  };
68
75
  export {};
@@ -1697,6 +1697,7 @@ export declare const OptionsController: {
1697
1697
  readonly collapseWallets?: boolean | undefined;
1698
1698
  readonly pay?: boolean | undefined;
1699
1699
  readonly reownAuthentication?: boolean | undefined;
1700
+ readonly headless?: boolean | undefined;
1700
1701
  } | undefined;
1701
1702
  readonly siwx?: {
1702
1703
  readonly createMessage: (input: import("../utils/SIWXUtil.js").SIWXMessage.Input) => Promise<import("../utils/SIWXUtil.js").SIWXMessage>;
@@ -1725,7 +1726,7 @@ export declare const OptionsController: {
1725
1726
  */
1726
1727
  | undefined;
1727
1728
  readonly defaultAccountTypes: {
1728
- readonly eip155?: "eoa" | "smartAccount" | undefined;
1729
+ readonly eip155?: "smartAccount" | "eoa" | undefined;
1729
1730
  readonly solana?: "eoa" | undefined;
1730
1731
  readonly bip122?: "payment" | "ordinal" | "stx" | undefined;
1731
1732
  readonly polkadot?: "eoa" | undefined;
@@ -1784,6 +1785,7 @@ export declare const OptionsController: {
1784
1785
  readonly payWithExchange?: boolean | undefined;
1785
1786
  readonly payments?: boolean | undefined;
1786
1787
  readonly onramp?: false | readonly "meld"[] | undefined;
1788
+ readonly headless?: boolean | undefined;
1787
1789
  } | undefined;
1788
1790
  };
1789
1791
  };
@@ -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;
@@ -17,7 +17,7 @@ type TransactionAction = {
17
17
  onError?: () => void;
18
18
  };
19
19
  export interface RouterControllerState {
20
- view: 'Account' | 'AccountSettings' | 'AllWallets' | 'ApproveTransaction' | 'BuyInProgress' | 'WalletCompatibleNetworks' | 'ChooseAccountName' | 'Connect' | 'Create' | 'ConnectingExternal' | 'ConnectingFarcaster' | 'ConnectingWalletConnect' | 'ConnectingWalletConnectBasic' | 'ConnectingSiwe' | 'ConnectingSocial' | 'ConnectSocials' | 'ConnectWallets' | 'DataCapture' | 'DataCaptureOtpConfirm' | 'Downloads' | 'EmailLogin' | 'EmailVerifyOtp' | 'EmailVerifyDevice' | 'GetWallet' | 'Networks' | 'OnRampFiatSelect' | 'OnRampProviders' | 'OnRampTokenSelect' | 'ProfileWallets' | 'RegisterAccountName' | 'RegisterAccountNameSuccess' | 'SwitchNetwork' | 'Transactions' | 'UnsupportedChain' | 'UpdateEmailWallet' | 'UpdateEmailPrimaryOtp' | 'UpdateEmailSecondaryOtp' | 'UpgradeEmailWallet' | 'WalletReceive' | 'WalletSend' | 'WalletSendPreview' | 'WalletSendSelectToken' | 'WalletSendConfirmed' | 'WhatIsANetwork' | 'WhatIsAWallet' | 'WhatIsABuy' | 'Swap' | 'SwapSelectToken' | 'SwapPreview' | 'ConnectingMultiChain' | 'SwitchActiveChain' | 'SmartSessionCreated' | 'SmartSessionList' | 'SIWXSignMessage' | 'Pay' | 'PayLoading' | 'FundWallet' | 'PayWithExchange' | 'PayWithExchangeSelectAsset' | 'UsageExceeded' | 'SmartAccountSettings';
20
+ view: 'Account' | 'AccountSettings' | 'AllWallets' | 'ApproveTransaction' | 'BuyInProgress' | 'WalletCompatibleNetworks' | 'ChooseAccountName' | 'Connect' | 'Create' | 'ConnectingExternal' | 'ConnectingFarcaster' | 'ConnectingWalletConnect' | 'ConnectingWalletConnectBasic' | 'ConnectingSiwe' | 'ConnectingSocial' | 'ConnectSocials' | 'ConnectWallets' | 'DataCapture' | 'DataCaptureOtpConfirm' | 'Downloads' | 'EmailLogin' | 'EmailVerifyOtp' | 'EmailVerifyDevice' | 'GetWallet' | 'Networks' | 'OnRampFiatSelect' | 'OnRampProviders' | 'OnRampTokenSelect' | 'ProfileWallets' | 'RegisterAccountName' | 'RegisterAccountNameSuccess' | 'SwitchNetwork' | 'Transactions' | 'UnsupportedChain' | 'UpdateEmailWallet' | 'UpdateEmailPrimaryOtp' | 'UpdateEmailSecondaryOtp' | 'UpgradeEmailWallet' | 'WalletReceive' | 'WalletSend' | 'WalletSendPreview' | 'WalletSendSelectToken' | 'WalletSendConfirmed' | 'WhatIsANetwork' | 'WhatIsAWallet' | 'WhatIsABuy' | 'Swap' | 'SwapSelectToken' | 'SwapPreview' | 'ConnectingMultiChain' | 'SwitchActiveChain' | 'SmartSessionCreated' | 'SmartSessionList' | 'SIWXSignMessage' | 'Pay' | 'PayLoading' | 'PayQuote' | 'FundWallet' | 'PayWithExchange' | 'PayWithExchangeSelectAsset' | 'UsageExceeded' | 'SmartAccountSettings';
21
21
  history: RouterControllerState['view'][];
22
22
  data?: {
23
23
  connector?: Connector;
@@ -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
+ };
@@ -2,10 +2,17 @@ import type { CaipNetwork, ChainNamespace } from '@reown/appkit-common';
2
2
  import type { Connector, WcWallet } from './TypeUtil.js';
3
3
  export interface AssetUtilState {
4
4
  networkImagePromises: Record<string, Promise<void>>;
5
+ tokenImagePromises: Record<string, Promise<void>>;
5
6
  }
6
7
  export declare const AssetUtil: {
7
8
  fetchWalletImage(imageId?: string): Promise<string | undefined>;
8
9
  fetchNetworkImage(imageId?: string): Promise<string | undefined>;
10
+ /**
11
+ * Fetches the token image for the given image ID.
12
+ * @param imageId - The image id of the token.
13
+ * @returns The token image.
14
+ */
15
+ fetchTokenImage(imageId?: string): Promise<string | undefined>;
9
16
  getWalletImageById(imageId?: string): string | undefined;
10
17
  getWalletImage(wallet?: WcWallet): string | undefined;
11
18
  getNetworkImage(network?: CaipNetwork): string | undefined;
@@ -13,4 +20,29 @@ export declare const AssetUtil: {
13
20
  getConnectorImage(connector?: Connector): string | undefined;
14
21
  getChainImage(chain: ChainNamespace): string | undefined;
15
22
  getTokenImage(symbol?: string): string | undefined;
23
+ /**
24
+ * Get the explorer wallet's image URL for the given image ID.
25
+ * @param imageId - The image id of the wallet.
26
+ * @returns The image URL for the wallet.
27
+ */
28
+ getWalletImageUrl(imageId: string | undefined): string;
29
+ /**
30
+ * Get the public asset's image URL with the given image ID.
31
+ * @param imageId - The image id of the asset.
32
+ * @returns The image URL for the asset.
33
+ */
34
+ getAssetImageUrl(imageId: string | undefined): string;
35
+ /**
36
+ * Get the image URL for the given chain namespace.
37
+ * @param chainNamespace - The chain namespace to get the image URL for.
38
+ * @returns The image URL for the chain namespace.
39
+ */
40
+ getChainNamespaceImageUrl(chainNamespace: ChainNamespace): string;
41
+ /**
42
+ * Get the image id for the given token and namespace.
43
+ * @param token - The token address or 'native' to get the image id for.
44
+ * @param namespace - The namespace to get the image id for.
45
+ * @returns The image URL for the token.
46
+ */
47
+ getImageByToken(token: string, namespace: ChainNamespace): Promise<string | undefined>;
16
48
  };
@@ -5,6 +5,11 @@ interface FetchER20BalanceParams {
5
5
  assetAddress: string;
6
6
  caipNetwork: CaipNetwork;
7
7
  }
8
+ interface GetMyTokensWithBalanceParams {
9
+ forceUpdate?: string;
10
+ caipNetwork?: CaipNetwork;
11
+ address?: string;
12
+ }
8
13
  export declare const BalanceUtil: {
9
14
  /**
10
15
  * Get the balances of the user's tokens. If user connected with Auth provider or and on the EIP155 network,
@@ -12,7 +17,7 @@ export declare const BalanceUtil: {
12
17
  * @param forceUpdate - If true, the balances will be fetched from the server
13
18
  * @returns The balances of the user's tokens
14
19
  */
15
- getMyTokensWithBalance(forceUpdate?: string): Promise<BlockchainApiBalanceResponse["balances"]>;
20
+ getMyTokensWithBalance(params?: GetMyTokensWithBalanceParams): Promise<BlockchainApiBalanceResponse["balances"]>;
16
21
  /**
17
22
  * Get the balances of the user's tokens on the EIP155 network using native `wallet_getAssets` and `wallet_getCapabilities` calls
18
23
  * @param address - The address of the user
@@ -12,12 +12,18 @@ export declare function getChainsToDisconnect(namespace?: ChainNamespace): [Chai
12
12
  * @returns The active network token address
13
13
  */
14
14
  export declare function getActiveNetworkTokenAddress(): string;
15
+ /**
16
+ * Get the native token address for a given namespace
17
+ * @param namespace - The namespace of the native token
18
+ * @returns The native token address
19
+ */
20
+ export declare function getNativeTokenAddress(namespace: ChainNamespace): "So11111111111111111111111111111111111111111" | "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" | "0x";
15
21
  /**
16
22
  * Get the preferred account type for a given namespace
17
23
  * @param namespace - The namespace of the account
18
24
  * @returns The preferred account type
19
25
  */
20
- export declare function getPreferredAccountType(namespace: ChainNamespace | undefined): "eoa" | "smartAccount" | "payment" | "ordinal" | "stx" | undefined;
26
+ export declare function getPreferredAccountType(namespace: ChainNamespace | undefined): "payment" | "ordinal" | "stx" | "smartAccount" | "eoa" | undefined;
21
27
  /**
22
28
  * Get the active CAIP network for a given chain namespace, if no namespace is provided, it returns the active CAIP network
23
29
  * @param chainNamespace - The chain namespace to get the active CAIP network for
@@ -0,0 +1,54 @@
1
+ import type { ChainNamespace } from '@reown/appkit-common';
2
+ import type { ConnectorItemWithKind, ConnectorWithProviders, WcWallet } from './TypeUtil.js';
3
+ export type WalletItem = {
4
+ id: string;
5
+ name: string;
6
+ imageUrl: string;
7
+ connectors: {
8
+ id: string;
9
+ rdns?: string;
10
+ chain: ChainNamespace;
11
+ chainImageUrl?: string;
12
+ }[];
13
+ walletInfo: {
14
+ description?: WcWallet['description'];
15
+ supportedChains?: WcWallet['chains'];
16
+ supportedNamespaces?: ChainNamespace[];
17
+ website?: WcWallet['homepage'];
18
+ installationLinks?: {
19
+ appStore?: WcWallet['app_store'];
20
+ playStore?: WcWallet['play_store'];
21
+ chromeStore?: WcWallet['chrome_store'];
22
+ desktopLink?: WcWallet['desktop_link'];
23
+ };
24
+ deepLink?: WcWallet['mobile_link'];
25
+ isCertified?: boolean;
26
+ };
27
+ isInjected: boolean;
28
+ isRecent: boolean;
29
+ };
30
+ export declare const ConnectUtil: {
31
+ /**
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.
34
+ */
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;
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,74 @@
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
+ /**
37
+ * Returns the priority of a connector. Base Account has highest priority, followed by Coinbase then the rest.
38
+ *
39
+ * This is needed because Base Account and Coinbase share the same explorer wallet ID.
40
+ * Without prioritization, selecting Base Account could incorrectly trigger the Coinbase Wallet extension.
41
+ *
42
+ * @param connector - The connector to get the priority of.
43
+ * @returns The priority of the connector.
44
+ */
45
+ getPriority(connector: ConnectorWithProviders): 1 | 0 | 2;
46
+ /**
47
+ * Sorts connectors by priority.
48
+ * @param connectors - The connectors to sort.
49
+ * @returns Sorted connectors.
50
+ */
51
+ sortConnectorsByPriority(connectors: ConnectorWithProviders[]): ConnectorWithProviders[];
52
+ getAuthName({ email, socialUsername, socialProvider }: {
53
+ email: string;
54
+ socialUsername?: string | null;
55
+ socialProvider?: SocialProvider | null;
56
+ }): string;
57
+ fetchProviderData(connector: Connector): Promise<{
58
+ accounts: string[];
59
+ chainId: number | undefined;
60
+ }>;
61
+ /**
62
+ * Filter out duplicate custom wallets by RDNS
63
+ * @param wallets
64
+ */
65
+ getFilteredCustomWallets(wallets: WcWallet[]): WcWallet[];
66
+ hasWalletConnector(wallet: WcWallet): boolean;
67
+ isWalletCompatibleWithCurrentChain(wallet: WcWallet): boolean;
68
+ getFilteredRecentWallets(): WcWallet[];
69
+ getCappedRecommendedWallets(wallets: WcWallet[]): WcWallet[];
70
+ processConnectorsByType(connectors: ConnectorWithProviders[], shouldFilter?: boolean): ConnectorWithProviders[];
71
+ connectorList(): ConnectorOrWalletItem[];
72
+ hasInjectedConnectors(): number;
73
+ };
74
+ 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;
@@ -58,6 +59,7 @@ export declare const ConstantsUtil: {
58
59
  payWithExchange: boolean;
59
60
  payments: boolean;
60
61
  reownAuthentication: boolean;
62
+ headless: boolean;
61
63
  };
62
64
  DEFAULT_REMOTE_FEATURES_DISABLED: {
63
65
  readonly email: false;
@@ -68,12 +70,13 @@ export declare const ConstantsUtil: {
68
70
  readonly reownBranding: false;
69
71
  readonly emailCapture: false;
70
72
  readonly reownAuthentication: false;
73
+ readonly headless: false;
71
74
  };
72
75
  DEFAULT_FEATURES: {
73
76
  receive: true;
74
77
  send: true;
75
78
  emailShowWallets: true;
76
- connectorTypeOrder: ("custom" | "walletConnect" | "recent" | "injected" | "featured" | "external" | "recommended")[];
79
+ connectorTypeOrder: ("walletConnect" | "recent" | "injected" | "featured" | "custom" | "external" | "recommended")[];
77
80
  analytics: true;
78
81
  allWallets: true;
79
82
  legalCheckbox: false;
@@ -83,6 +86,7 @@ export declare const ConstantsUtil: {
83
86
  connectMethodsOrder: undefined;
84
87
  pay: false;
85
88
  reownAuthentication: false;
89
+ headless: false;
86
90
  };
87
91
  DEFAULT_SOCIALS: SocialProvider[];
88
92
  DEFAULT_ACCOUNT_TYPES: {
@@ -103,4 +107,6 @@ export declare const ConstantsUtil: {
103
107
  SIWX_DEFAULTS: {
104
108
  readonly signOutOnDisconnect: true;
105
109
  };
110
+ MANDATORY_WALLET_IDS_ON_MOBILE: (string | undefined)[];
111
+ DEFAULT_CONNECT_METHOD_ORDER: ConnectMethod[];
106
112
  };
@@ -65,5 +65,6 @@ export declare const CoreHelperUtil: {
65
65
  isMac(): boolean;
66
66
  formatTelegramSocialLoginUrl(url: string): string;
67
67
  injectIntoUrl(url: string, key: string, appendString: string): string;
68
+ isNumber(value: unknown): boolean;
68
69
  };
69
70
  export {};