@reown/appkit-controllers 1.8.14-rc2.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.
- package/dist/esm/exports/index.js +2 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/react.js +121 -2
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/src/controllers/ConnectionController.js +9 -0
- package/dist/esm/src/controllers/ConnectionController.js.map +1 -1
- package/dist/esm/src/controllers/ConnectorController.js +7 -6
- package/dist/esm/src/controllers/ConnectorController.js.map +1 -1
- package/dist/esm/src/controllers/PublicStateController.js +2 -1
- package/dist/esm/src/controllers/PublicStateController.js.map +1 -1
- package/dist/esm/src/utils/ApiControllerUtil.js +34 -0
- package/dist/esm/src/utils/ApiControllerUtil.js.map +1 -0
- package/dist/esm/src/utils/AssetUtil.js +42 -0
- package/dist/esm/src/utils/AssetUtil.js.map +1 -1
- package/dist/esm/src/utils/ConnectUtil.js +92 -0
- package/dist/esm/src/utils/ConnectUtil.js.map +1 -0
- package/dist/esm/src/utils/ConnectionControllerUtil.js +36 -0
- package/dist/esm/src/utils/ConnectionControllerUtil.js.map +1 -1
- package/dist/esm/src/utils/ConnectorUtil.js +287 -0
- package/dist/esm/src/utils/ConnectorUtil.js.map +1 -0
- package/dist/esm/src/utils/ConstantsUtil.js +17 -5
- package/dist/esm/src/utils/ConstantsUtil.js.map +1 -1
- package/dist/esm/src/utils/WalletUtil.js +161 -0
- package/dist/esm/src/utils/WalletUtil.js.map +1 -0
- package/dist/esm/tests/controllers/ConnectionController.test.js +5 -2
- package/dist/esm/tests/controllers/ConnectionController.test.js.map +1 -1
- package/dist/esm/tests/controllers/ConnectorController.test.js +8 -8
- package/dist/esm/tests/controllers/ConnectorController.test.js.map +1 -1
- package/dist/esm/tests/hooks/react.test.js +505 -3
- package/dist/esm/tests/hooks/react.test.js.map +1 -1
- package/dist/esm/tests/hooks/vue.test.js +8 -0
- package/dist/esm/tests/hooks/vue.test.js.map +1 -1
- package/dist/esm/tests/utils/ControllerUtil.test.js +500 -0
- package/dist/esm/tests/utils/ControllerUtil.test.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/exports/index.d.ts +4 -1
- package/dist/types/exports/react.d.ts +69 -0
- package/dist/types/src/controllers/ConnectionController.d.ts +1 -0
- package/dist/types/src/controllers/ConnectorController.d.ts +4 -8
- package/dist/types/src/controllers/OptionsController.d.ts +2 -0
- package/dist/types/src/controllers/PublicStateController.d.ts +6 -0
- package/dist/types/src/utils/ApiControllerUtil.d.ts +8 -0
- package/dist/types/src/utils/AssetUtil.d.ts +18 -0
- package/dist/types/src/utils/ConnectUtil.d.ts +54 -0
- package/dist/types/src/utils/ConnectionControllerUtil.d.ts +2 -0
- package/dist/types/src/utils/ConnectorUtil.d.ts +58 -0
- package/dist/types/src/utils/ConstantsUtil.d.ts +6 -0
- package/dist/types/src/utils/TypeUtil.d.ts +30 -2
- package/dist/types/src/utils/ViemUtil.d.ts +12 -12
- package/dist/types/src/utils/WalletUtil.d.ts +81 -0
- package/dist/types/tests/utils/ControllerUtil.test.d.ts +1 -0
- package/package.json +3 -3
|
@@ -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
|
|
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,8 +1,5 @@
|
|
|
1
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
|
-
}
|
|
2
|
+
import type { AuthConnector, Connector, ConnectorWithProviders, WcWallet } from '../utils/TypeUtil.js';
|
|
6
3
|
export interface ConnectorControllerState {
|
|
7
4
|
allConnectors: Connector[];
|
|
8
5
|
connectors: ConnectorWithProviders[];
|
|
@@ -33,10 +30,9 @@ export declare const ConnectorController: {
|
|
|
33
30
|
getAuthConnector(chainNamespace?: ChainNamespace): AuthConnector | undefined;
|
|
34
31
|
getAnnouncedConnectorRdns(): (string | undefined)[];
|
|
35
32
|
getConnectorById(id: string): Connector | undefined;
|
|
36
|
-
getConnector({ id,
|
|
37
|
-
id
|
|
38
|
-
|
|
39
|
-
namespace?: ChainNamespace;
|
|
33
|
+
getConnector({ id, namespace }: {
|
|
34
|
+
id: string;
|
|
35
|
+
namespace: ChainNamespace;
|
|
40
36
|
}): Connector | undefined;
|
|
41
37
|
syncIfAuthConnector(connector: Connector | AuthConnector): void;
|
|
42
38
|
/**
|
|
@@ -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>;
|
|
@@ -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;
|
|
@@ -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
|
+
};
|
|
@@ -13,4 +13,22 @@ export declare const AssetUtil: {
|
|
|
13
13
|
getConnectorImage(connector?: Connector): string | undefined;
|
|
14
14
|
getChainImage(chain: ChainNamespace): string | undefined;
|
|
15
15
|
getTokenImage(symbol?: string): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Get the explorer wallet's image URL for the given image ID.
|
|
18
|
+
* @param imageId - The image id of the wallet.
|
|
19
|
+
* @returns The image URL for the wallet.
|
|
20
|
+
*/
|
|
21
|
+
getWalletImageUrl(imageId: string | undefined): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the public asset's image URL with the given image ID.
|
|
24
|
+
* @param imageId - The image id of the asset.
|
|
25
|
+
* @returns The image URL for the asset.
|
|
26
|
+
*/
|
|
27
|
+
getAssetImageUrl(imageId: string | undefined): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the image URL for the given chain namespace.
|
|
30
|
+
* @param chainNamespace - The chain namespace to get the image URL for.
|
|
31
|
+
* @returns The image URL for the chain namespace.
|
|
32
|
+
*/
|
|
33
|
+
getChainNamespaceImageUrl(chainNamespace: ChainNamespace): string;
|
|
16
34
|
};
|
|
@@ -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,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;
|
|
@@ -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,6 +70,7 @@ 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;
|
|
@@ -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
|
};
|
|
@@ -71,6 +71,9 @@ export type Connector = {
|
|
|
71
71
|
connectors?: Connector[];
|
|
72
72
|
explorerWallet?: WcWallet;
|
|
73
73
|
};
|
|
74
|
+
export interface ConnectorWithProviders extends Connector {
|
|
75
|
+
connectors?: Connector[];
|
|
76
|
+
}
|
|
74
77
|
export interface AuthConnector extends Connector {
|
|
75
78
|
provider: W3mFrameProvider;
|
|
76
79
|
socials?: SocialProvider[];
|
|
@@ -95,6 +98,7 @@ export interface WcWallet {
|
|
|
95
98
|
id: string;
|
|
96
99
|
name: string;
|
|
97
100
|
badge_type?: BadgeType;
|
|
101
|
+
description?: string;
|
|
98
102
|
chains?: CaipNetworkId[];
|
|
99
103
|
homepage?: string;
|
|
100
104
|
image_id?: string;
|
|
@@ -1067,6 +1071,7 @@ export type RemoteFeatures = {
|
|
|
1067
1071
|
payWithExchange?: boolean;
|
|
1068
1072
|
payments?: boolean;
|
|
1069
1073
|
onramp?: OnRampProvider[] | false;
|
|
1074
|
+
headless?: boolean;
|
|
1070
1075
|
};
|
|
1071
1076
|
export type Features = {
|
|
1072
1077
|
/**
|
|
@@ -1165,6 +1170,12 @@ export type Features = {
|
|
|
1165
1170
|
* @type {boolean}
|
|
1166
1171
|
*/
|
|
1167
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;
|
|
1168
1179
|
};
|
|
1169
1180
|
export type FeaturesKeys = Exclude<keyof Features, 'swaps' | 'onramp' | 'email' | 'socials' | 'history'>;
|
|
1170
1181
|
export type WalletGuideType = 'get-started' | 'explore';
|
|
@@ -1196,13 +1207,13 @@ export type ConnectionStatus = 'connected' | 'disconnected' | 'connecting' | 're
|
|
|
1196
1207
|
export type PreferredAccountTypes = {
|
|
1197
1208
|
[Key in keyof NamespaceTypeMap]?: NamespaceTypeMap[Key];
|
|
1198
1209
|
};
|
|
1199
|
-
export type FeatureID = 'multi_wallet' | 'activity' | 'onramp' | 'swap' | 'social_login' | 'reown_branding' | 'email_capture' | 'fund_from_exchange' | 'payments' | 'reown_authentication';
|
|
1210
|
+
export type FeatureID = 'multi_wallet' | 'activity' | 'onramp' | 'swap' | 'social_login' | 'reown_branding' | 'email_capture' | 'fund_from_exchange' | 'payments' | 'reown_authentication' | 'headless';
|
|
1200
1211
|
export interface BaseFeature<T extends FeatureID, C extends string[] | null> {
|
|
1201
1212
|
id: T;
|
|
1202
1213
|
isEnabled: boolean;
|
|
1203
1214
|
config: C;
|
|
1204
1215
|
}
|
|
1205
|
-
export type TypedFeatureConfig = BaseFeature<'activity', null | []> | BaseFeature<'onramp', OnRampProvider[]> | BaseFeature<'swap', SwapProvider[]> | BaseFeature<'social_login', (SocialProvider | 'email')[]> | BaseFeature<'reown_branding', null | []> | BaseFeature<'multi_wallet', null | []> | BaseFeature<'email_capture', EmailCaptureOptions[]>;
|
|
1216
|
+
export type TypedFeatureConfig = BaseFeature<'activity', null | []> | BaseFeature<'onramp', OnRampProvider[]> | BaseFeature<'swap', SwapProvider[]> | BaseFeature<'social_login', (SocialProvider | 'email')[]> | BaseFeature<'reown_branding', null | []> | BaseFeature<'multi_wallet', null | []> | BaseFeature<'email_capture', EmailCaptureOptions[]> | BaseFeature<'headless', null | []>;
|
|
1206
1217
|
export type ApiGetProjectConfigResponse = {
|
|
1207
1218
|
features: TypedFeatureConfig[];
|
|
1208
1219
|
};
|
|
@@ -1278,6 +1289,12 @@ export type FeatureConfigMap = {
|
|
|
1278
1289
|
returnType: boolean;
|
|
1279
1290
|
isLegacy: false;
|
|
1280
1291
|
};
|
|
1292
|
+
headless: {
|
|
1293
|
+
apiFeatureName: 'headless';
|
|
1294
|
+
localFeatureName: 'headless';
|
|
1295
|
+
returnType: boolean;
|
|
1296
|
+
isLegacy: false;
|
|
1297
|
+
};
|
|
1281
1298
|
};
|
|
1282
1299
|
export type FeatureKey = keyof FeatureConfigMap;
|
|
1283
1300
|
export type Tier = 'none' | 'starter' | 'pro' | 'enteprise';
|
|
@@ -1285,4 +1302,15 @@ export type ProjectLimits = {
|
|
|
1285
1302
|
isAboveRpcLimit: boolean;
|
|
1286
1303
|
isAboveMauLimit: boolean;
|
|
1287
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;
|
|
1288
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" | "
|
|
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" | "
|
|
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>>;
|