@reown/appkit-controllers 1.8.14-rc.0 → 1.8.14-signet-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.map +1 -1
- package/dist/esm/exports/react.js +79 -2
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/src/controllers/ConnectionController.js +6 -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/OptionsController.js +3 -0
- package/dist/esm/src/controllers/OptionsController.js.map +1 -1
- 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 +77 -0
- package/dist/esm/src/utils/ConnectUtil.js.map +1 -0
- package/dist/esm/src/utils/ConstantsUtil.js +4 -2
- package/dist/esm/src/utils/ConstantsUtil.js.map +1 -1
- package/dist/esm/tests/controllers/ConnectionController.test.js +2 -1
- 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 +8 -0
- 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/tsconfig.tsbuildinfo +1 -1
- package/dist/types/exports/index.d.ts +2 -1
- package/dist/types/exports/react.d.ts +53 -0
- package/dist/types/src/controllers/AdapterController/ChainAdapterBlueprint.d.ts +1 -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 +13 -0
- package/dist/types/src/utils/AssetUtil.d.ts +18 -0
- package/dist/types/src/utils/ConnectUtil.d.ts +38 -0
- package/dist/types/src/utils/ConstantsUtil.d.ts +2 -0
- package/dist/types/src/utils/TypeUtil.d.ts +14 -2
- 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';
|
|
@@ -69,5 +69,6 @@ export type { Exchange, GetExchangesParams, PayUrlParams, PaymentAsset, CurrentP
|
|
|
69
69
|
export { FetchUtil } from '../src/utils/FetchUtil.js';
|
|
70
70
|
export type * from '../src/utils/TypeUtil.js';
|
|
71
71
|
export type * from '../src/utils/SIWXUtil.js';
|
|
72
|
+
export type { WalletItem } from '../src/utils/ConnectUtil.js';
|
|
72
73
|
export * from '../src/utils/ChainControllerUtil.js';
|
|
73
74
|
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,55 @@ 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 all wallets (injected wallets and WalletConnect wallets combined)
|
|
82
|
+
*/
|
|
83
|
+
data: WalletItem[];
|
|
84
|
+
/**
|
|
85
|
+
* Boolean that indicates if WalletConnect wallets are being fetched.
|
|
86
|
+
*/
|
|
87
|
+
isFetchingWallets: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Boolean that indicates if a WalletConnect URI is being fetched.
|
|
90
|
+
*/
|
|
91
|
+
isFetchingWcUri: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The current WalletConnect URI for QR code display.
|
|
94
|
+
* This is set when connecting to a WalletConnect wallet.
|
|
95
|
+
*/
|
|
96
|
+
wcUri?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The current page number.
|
|
99
|
+
*/
|
|
100
|
+
page: number;
|
|
101
|
+
/**
|
|
102
|
+
* The total number of available wallets.
|
|
103
|
+
*/
|
|
104
|
+
count: number;
|
|
105
|
+
/**
|
|
106
|
+
* Function to fetch WalletConnect wallets from the explorer API.
|
|
107
|
+
* This is useful for pagination or initial load.
|
|
108
|
+
* @param options - Options for fetching wallets
|
|
109
|
+
* @param options.page - Page number to fetch (default: 1)
|
|
110
|
+
*/
|
|
111
|
+
fetchWallets: (options?: {
|
|
112
|
+
page?: number;
|
|
113
|
+
query?: string;
|
|
114
|
+
}) => Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* 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
|
|
119
|
+
*
|
|
120
|
+
* @param wallet - The wallet item to connect to
|
|
121
|
+
* @param callbacks - Success and error callbacks
|
|
122
|
+
* @returns Promise that resolves when connection completes or rejects on error
|
|
123
|
+
*/
|
|
124
|
+
connect: (wallet: WalletItem, namespace?: ChainNamespace) => Promise<void>;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Headless hook for wallet connection.
|
|
128
|
+
* Provides all the data and functions needed to build a custom connect UI.
|
|
129
|
+
*/
|
|
130
|
+
export declare function useAppKitWallets(): UseAppKitWalletsReturn;
|
|
@@ -445,6 +445,7 @@ export declare namespace AdapterBlueprint {
|
|
|
445
445
|
type GetAccountsParams = {
|
|
446
446
|
id: AppKitConnector['id'];
|
|
447
447
|
namespace?: ChainNamespace;
|
|
448
|
+
caipNetworkId?: CaipNetwork['caipNetworkId'];
|
|
448
449
|
};
|
|
449
450
|
interface GetConnectionParams<C extends ChainAdapterConnector = ChainAdapterConnector> {
|
|
450
451
|
connectorId?: string;
|
|
@@ -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
|
/**
|
|
@@ -85,6 +85,11 @@ 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;
|
|
88
93
|
/**
|
|
89
94
|
* Enable or disable the Injected wallet.
|
|
90
95
|
* @default true
|
|
@@ -226,6 +231,7 @@ export declare const OptionsController: {
|
|
|
226
231
|
setAllowUnsupportedChain(allowUnsupportedChain: OptionsControllerState["allowUnsupportedChain"]): void;
|
|
227
232
|
setManualWCControl(manualWCControl: OptionsControllerState["manualWCControl"]): void;
|
|
228
233
|
setEnableNetworkSwitch(enableNetworkSwitch: OptionsControllerState["enableNetworkSwitch"]): void;
|
|
234
|
+
setEnableHeadless(enableHeadless: OptionsControllerState["enableHeadless"]): void;
|
|
229
235
|
setEnableMobileFullScreen(enableMobileFullScreen: OptionsControllerState["enableMobileFullScreen"]): void;
|
|
230
236
|
setEnableReconnect(enableReconnect: OptionsControllerState["enableReconnect"]): void;
|
|
231
237
|
setCoinbasePreference(coinbasePreference: OptionsControllerState["coinbasePreference"]): void;
|
|
@@ -1629,6 +1635,12 @@ export declare const OptionsController: {
|
|
|
1629
1635
|
*/
|
|
1630
1636
|
| undefined;
|
|
1631
1637
|
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
|
|
1632
1644
|
/**
|
|
1633
1645
|
* Enable or disable the Injected wallet.
|
|
1634
1646
|
* @default true
|
|
@@ -1784,6 +1796,7 @@ export declare const OptionsController: {
|
|
|
1784
1796
|
readonly payWithExchange?: boolean | undefined;
|
|
1785
1797
|
readonly payments?: boolean | undefined;
|
|
1786
1798
|
readonly onramp?: false | readonly "meld"[] | undefined;
|
|
1799
|
+
readonly headless?: boolean | undefined;
|
|
1787
1800
|
} | undefined;
|
|
1788
1801
|
};
|
|
1789
1802
|
};
|
|
@@ -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,38 @@
|
|
|
1
|
+
import type { ChainNamespace } from '@reown/appkit-common';
|
|
2
|
+
import type { 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
|
+
* Transforms connectors and wallets into a unified list of wallet items
|
|
33
|
+
*/
|
|
34
|
+
getUnifiedWalletList(params: {
|
|
35
|
+
wcWallets: WcWallet[];
|
|
36
|
+
search: WcWallet[];
|
|
37
|
+
}): WalletItem[];
|
|
38
|
+
};
|
|
@@ -58,6 +58,7 @@ export declare const ConstantsUtil: {
|
|
|
58
58
|
payWithExchange: boolean;
|
|
59
59
|
payments: boolean;
|
|
60
60
|
reownAuthentication: boolean;
|
|
61
|
+
headless: boolean;
|
|
61
62
|
};
|
|
62
63
|
DEFAULT_REMOTE_FEATURES_DISABLED: {
|
|
63
64
|
readonly email: false;
|
|
@@ -68,6 +69,7 @@ export declare const ConstantsUtil: {
|
|
|
68
69
|
readonly reownBranding: false;
|
|
69
70
|
readonly emailCapture: false;
|
|
70
71
|
readonly reownAuthentication: false;
|
|
72
|
+
readonly headless: false;
|
|
71
73
|
};
|
|
72
74
|
DEFAULT_FEATURES: {
|
|
73
75
|
receive: true;
|
|
@@ -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;
|
|
@@ -1043,6 +1047,7 @@ export interface RequestArguments {
|
|
|
1043
1047
|
}
|
|
1044
1048
|
export interface Provider {
|
|
1045
1049
|
connect: (params?: {
|
|
1050
|
+
caipNetworkId?: CaipNetworkId;
|
|
1046
1051
|
onUri?: (uri: string) => void;
|
|
1047
1052
|
}) => Promise<string>;
|
|
1048
1053
|
disconnect: () => Promise<void>;
|
|
@@ -1067,6 +1072,7 @@ export type RemoteFeatures = {
|
|
|
1067
1072
|
payWithExchange?: boolean;
|
|
1068
1073
|
payments?: boolean;
|
|
1069
1074
|
onramp?: OnRampProvider[] | false;
|
|
1075
|
+
headless?: boolean;
|
|
1070
1076
|
};
|
|
1071
1077
|
export type Features = {
|
|
1072
1078
|
/**
|
|
@@ -1196,13 +1202,13 @@ export type ConnectionStatus = 'connected' | 'disconnected' | 'connecting' | 're
|
|
|
1196
1202
|
export type PreferredAccountTypes = {
|
|
1197
1203
|
[Key in keyof NamespaceTypeMap]?: NamespaceTypeMap[Key];
|
|
1198
1204
|
};
|
|
1199
|
-
export type FeatureID = 'multi_wallet' | 'activity' | 'onramp' | 'swap' | 'social_login' | 'reown_branding' | 'email_capture' | 'fund_from_exchange' | 'payments' | 'reown_authentication';
|
|
1205
|
+
export type FeatureID = 'multi_wallet' | 'activity' | 'onramp' | 'swap' | 'social_login' | 'reown_branding' | 'email_capture' | 'fund_from_exchange' | 'payments' | 'reown_authentication' | 'headless';
|
|
1200
1206
|
export interface BaseFeature<T extends FeatureID, C extends string[] | null> {
|
|
1201
1207
|
id: T;
|
|
1202
1208
|
isEnabled: boolean;
|
|
1203
1209
|
config: C;
|
|
1204
1210
|
}
|
|
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[]>;
|
|
1211
|
+
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
1212
|
export type ApiGetProjectConfigResponse = {
|
|
1207
1213
|
features: TypedFeatureConfig[];
|
|
1208
1214
|
};
|
|
@@ -1278,6 +1284,12 @@ export type FeatureConfigMap = {
|
|
|
1278
1284
|
returnType: boolean;
|
|
1279
1285
|
isLegacy: false;
|
|
1280
1286
|
};
|
|
1287
|
+
headless: {
|
|
1288
|
+
apiFeatureName: 'headless';
|
|
1289
|
+
localFeatureName: 'headless';
|
|
1290
|
+
returnType: boolean;
|
|
1291
|
+
isLegacy: false;
|
|
1292
|
+
};
|
|
1281
1293
|
};
|
|
1282
1294
|
export type FeatureKey = keyof FeatureConfigMap;
|
|
1283
1295
|
export type Tier = 'none' | 'starter' | 'pro' | 'enteprise';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-controllers",
|
|
3
|
-
"version": "1.8.14-
|
|
3
|
+
"version": "1.8.14-signet-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-
|
|
60
|
-
"@reown/appkit-wallet": "1.8.14-
|
|
59
|
+
"@reown/appkit-common": "1.8.14-signet-fix.0",
|
|
60
|
+
"@reown/appkit-wallet": "1.8.14-signet-fix.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@vitest/coverage-v8": "2.1.9",
|