@reown/appkit-core 1.0.4 → 1.0.6-0e6050d7a.1
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 +1 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/react.js +1 -0
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/src/controllers/AccountController.js +8 -4
- package/dist/esm/src/controllers/AccountController.js.map +1 -1
- package/dist/esm/src/controllers/AlertController.js +35 -0
- package/dist/esm/src/controllers/AlertController.js.map +1 -0
- package/dist/esm/src/controllers/ApiController.js +15 -12
- package/dist/esm/src/controllers/ApiController.js.map +1 -1
- package/dist/esm/src/controllers/ChainController.js +4 -4
- package/dist/esm/src/controllers/ChainController.js.map +1 -1
- package/dist/esm/src/controllers/ConnectionController.js +47 -8
- package/dist/esm/src/controllers/ConnectionController.js.map +1 -1
- package/dist/esm/src/controllers/NetworkController.js +7 -10
- package/dist/esm/src/controllers/NetworkController.js.map +1 -1
- package/dist/esm/src/controllers/OptionsController.js +10 -1
- package/dist/esm/src/controllers/OptionsController.js.map +1 -1
- package/dist/esm/src/controllers/SendController.js +4 -3
- package/dist/esm/src/controllers/SendController.js.map +1 -1
- package/dist/esm/src/controllers/SnackController.js +15 -5
- package/dist/esm/src/controllers/SnackController.js.map +1 -1
- package/dist/esm/src/controllers/SwapController.js +20 -13
- package/dist/esm/src/controllers/SwapController.js.map +1 -1
- package/dist/esm/src/utils/CoreHelperUtil.js +23 -2
- package/dist/esm/src/utils/CoreHelperUtil.js.map +1 -1
- package/dist/esm/tests/controllers/AccountController.test.js +11 -3
- package/dist/esm/tests/controllers/AccountController.test.js.map +1 -1
- package/dist/esm/tests/controllers/AlertController.test.js +48 -0
- package/dist/esm/tests/controllers/AlertController.test.js.map +1 -0
- package/dist/esm/tests/controllers/ApiController.test.js +10 -31
- package/dist/esm/tests/controllers/ApiController.test.js.map +1 -1
- package/dist/esm/tests/controllers/SnackController.test.js +4 -0
- package/dist/esm/tests/controllers/SnackController.test.js.map +1 -1
- package/dist/esm/tests/hooks/react.test.js +2 -0
- package/dist/esm/tests/hooks/react.test.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/exports/index.d.ts +2 -0
- package/dist/types/exports/react.d.ts +2 -1
- package/dist/types/index.d.ts +47 -0
- package/dist/types/src/controllers/AccountController.d.ts +5 -4
- package/dist/types/src/controllers/AlertController.d.ts +16 -0
- package/dist/types/src/controllers/ApiController.d.ts +4 -1
- package/dist/types/src/controllers/ChainController.d.ts +2 -2
- package/dist/types/src/controllers/ConnectionController.d.ts +4 -2
- package/dist/types/src/controllers/OptionsController.d.ts +8 -0
- package/dist/types/src/controllers/SnackController.d.ts +4 -3
- package/dist/types/src/utils/CoreHelperUtil.d.ts +2 -0
- package/dist/types/src/utils/TypeUtil.d.ts +11 -1
- package/dist/types/tests/controllers/AlertController.test.d.ts +1 -0
- package/package.json +4 -4
|
@@ -39,6 +39,8 @@ export { TooltipController } from '../src/controllers/TooltipController.js';
|
|
|
39
39
|
export type { TooltipControllerState } from '../src/controllers/TooltipController.js';
|
|
40
40
|
export { EnsController } from '../src/controllers/EnsController.js';
|
|
41
41
|
export type { EnsControllerState } from '../src/controllers/EnsController.js';
|
|
42
|
+
export { AlertController } from '../src/controllers/AlertController.js';
|
|
43
|
+
export type { AlertControllerState } from '../src/controllers/AlertController.js';
|
|
42
44
|
export { AssetUtil } from '../src/utils/AssetUtil.js';
|
|
43
45
|
export { ConstantsUtil } from '../src/utils/ConstantsUtil.js';
|
|
44
46
|
export { CoreHelperUtil } from '../src/utils/CoreHelperUtil.js';
|
|
@@ -13,7 +13,8 @@ export declare function useAppKitNetwork(): {
|
|
|
13
13
|
chainId: import("@reown/appkit-common").ChainId | undefined;
|
|
14
14
|
};
|
|
15
15
|
export declare function useAppKitAccount(): {
|
|
16
|
+
caipAddress: `eip155:${string}:${string}` | `eip155:${number}:${string}` | `solana:${string}:${string}` | `solana:${number}:${string}` | `polkadot:${string}:${string}` | `polkadot:${number}:${string}` | undefined;
|
|
16
17
|
address: string | undefined;
|
|
17
18
|
isConnected: boolean;
|
|
18
|
-
status: "
|
|
19
|
+
status: "connecting" | "connected" | "disconnected" | "reconnecting" | undefined;
|
|
19
20
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export { ModalController } from './src/controllers/ModalController.js';
|
|
2
|
+
export type { ModalControllerArguments, ModalControllerState } from './src/controllers/ModalController.js';
|
|
3
|
+
export { RouterController } from './src/controllers/RouterController.js';
|
|
4
|
+
export type { RouterControllerState } from './src/controllers/RouterController.js';
|
|
5
|
+
export { AccountController } from './src/controllers/AccountController.js';
|
|
6
|
+
export type { AccountControllerState } from './src/controllers/AccountController.js';
|
|
7
|
+
export { ChainController } from './src/controllers/ChainController.js';
|
|
8
|
+
export type { ChainControllerState } from './src/controllers/ChainController.js';
|
|
9
|
+
export { NetworkController } from './src/controllers/NetworkController.js';
|
|
10
|
+
export type { NetworkControllerClient, NetworkControllerState } from './src/controllers/NetworkController.js';
|
|
11
|
+
export { OnRampController } from './src/controllers/OnRampController.js';
|
|
12
|
+
export type { OnRampControllerState, OnRampProvider } from './src/controllers/OnRampController.js';
|
|
13
|
+
export { ConnectionController } from './src/controllers/ConnectionController.js';
|
|
14
|
+
export type { ConnectionControllerClient, ConnectionControllerState } from './src/controllers/ConnectionController.js';
|
|
15
|
+
export { ConnectorController } from './src/controllers/ConnectorController.js';
|
|
16
|
+
export type { ConnectorControllerState } from './src/controllers/ConnectorController.js';
|
|
17
|
+
export { SnackController } from './src/controllers/SnackController.js';
|
|
18
|
+
export type { SnackControllerState } from './src/controllers/SnackController.js';
|
|
19
|
+
export { ApiController } from './src/controllers/ApiController.js';
|
|
20
|
+
export type { ApiControllerState } from './src/controllers/ApiController.js';
|
|
21
|
+
export { AssetController } from './src/controllers/AssetController.js';
|
|
22
|
+
export type { AssetControllerState } from './src/controllers/AssetController.js';
|
|
23
|
+
export { ThemeController } from './src/controllers/ThemeController.js';
|
|
24
|
+
export type { ThemeControllerState } from './src/controllers/ThemeController.js';
|
|
25
|
+
export { OptionsController } from './src/controllers/OptionsController.js';
|
|
26
|
+
export type { OptionsControllerState } from './src/controllers/OptionsController.js';
|
|
27
|
+
export { BlockchainApiController } from './src/controllers/BlockchainApiController.js';
|
|
28
|
+
export { PublicStateController } from './src/controllers/PublicStateController.js';
|
|
29
|
+
export type { PublicStateControllerState } from './src/controllers/PublicStateController.js';
|
|
30
|
+
export { EventsController } from './src/controllers/EventsController.js';
|
|
31
|
+
export type { EventsControllerState } from './src/controllers/EventsController.js';
|
|
32
|
+
export { TransactionsController } from './src/controllers/TransactionsController.js';
|
|
33
|
+
export type { TransactionsControllerState } from './src/controllers/TransactionsController.js';
|
|
34
|
+
export { SwapController } from './src/controllers/SwapController.js';
|
|
35
|
+
export type { SwapControllerState, SwapInputTarget } from './src/controllers/SwapController.js';
|
|
36
|
+
export { SendController } from './src/controllers/SendController.js';
|
|
37
|
+
export type { SendControllerState } from './src/controllers/SendController.js';
|
|
38
|
+
export { TooltipController } from './src/controllers/TooltipController.js';
|
|
39
|
+
export type { TooltipControllerState } from './src/controllers/TooltipController.js';
|
|
40
|
+
export { EnsController } from './src/controllers/EnsController.js';
|
|
41
|
+
export type { EnsControllerState } from './src/controllers/EnsController.js';
|
|
42
|
+
export { AssetUtil } from './src/utils/AssetUtil.js';
|
|
43
|
+
export { ConstantsUtil } from './src/utils/ConstantsUtil.js';
|
|
44
|
+
export { CoreHelperUtil } from './src/utils/CoreHelperUtil.js';
|
|
45
|
+
export { StorageUtil } from './src/utils/StorageUtil.js';
|
|
46
|
+
export { RouterUtil } from './src/utils/RouterUtil.js';
|
|
47
|
+
export type * from './src/utils/TypeUtil.js';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CaipAddress, ChainNamespace } from '@reown/appkit-common';
|
|
3
|
-
import type { Balance } from '@reown/appkit-common';
|
|
1
|
+
import type { Balance, CaipAddress, ChainNamespace } from '@reown/appkit-common';
|
|
4
2
|
import type { W3mFrameTypes } from '@reown/appkit-wallet';
|
|
5
3
|
import type UniversalProvider from '@walletconnect/universal-provider';
|
|
4
|
+
import type { AccountType, CombinedProvider, ConnectedWalletInfo, Provider, SocialProvider } from '../utils/TypeUtil.js';
|
|
6
5
|
export interface AccountControllerState {
|
|
7
6
|
currentTab: number;
|
|
8
7
|
caipAddress?: CaipAddress;
|
|
@@ -22,9 +21,10 @@ export interface AccountControllerState {
|
|
|
22
21
|
preferredAccountType?: W3mFrameTypes.AccountType;
|
|
23
22
|
socialWindow?: Window;
|
|
24
23
|
farcasterUrl?: string;
|
|
24
|
+
is1ClickAuthenticating?: boolean;
|
|
25
25
|
provider?: UniversalProvider | Provider | CombinedProvider;
|
|
26
26
|
status?: 'reconnecting' | 'connected' | 'disconnected' | 'connecting';
|
|
27
|
-
siweStatus?: 'uninitialized' | 'ready' | 'loading' | 'success' | 'rejected' | 'error';
|
|
27
|
+
siweStatus?: 'uninitialized' | 'ready' | 'loading' | 'success' | 'rejected' | 'error' | 'authenticating';
|
|
28
28
|
}
|
|
29
29
|
export declare const AccountController: {
|
|
30
30
|
state: AccountControllerState;
|
|
@@ -54,4 +54,5 @@ export declare const AccountController: {
|
|
|
54
54
|
fetchTokenBalance(): Promise<void>;
|
|
55
55
|
resetAccount(chain: ChainNamespace): void;
|
|
56
56
|
setSiweStatus(status: AccountControllerState['siweStatus']): void;
|
|
57
|
+
setIs1ClickAuthenticating(is1ClickAuthenticating: AccountControllerState['is1ClickAuthenticating']): void;
|
|
57
58
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AlertControllerState {
|
|
2
|
+
message: string;
|
|
3
|
+
variant: 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
open: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface OpenMessageParameters {
|
|
7
|
+
shortMessage: string;
|
|
8
|
+
longMessage?: string | (() => void);
|
|
9
|
+
}
|
|
10
|
+
export declare const AlertController: {
|
|
11
|
+
state: AlertControllerState;
|
|
12
|
+
subscribeKey<K extends keyof AlertControllerState>(key: K, callback: (value: AlertControllerState[K]) => void): () => void;
|
|
13
|
+
open(message: OpenMessageParameters, variant: AlertControllerState['variant']): void;
|
|
14
|
+
close(): void;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -39,5 +39,8 @@ export declare const ApiController: {
|
|
|
39
39
|
searchWallet({ search }: Pick<ApiGetWalletsRequest, 'search'>): Promise<void>;
|
|
40
40
|
reFetchWallets(): Promise<void>;
|
|
41
41
|
prefetch(): void;
|
|
42
|
-
|
|
42
|
+
fetchProjectConfig(): Promise<{
|
|
43
|
+
isAnalyticsEnabled: boolean;
|
|
44
|
+
isAppKitAuthEnabled: boolean;
|
|
45
|
+
}>;
|
|
43
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChainAdapter, Connector } from '../utils/TypeUtil.js';
|
|
2
|
-
import { type NetworkControllerState } from './NetworkController.js';
|
|
3
|
-
import { type AccountControllerState } from './AccountController.js';
|
|
4
2
|
import { type CaipAddress, type CaipNetwork, type ChainNamespace } from '@reown/appkit-common';
|
|
3
|
+
import { type AccountControllerState } from './AccountController.js';
|
|
4
|
+
import { type NetworkControllerState } from './NetworkController.js';
|
|
5
5
|
export interface ChainControllerState {
|
|
6
6
|
activeChain: ChainNamespace | undefined;
|
|
7
7
|
activeCaipAddress: CaipAddress | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Connector, EstimateGasTransactionArgs, SendTransactionArgs, WcWallet, WriteContractArgs } from '../utils/TypeUtil.js';
|
|
2
|
-
import { type W3mFrameTypes } from '@reown/appkit-wallet';
|
|
3
1
|
import type { ChainNamespace } from '@reown/appkit-common';
|
|
2
|
+
import { type W3mFrameTypes } from '@reown/appkit-wallet';
|
|
3
|
+
import type { Connector, EstimateGasTransactionArgs, SendTransactionArgs, WcWallet, WriteContractArgs } from '../utils/TypeUtil.js';
|
|
4
4
|
export interface ConnectExternalOptions {
|
|
5
5
|
id: Connector['id'];
|
|
6
6
|
type: Connector['type'];
|
|
@@ -33,6 +33,7 @@ export interface ConnectionControllerState {
|
|
|
33
33
|
wcError?: boolean;
|
|
34
34
|
recentWallet?: WcWallet;
|
|
35
35
|
buffering: boolean;
|
|
36
|
+
wcClientId?: string | null;
|
|
36
37
|
status?: 'connecting' | 'connected' | 'disconnected';
|
|
37
38
|
}
|
|
38
39
|
export declare const ConnectionController: {
|
|
@@ -58,6 +59,7 @@ export declare const ConnectionController: {
|
|
|
58
59
|
setWcError(wcError: ConnectionControllerState['wcError']): void;
|
|
59
60
|
setRecentWallet(wallet: ConnectionControllerState['recentWallet']): void;
|
|
60
61
|
setBuffering(buffering: ConnectionControllerState['buffering']): void;
|
|
62
|
+
setClientId(clientId: ConnectionControllerState['wcClientId']): void;
|
|
61
63
|
setStatus(status: ConnectionControllerState['status']): void;
|
|
62
64
|
disconnect(): Promise<void>;
|
|
63
65
|
};
|
|
@@ -62,6 +62,7 @@ export interface OptionsControllerStatePublic {
|
|
|
62
62
|
* @default false
|
|
63
63
|
*/
|
|
64
64
|
disableAppend?: boolean;
|
|
65
|
+
enableAuth?: boolean;
|
|
65
66
|
/**
|
|
66
67
|
* Enable or disable the all the wallet options (injected, Coinbase, QR, etc.). This is useful if you want to use only email and socials.
|
|
67
68
|
* @default true
|
|
@@ -87,6 +88,11 @@ export interface OptionsControllerStatePublic {
|
|
|
87
88
|
* @default true
|
|
88
89
|
*/
|
|
89
90
|
enableWalletConnect?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Enable or disable debug mode in your AppKit. This is useful if you want to see UI alerts when debugging.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
debug?: boolean;
|
|
90
96
|
/**
|
|
91
97
|
* Features configuration object.
|
|
92
98
|
* @default { swaps: true, onramp: true, email: true, socials: ['google', 'x', 'discord', 'farcaster', 'github', 'apple', 'facebook'], history: true, analytics: true, allWallets: true }
|
|
@@ -122,7 +128,9 @@ export declare const OptionsController: {
|
|
|
122
128
|
setSdkVersion(sdkVersion: OptionsControllerState['sdkVersion']): void;
|
|
123
129
|
setMetadata(metadata: OptionsControllerState['metadata']): void;
|
|
124
130
|
setDisableAppend(disableAppend: OptionsControllerState['disableAppend']): void;
|
|
131
|
+
setEnableAuth(enableAuth: OptionsControllerState['enableAuth']): void;
|
|
125
132
|
setEIP6963Enabled(enableEIP6963: OptionsControllerState['enableEIP6963']): void;
|
|
133
|
+
setDebug(debug: OptionsControllerState['debug']): void;
|
|
126
134
|
setEnableWalletConnect(enableWalletConnect: OptionsControllerState['enableWalletConnect']): void;
|
|
127
135
|
setEnableWallets(enableWallets: OptionsControllerState['enableWallets']): void;
|
|
128
136
|
setHasMultipleAddresses(hasMultipleAddresses: OptionsControllerState['hasMultipleAddresses']): void;
|
|
@@ -2,12 +2,13 @@ export interface SnackControllerState {
|
|
|
2
2
|
message: string;
|
|
3
3
|
variant: 'error' | 'success' | 'loading';
|
|
4
4
|
open: boolean;
|
|
5
|
+
durationMs: number;
|
|
5
6
|
}
|
|
6
7
|
export declare const SnackController: {
|
|
7
8
|
state: SnackControllerState;
|
|
8
9
|
subscribeKey<K extends keyof SnackControllerState>(key: K, callback: (value: SnackControllerState[K]) => void): () => void;
|
|
9
|
-
showLoading(message: SnackControllerState['message']): void;
|
|
10
|
-
showSuccess(message: SnackControllerState['message']): void;
|
|
11
|
-
showError(message: unknown): void;
|
|
10
|
+
showLoading(message: SnackControllerState['message'], durationMs?: SnackControllerState['durationMs']): void;
|
|
11
|
+
showSuccess(message: SnackControllerState['message'], durationMs?: SnackControllerState['durationMs']): void;
|
|
12
|
+
showError(message: unknown, durationMs?: SnackControllerState['durationMs']): void;
|
|
12
13
|
hide(): void;
|
|
13
14
|
};
|
|
@@ -19,8 +19,10 @@ export declare const CoreHelperUtil: {
|
|
|
19
19
|
isHttpUrl(url: string): boolean;
|
|
20
20
|
formatNativeUrl(appUrl: string, wcUri: string): LinkingRecord;
|
|
21
21
|
formatUniversalUrl(appUrl: string, wcUri: string): LinkingRecord;
|
|
22
|
+
getOpenTargetForPlatform(target: string): string;
|
|
22
23
|
openHref(href: string, target: '_blank' | '_self' | 'popupWindow', features?: string): void;
|
|
23
24
|
returnOpenHref(href: string, target: '_blank' | '_self' | 'popupWindow', features?: string): Window | null;
|
|
25
|
+
isTelegram(): boolean;
|
|
24
26
|
preloadImage(src: string): Promise<unknown>;
|
|
25
27
|
formatBalance(balance: string | undefined, symbol: string | undefined): string;
|
|
26
28
|
formatBalance2(balance: string | undefined, symbol: string | undefined): {
|
|
@@ -88,8 +88,9 @@ export interface ApiGetWalletsResponse {
|
|
|
88
88
|
data: WcWallet[];
|
|
89
89
|
count: number;
|
|
90
90
|
}
|
|
91
|
-
export interface
|
|
91
|
+
export interface ApiGetProjectConfigResponse {
|
|
92
92
|
isAnalyticsEnabled: boolean;
|
|
93
|
+
isAppKitAuthEnabled: boolean;
|
|
93
94
|
}
|
|
94
95
|
export type ThemeMode = 'dark' | 'light';
|
|
95
96
|
export interface ThemeVariables {
|
|
@@ -571,6 +572,15 @@ export type Event = {
|
|
|
571
572
|
token: string;
|
|
572
573
|
amount: number;
|
|
573
574
|
};
|
|
575
|
+
} | {
|
|
576
|
+
type: 'track';
|
|
577
|
+
event: 'CONNECT_PROXY_ERROR';
|
|
578
|
+
properties: {
|
|
579
|
+
message: string;
|
|
580
|
+
uri: string;
|
|
581
|
+
mobile_link: string;
|
|
582
|
+
name: string;
|
|
583
|
+
};
|
|
574
584
|
};
|
|
575
585
|
export type DestinationWallet = {
|
|
576
586
|
address: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6-0e6050d7a.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/esm/exports/index.js",
|
|
6
6
|
"types": "./dist/types/exports/index.d.ts",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@walletconnect/universal-provider": "2.
|
|
24
|
+
"@walletconnect/universal-provider": "2.17.0",
|
|
25
25
|
"valtio": "1.11.2",
|
|
26
|
-
"@reown/appkit-common": "1.0.
|
|
27
|
-
"@reown/appkit-wallet": "1.0.
|
|
26
|
+
"@reown/appkit-common": "1.0.6-0e6050d7a.1",
|
|
27
|
+
"@reown/appkit-wallet": "1.0.6-0e6050d7a.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"vitest": "2.0.5",
|