@reown/appkit-core 1.5.3 → 1.5.4-rc.2.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 +1 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/src/controllers/AccountController.js +2 -2
- package/dist/esm/src/controllers/AccountController.js.map +1 -1
- package/dist/esm/src/controllers/ChainController.js +16 -8
- package/dist/esm/src/controllers/ChainController.js.map +1 -1
- package/dist/esm/src/controllers/EventsController.js.map +1 -1
- package/dist/esm/src/controllers/ModalController.js +13 -1
- package/dist/esm/src/controllers/ModalController.js.map +1 -1
- package/dist/esm/src/controllers/OptionsController.js +36 -9
- package/dist/esm/src/controllers/OptionsController.js.map +1 -1
- package/dist/esm/src/controllers/RouterController.js.map +1 -1
- package/dist/esm/src/controllers/SnackController.js +18 -7
- package/dist/esm/src/controllers/SnackController.js.map +1 -1
- package/dist/esm/src/controllers/SwapController.js +17 -4
- package/dist/esm/src/controllers/SwapController.js.map +1 -1
- package/dist/esm/src/utils/ConstantsUtil.js +15 -2
- package/dist/esm/src/utils/ConstantsUtil.js.map +1 -1
- package/dist/esm/src/utils/CoreHelperUtil.js +15 -0
- package/dist/esm/src/utils/CoreHelperUtil.js.map +1 -1
- package/dist/esm/src/utils/SIWXUtil.js +5 -1
- package/dist/esm/src/utils/SIWXUtil.js.map +1 -1
- package/dist/esm/src/utils/StorageUtil.js +67 -13
- package/dist/esm/src/utils/StorageUtil.js.map +1 -1
- package/dist/esm/tests/controllers/AccountController.test.js +1 -1
- package/dist/esm/tests/controllers/AccountController.test.js.map +1 -1
- package/dist/esm/tests/controllers/ApiController.test.js +1 -1
- package/dist/esm/tests/controllers/ApiController.test.js.map +1 -1
- package/dist/esm/tests/controllers/ChainController.test.js +39 -10
- package/dist/esm/tests/controllers/ChainController.test.js.map +1 -1
- package/dist/esm/tests/controllers/ConnectionController.test.js +3 -3
- package/dist/esm/tests/controllers/ConnectionController.test.js.map +1 -1
- package/dist/esm/tests/controllers/EnsController.test.js +1 -1
- package/dist/esm/tests/controllers/EnsController.test.js.map +1 -1
- package/dist/esm/tests/controllers/SnackController.test.js +35 -4
- package/dist/esm/tests/controllers/SnackController.test.js.map +1 -1
- package/dist/esm/tests/controllers/SwapController.test.js +1 -1
- package/dist/esm/tests/controllers/SwapController.test.js.map +1 -1
- package/dist/esm/tests/utils/CoreHelperUtil.test.js +27 -0
- package/dist/esm/tests/utils/CoreHelperUtil.test.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/exports/index.d.ts +1 -0
- package/dist/types/exports/vue.d.ts +1 -1
- package/dist/types/src/controllers/AccountController.d.ts +2 -2
- package/dist/types/src/controllers/ChainController.d.ts +1 -1
- package/dist/types/src/controllers/OptionsController.d.ts +17 -1
- package/dist/types/src/controllers/RouterController.d.ts +1 -1
- package/dist/types/src/controllers/SnackController.d.ts +10 -6
- package/dist/types/src/controllers/ThemeController.d.ts +1 -0
- package/dist/types/src/utils/ConstantsUtil.d.ts +18 -2
- package/dist/types/src/utils/CoreHelperUtil.d.ts +6 -3
- package/dist/types/src/utils/OptionsUtil.d.ts +1 -1
- package/dist/types/src/utils/StorageUtil.d.ts +13 -3
- package/dist/types/src/utils/TypeUtil.d.ts +91 -6
- package/package.json +3 -3
|
@@ -46,5 +46,6 @@ export { StorageUtil } from '../src/utils/StorageUtil.js';
|
|
|
46
46
|
export { RouterUtil } from '../src/utils/RouterUtil.js';
|
|
47
47
|
export { OptionsUtil } from '../src/utils/OptionsUtil.js';
|
|
48
48
|
export { SIWXUtil } from '../src/utils/SIWXUtil.js';
|
|
49
|
+
export { FetchUtil } from '../src/utils/FetchUtil.js';
|
|
49
50
|
export type * from '../src/utils/TypeUtil.js';
|
|
50
51
|
export type * from '../src/utils/SIWXUtil.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function useAppKitAccount(): import("vue").Ref<{
|
|
2
2
|
address: string | null;
|
|
3
3
|
caipAddress: `eip155:${string}:${string}` | `solana:${string}:${string}` | `polkadot:${string}:${string}` | `bip122:${string}:${string}` | null;
|
|
4
|
-
status: "
|
|
4
|
+
status: "connected" | "disconnected" | "connecting" | "reconnecting" | null;
|
|
5
5
|
isConnected: boolean;
|
|
6
6
|
}>;
|
|
7
7
|
export declare function useDisconnect(): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountType, CombinedProvider, ConnectedWalletInfo, Provider, SocialProvider } from '../utils/TypeUtil.js';
|
|
1
|
+
import type { AccountType, AccountTypeMap, CombinedProvider, ConnectedWalletInfo, Provider, SocialProvider } from '../utils/TypeUtil.js';
|
|
2
2
|
import type { CaipAddress, ChainNamespace } from '@reown/appkit-common';
|
|
3
3
|
import type { Balance } from '@reown/appkit-common';
|
|
4
4
|
import type { W3mFrameTypes } from '@reown/appkit-wallet';
|
|
@@ -43,7 +43,7 @@ export declare const AccountController: {
|
|
|
43
43
|
setCurrentTab(currentTab: AccountControllerState['currentTab']): void;
|
|
44
44
|
setTokenBalance(tokenBalance: AccountControllerState['tokenBalance'], chain: ChainNamespace | undefined): void;
|
|
45
45
|
setShouldUpdateToAddress(address: string, chain: ChainNamespace | undefined): void;
|
|
46
|
-
setAllAccounts(accounts:
|
|
46
|
+
setAllAccounts<N extends ChainNamespace>(accounts: AccountTypeMap[N][], namespace: N): void;
|
|
47
47
|
addAddressLabel(address: string, label: string, chain: ChainNamespace | undefined): void;
|
|
48
48
|
removeAddressLabel(address: string, chain: ChainNamespace | undefined): void;
|
|
49
49
|
setConnectedWalletInfo(connectedWalletInfo: AccountControllerState['connectedWalletInfo'], chain: ChainNamespace): void;
|
|
@@ -15,7 +15,7 @@ export declare const ChainController: {
|
|
|
15
15
|
subscribe(callback: (value: ChainControllerState) => void): () => void;
|
|
16
16
|
subscribeKey<K extends keyof ChainControllerState>(key: K, callback: (value: ChainControllerState[K]) => void): () => void;
|
|
17
17
|
subscribeChainProp<K_1 extends keyof ChainAdapter>(property: K_1, callback: (value: ChainAdapter[K_1] | undefined) => void, chain?: ChainNamespace): () => void;
|
|
18
|
-
initialize(adapters: ChainAdapter[]): void;
|
|
18
|
+
initialize(adapters: ChainAdapter[], caipNetworks: CaipNetwork[] | undefined): void;
|
|
19
19
|
setAdapterNetworkState(chain: ChainNamespace, props: Partial<AdapterNetworkState>): void;
|
|
20
20
|
setChainAccountData(chain: ChainNamespace | undefined, accountProps: Partial<AccountControllerState>, _unknown?: boolean): void;
|
|
21
21
|
setAccountProp(prop: keyof AccountControllerState, value: AccountControllerState[keyof AccountControllerState], chain: ChainNamespace | undefined, replaceState?: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomWallet, Features, Metadata, ProjectId, SdkVersion, Tokens } from '../utils/TypeUtil.js';
|
|
1
|
+
import type { ConnectMethod, CustomWallet, Features, Metadata, ProjectId, SdkVersion, SocialProvider, Tokens, WalletFeature } from '../utils/TypeUtil.js';
|
|
2
2
|
import type { SIWXConfig } from '../utils/SIWXUtil.js';
|
|
3
3
|
export interface OptionsControllerStatePublic {
|
|
4
4
|
/**
|
|
@@ -88,6 +88,11 @@ export interface OptionsControllerStatePublic {
|
|
|
88
88
|
* @default true
|
|
89
89
|
*/
|
|
90
90
|
enableWalletConnect?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Enable or disable the wallet guide footer in AppKit if you have email or social login configured.
|
|
93
|
+
* @default true
|
|
94
|
+
*/
|
|
95
|
+
enableWalletGuide?: boolean;
|
|
91
96
|
/**
|
|
92
97
|
* Enable or disable debug mode in your AppKit. This is useful if you want to see UI alerts when debugging.
|
|
93
98
|
* @default false
|
|
@@ -105,6 +110,11 @@ export interface OptionsControllerStatePublic {
|
|
|
105
110
|
* @default undefined
|
|
106
111
|
*/
|
|
107
112
|
siwx?: SIWXConfig;
|
|
113
|
+
/**
|
|
114
|
+
* Renders the AppKit to DOM instead of the default modal.
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
enableEmbedded?: boolean;
|
|
108
118
|
}
|
|
109
119
|
export interface OptionsControllerStateInternal {
|
|
110
120
|
sdkType: 'appkit';
|
|
@@ -137,8 +147,14 @@ export declare const OptionsController: {
|
|
|
137
147
|
setEIP6963Enabled(enableEIP6963: OptionsControllerState['enableEIP6963']): void;
|
|
138
148
|
setDebug(debug: OptionsControllerState['debug']): void;
|
|
139
149
|
setEnableWalletConnect(enableWalletConnect: OptionsControllerState['enableWalletConnect']): void;
|
|
150
|
+
setEnableWalletGuide(enableWalletGuide: OptionsControllerState['enableWalletGuide']): void;
|
|
140
151
|
setEnableWallets(enableWallets: OptionsControllerState['enableWallets']): void;
|
|
141
152
|
setHasMultipleAddresses(hasMultipleAddresses: OptionsControllerState['hasMultipleAddresses']): void;
|
|
142
153
|
setSIWX(siwx: OptionsControllerState['siwx']): void;
|
|
154
|
+
setConnectMethodsOrder(connectMethodsOrder: ConnectMethod[]): void;
|
|
155
|
+
setWalletFeaturesOrder(walletFeaturesOrder: WalletFeature[]): void;
|
|
156
|
+
setSocialsOrder(socialsOrder: SocialProvider[]): void;
|
|
157
|
+
setCollapseWallets(collapseWallets: boolean): void;
|
|
158
|
+
setEnableEmbedded(enableEmbedded: OptionsControllerState['enableEmbedded']): void;
|
|
143
159
|
};
|
|
144
160
|
export {};
|
|
@@ -24,7 +24,7 @@ type TransactionAction = {
|
|
|
24
24
|
onCancel?: () => void;
|
|
25
25
|
};
|
|
26
26
|
export interface RouterControllerState {
|
|
27
|
-
view: 'Account' | 'AccountSettings' | 'AllWallets' | 'ApproveTransaction' | 'BuyInProgress' | 'WalletCompatibleNetworks' | 'ChooseAccountName' | 'Connect' | 'Create' | 'ConnectingExternal' | 'ConnectingFarcaster' | 'ConnectingWalletConnect' | 'ConnectingSiwe' | 'ConnectingSocial' | 'ConnectSocials' | 'ConnectWallets' | 'Downloads' | 'EmailVerifyOtp' | 'EmailVerifyDevice' | 'GetWallet' | 'Networks' | 'OnRampActivity' | 'OnRampFiatSelect' | 'OnRampProviders' | 'OnRampTokenSelect' | 'Profile' | 'RegisterAccountName' | 'RegisterAccountNameSuccess' | 'SwitchNetwork' | 'SwitchAddress' | 'Transactions' | 'UnsupportedChain' | 'UpdateEmailWallet' | 'UpdateEmailPrimaryOtp' | 'UpdateEmailSecondaryOtp' | 'UpgradeEmailWallet' | '
|
|
27
|
+
view: 'Account' | 'AccountSettings' | 'AllWallets' | 'ApproveTransaction' | 'BuyInProgress' | 'WalletCompatibleNetworks' | 'ChooseAccountName' | 'Connect' | 'Create' | 'ConnectingExternal' | 'ConnectingFarcaster' | 'ConnectingWalletConnect' | 'ConnectingSiwe' | 'ConnectingSocial' | 'ConnectSocials' | 'ConnectWallets' | 'Downloads' | 'EmailVerifyOtp' | 'EmailVerifyDevice' | 'GetWallet' | 'Networks' | 'OnRampActivity' | 'OnRampFiatSelect' | 'OnRampProviders' | 'OnRampTokenSelect' | 'Profile' | 'RegisterAccountName' | 'RegisterAccountNameSuccess' | 'SwitchNetwork' | 'SwitchAddress' | 'Transactions' | 'UnsupportedChain' | 'UpdateEmailWallet' | 'UpdateEmailPrimaryOtp' | 'UpdateEmailSecondaryOtp' | 'UpgradeEmailWallet' | 'WalletReceive' | 'WalletSend' | 'WalletSendPreview' | 'WalletSendSelectToken' | 'WhatIsANetwork' | 'WhatIsAWallet' | 'WhatIsABuy' | 'Swap' | 'SwapSelectToken' | 'SwapPreview' | 'ConnectingMultiChain' | 'SwitchActiveChain' | 'SmartSessionCreated' | 'SmartSessionList' | 'SIWXSignMessage';
|
|
28
28
|
history: RouterControllerState['view'][];
|
|
29
29
|
data?: {
|
|
30
30
|
connector?: Connector;
|
|
@@ -6,18 +6,22 @@ export interface SnackControllerState {
|
|
|
6
6
|
icon: string;
|
|
7
7
|
};
|
|
8
8
|
open: boolean;
|
|
9
|
+
autoClose: boolean;
|
|
9
10
|
}
|
|
11
|
+
export type SnackControllerShowOptions = {
|
|
12
|
+
autoClose?: boolean;
|
|
13
|
+
svg?: SnackControllerState['svg'];
|
|
14
|
+
variant?: SnackControllerState['variant'];
|
|
15
|
+
};
|
|
10
16
|
export declare const SnackController: {
|
|
11
17
|
state: SnackControllerState;
|
|
12
18
|
subscribeKey<K extends keyof SnackControllerState>(key: K, callback: (value: SnackControllerState[K]) => void): () => void;
|
|
13
|
-
showLoading(message: SnackControllerState['message']): void;
|
|
19
|
+
showLoading(message: SnackControllerState['message'], options?: SnackControllerShowOptions): void;
|
|
14
20
|
showSuccess(message: SnackControllerState['message']): void;
|
|
15
21
|
showSvg(message: SnackControllerState['message'], svg: NonNullable<SnackControllerState['svg']>): void;
|
|
16
22
|
showError(message: unknown): void;
|
|
17
23
|
hide(): void;
|
|
18
|
-
_showMessage({ message, svg, variant }: {
|
|
19
|
-
message:
|
|
20
|
-
|
|
21
|
-
variant?: "error" | "success" | "loading" | undefined;
|
|
22
|
-
}): void;
|
|
24
|
+
_showMessage({ message, svg, variant, autoClose }: {
|
|
25
|
+
message: string;
|
|
26
|
+
} & SnackControllerShowOptions): void;
|
|
23
27
|
};
|
|
@@ -20,6 +20,7 @@ export declare const ThemeController: {
|
|
|
20
20
|
readonly '--w3m-font-size-master'?: string | undefined;
|
|
21
21
|
readonly '--w3m-border-radius-master'?: string | undefined;
|
|
22
22
|
readonly '--w3m-z-index'?: number | undefined;
|
|
23
|
+
readonly '--w3m-qr-color'?: string | undefined;
|
|
23
24
|
};
|
|
24
25
|
readonly w3mThemeVariables: {
|
|
25
26
|
readonly '--w3m-accent': string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SocialProvider } from './TypeUtil.js';
|
|
2
2
|
import type { ChainNamespace } from '@reown/appkit-common';
|
|
3
3
|
export declare const ONRAMP_PROVIDERS: {
|
|
4
4
|
label: string;
|
|
@@ -49,5 +49,21 @@ export declare const ConstantsUtil: {
|
|
|
49
49
|
CONNECT_LABELS: {
|
|
50
50
|
MOBILE: string;
|
|
51
51
|
};
|
|
52
|
-
DEFAULT_FEATURES:
|
|
52
|
+
DEFAULT_FEATURES: {
|
|
53
|
+
swaps: true;
|
|
54
|
+
onramp: true;
|
|
55
|
+
receive: true;
|
|
56
|
+
send: true;
|
|
57
|
+
email: true;
|
|
58
|
+
emailShowWallets: true;
|
|
59
|
+
socials: SocialProvider[];
|
|
60
|
+
history: true;
|
|
61
|
+
analytics: true;
|
|
62
|
+
allWallets: true;
|
|
63
|
+
legalCheckbox: false;
|
|
64
|
+
smartSessions: false;
|
|
65
|
+
collapseWallets: false;
|
|
66
|
+
connectMethodsOrder: ("email" | "social" | "wallet")[];
|
|
67
|
+
walletFeaturesOrder: ("swaps" | "send" | "receive" | "onramp")[];
|
|
68
|
+
};
|
|
53
69
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AppKitSdkVersion, Balance, ChainNamespace } from '@reown/appkit-common';
|
|
2
2
|
import type { CaipAddress, CaipNetwork } from '@reown/appkit-common';
|
|
3
|
-
import type { ChainAdapter, LinkingRecord } from './TypeUtil.js';
|
|
3
|
+
import type { AccountTypeMap, ChainAdapter, LinkingRecord, NamespaceTypeMap } from './TypeUtil.js';
|
|
4
4
|
type SDKFramework = 'html' | 'react' | 'vue';
|
|
5
|
+
type OpenTarget = '_blank' | '_self' | 'popupWindow' | '_top';
|
|
5
6
|
export declare const CoreHelperUtil: {
|
|
6
7
|
isMobile(): boolean;
|
|
7
8
|
checkCaipNetwork(network: CaipNetwork | undefined, networkName?: string): boolean | undefined;
|
|
@@ -11,6 +12,7 @@ export declare const CoreHelperUtil: {
|
|
|
11
12
|
isPairingExpired(expiry?: number): boolean;
|
|
12
13
|
isAllowedRetry(lastRetry: number, differenceMs?: number): boolean;
|
|
13
14
|
copyToClopboard(text: string): void;
|
|
15
|
+
isIframe(): boolean;
|
|
14
16
|
getPairingExpiry(): number;
|
|
15
17
|
getNetworkId(caipAddress: CaipAddress | undefined): string | undefined;
|
|
16
18
|
getPlainAddress(caipAddress: CaipAddress | undefined): string | undefined;
|
|
@@ -20,8 +22,8 @@ export declare const CoreHelperUtil: {
|
|
|
20
22
|
formatNativeUrl(appUrl: string, wcUri: string): LinkingRecord;
|
|
21
23
|
formatUniversalUrl(appUrl: string, wcUri: string): LinkingRecord;
|
|
22
24
|
getOpenTargetForPlatform(target: string): string;
|
|
23
|
-
openHref(href: string, target:
|
|
24
|
-
returnOpenHref(href: string, target:
|
|
25
|
+
openHref(href: string, target: OpenTarget, features?: string): void;
|
|
26
|
+
returnOpenHref(href: string, target: OpenTarget, features?: string): Window | null;
|
|
25
27
|
isTelegram(): boolean;
|
|
26
28
|
preloadImage(src: string): Promise<unknown>;
|
|
27
29
|
formatBalance(balance: string | undefined, symbol: string | undefined): string;
|
|
@@ -44,5 +46,6 @@ export declare const CoreHelperUtil: {
|
|
|
44
46
|
isAddress(address: string, chain?: ChainNamespace): boolean;
|
|
45
47
|
uniqueBy<T>(arr: T[], key: keyof T): T[];
|
|
46
48
|
generateSdkVersion(adapters: ChainAdapter[], platform: SDKFramework, version: string): AppKitSdkVersion;
|
|
49
|
+
createAccount<N extends ChainNamespace>(namespace: N, address: string, type: NamespaceTypeMap[N]): AccountTypeMap[N];
|
|
47
50
|
};
|
|
48
51
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Features, FeaturesKeys } from './TypeUtil.js';
|
|
2
2
|
export declare const OptionsUtil: {
|
|
3
|
-
getFeatureValue(key: FeaturesKeys, features?: Features): boolean | import("./TypeUtil.js").
|
|
3
|
+
getFeatureValue(key: FeaturesKeys, features?: Features): boolean | import("./TypeUtil.js").SocialProvider[] | import("./TypeUtil.js").ConnectMethod[] | import("./TypeUtil.js").WalletFeature[] | undefined;
|
|
4
4
|
};
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import { type ChainNamespace } from '@reown/appkit-common';
|
|
1
|
+
import { type CaipNetworkId, type ChainNamespace } from '@reown/appkit-common';
|
|
2
2
|
import type { WcWallet, ConnectorType, SocialProvider, ConnectionStatus } from './TypeUtil.js';
|
|
3
3
|
export declare const StorageUtil: {
|
|
4
|
+
getActiveNetworkProps(): {
|
|
5
|
+
namespace: ChainNamespace | undefined;
|
|
6
|
+
caipNetworkId: string | undefined;
|
|
7
|
+
chainId: string | undefined;
|
|
8
|
+
};
|
|
4
9
|
setWalletConnectDeepLink({ name, href }: {
|
|
5
10
|
href: string;
|
|
6
11
|
name: string;
|
|
7
12
|
}): void;
|
|
8
13
|
getWalletConnectDeepLink(): any;
|
|
9
14
|
deleteWalletConnectDeepLink(): void;
|
|
15
|
+
setActiveNamespace(namespace: ChainNamespace): void;
|
|
16
|
+
setActiveCaipNetworkId(caipNetworkId: CaipNetworkId): void;
|
|
17
|
+
getActiveCaipNetworkId(): string | undefined;
|
|
18
|
+
deleteActiveCaipNetworkId(): void;
|
|
19
|
+
deleteConnectedConnector(): void;
|
|
10
20
|
setAppKitRecent(wallet: WcWallet): void;
|
|
11
21
|
getRecentWallets(): WcWallet[];
|
|
12
22
|
setConnectedConnector(connectorType: ConnectorType): void;
|
|
13
|
-
|
|
23
|
+
getActiveNamespace(): ChainNamespace | undefined;
|
|
14
24
|
getConnectedConnector(): ConnectorType | undefined;
|
|
15
25
|
setConnectedSocialProvider(socialProvider: SocialProvider): void;
|
|
16
26
|
getConnectedSocialProvider(): string | undefined;
|
|
17
27
|
getConnectedSocialUsername(): string | undefined;
|
|
18
|
-
|
|
28
|
+
getStoredActiveCaipNetworkId(): string | undefined;
|
|
19
29
|
setConnectionStatus(status: ConnectionStatus): void;
|
|
20
30
|
getConnectionStatus(): ConnectionStatus | undefined;
|
|
21
31
|
};
|
|
@@ -6,6 +6,28 @@ import type { OnRampProviderOption } from '../controllers/OnRampController.js';
|
|
|
6
6
|
import type { ConstantsUtil } from './ConstantsUtil.js';
|
|
7
7
|
import type { ReownName } from '../controllers/EnsController.js';
|
|
8
8
|
import type UniversalProvider from '@walletconnect/universal-provider';
|
|
9
|
+
type InitializeAppKitConfigs = {
|
|
10
|
+
showWallets?: boolean;
|
|
11
|
+
siweConfig?: {
|
|
12
|
+
options: {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
nonceRefetchIntervalMs?: number;
|
|
15
|
+
sessionRefetchIntervalMs?: number;
|
|
16
|
+
signOutOnDisconnect?: boolean;
|
|
17
|
+
signOutOnAccountChange?: boolean;
|
|
18
|
+
signOutOnNetworkChange?: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
themeMode?: 'dark' | 'light';
|
|
22
|
+
themeVariables?: ThemeVariables;
|
|
23
|
+
allowUnsupportedChain?: boolean;
|
|
24
|
+
networks: (string | number)[];
|
|
25
|
+
defaultNetwork?: AppKitNetwork;
|
|
26
|
+
chainImages?: Record<number | string, string>;
|
|
27
|
+
connectorImages?: Record<string, string>;
|
|
28
|
+
coinbasePreference?: 'all' | 'smartWalletOnly' | 'eoaOnly';
|
|
29
|
+
metadata?: Metadata;
|
|
30
|
+
};
|
|
9
31
|
export type CaipNetworkCoinbaseNetwork = 'Ethereum' | 'Arbitrum One' | 'Polygon' | 'Avalanche' | 'OP Mainnet' | 'Celo';
|
|
10
32
|
export type ConnectedWalletInfo = {
|
|
11
33
|
name?: string;
|
|
@@ -102,6 +124,7 @@ export interface ThemeVariables {
|
|
|
102
124
|
'--w3m-font-size-master'?: string;
|
|
103
125
|
'--w3m-border-radius-master'?: string;
|
|
104
126
|
'--w3m-z-index'?: number;
|
|
127
|
+
'--w3m-qr-color'?: string;
|
|
105
128
|
}
|
|
106
129
|
export interface BlockchainApiIdentityRequest {
|
|
107
130
|
address: string;
|
|
@@ -406,6 +429,9 @@ export type Event = {
|
|
|
406
429
|
} | {
|
|
407
430
|
type: 'track';
|
|
408
431
|
event: 'EMAIL_VERIFICATION_CODE_FAIL';
|
|
432
|
+
properties: {
|
|
433
|
+
message: string;
|
|
434
|
+
};
|
|
409
435
|
} | {
|
|
410
436
|
type: 'track';
|
|
411
437
|
event: 'EMAIL_EDIT';
|
|
@@ -494,6 +520,18 @@ export type Event = {
|
|
|
494
520
|
swapToAmount: string;
|
|
495
521
|
message: string;
|
|
496
522
|
};
|
|
523
|
+
} | {
|
|
524
|
+
type: 'track';
|
|
525
|
+
event: 'SWAP_APPROVAL_ERROR';
|
|
526
|
+
properties: {
|
|
527
|
+
isSmartAccount: boolean;
|
|
528
|
+
network: string;
|
|
529
|
+
swapFromToken: string;
|
|
530
|
+
swapToToken: string;
|
|
531
|
+
swapFromAmount: string;
|
|
532
|
+
swapToAmount: string;
|
|
533
|
+
message: string;
|
|
534
|
+
};
|
|
497
535
|
} | {
|
|
498
536
|
type: 'track';
|
|
499
537
|
event: 'SOCIAL_LOGIN_STARTED';
|
|
@@ -602,6 +640,10 @@ export type Event = {
|
|
|
602
640
|
badge: string;
|
|
603
641
|
search: string;
|
|
604
642
|
};
|
|
643
|
+
} | {
|
|
644
|
+
type: 'track';
|
|
645
|
+
event: 'INITIALIZE';
|
|
646
|
+
properties: InitializeAppKitConfigs;
|
|
605
647
|
};
|
|
606
648
|
export type DestinationWallet = {
|
|
607
649
|
address: string;
|
|
@@ -654,10 +696,20 @@ export type GetQuoteArgs = {
|
|
|
654
696
|
amount: string;
|
|
655
697
|
network: string;
|
|
656
698
|
};
|
|
657
|
-
export type
|
|
658
|
-
|
|
659
|
-
|
|
699
|
+
export type NamespaceTypeMap = {
|
|
700
|
+
eip155: 'eoa' | 'smartAccount';
|
|
701
|
+
solana: 'eoa';
|
|
702
|
+
bip122: 'payment' | 'ordinal' | 'stx';
|
|
703
|
+
polkadot: 'eoa';
|
|
704
|
+
};
|
|
705
|
+
export type AccountTypeMap = {
|
|
706
|
+
[K in ChainNamespace]: {
|
|
707
|
+
namespace: K;
|
|
708
|
+
address: string;
|
|
709
|
+
type: NamespaceTypeMap[K];
|
|
710
|
+
};
|
|
660
711
|
};
|
|
712
|
+
export type AccountType = AccountTypeMap[ChainNamespace];
|
|
661
713
|
export type SendTransactionArgs = {
|
|
662
714
|
chainNamespace?: undefined | 'eip155';
|
|
663
715
|
to: `0x${string}`;
|
|
@@ -764,7 +816,8 @@ export interface Provider {
|
|
|
764
816
|
}
|
|
765
817
|
export type CombinedProvider = W3mFrameProvider & Provider;
|
|
766
818
|
export type CoinbasePaySDKChainNameValues = keyof typeof ConstantsUtil.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP;
|
|
767
|
-
export type
|
|
819
|
+
export type WalletFeature = 'swaps' | 'send' | 'receive' | 'onramp';
|
|
820
|
+
export type ConnectMethod = 'email' | 'social' | 'wallet';
|
|
768
821
|
export type Features = {
|
|
769
822
|
/**
|
|
770
823
|
* @description Enable or disable the swaps feature. Enabled by default.
|
|
@@ -776,6 +829,17 @@ export type Features = {
|
|
|
776
829
|
* @type {boolean}
|
|
777
830
|
*/
|
|
778
831
|
onramp?: boolean;
|
|
832
|
+
/**
|
|
833
|
+
* @description Enable or disable the receive feature. Enabled by default.
|
|
834
|
+
* This feature is only visible when connected with email/social. It's not possible to configure when connected with wallet, which is enabled by default.
|
|
835
|
+
* @type {boolean}
|
|
836
|
+
*/
|
|
837
|
+
receive?: boolean;
|
|
838
|
+
/**
|
|
839
|
+
* @description Enable or disable the send feature. Enabled by default.
|
|
840
|
+
* @type {boolean}
|
|
841
|
+
*/
|
|
842
|
+
send?: boolean;
|
|
779
843
|
/**
|
|
780
844
|
* @description Enable or disable the email feature. Enabled by default.
|
|
781
845
|
* @type {boolean}
|
|
@@ -783,14 +847,15 @@ export type Features = {
|
|
|
783
847
|
email?: boolean;
|
|
784
848
|
/**
|
|
785
849
|
* @description Show or hide the regular wallet options when email is enabled. Enabled by default.
|
|
850
|
+
* @deprecated - This property will be removed in the next major release. Please use `features.collapseWallets` instead.
|
|
786
851
|
* @type {boolean}
|
|
787
852
|
*/
|
|
788
853
|
emailShowWallets?: boolean;
|
|
789
854
|
/**
|
|
790
855
|
* @description Enable or disable the socials feature. Enabled by default.
|
|
791
|
-
* @type {
|
|
856
|
+
* @type {SocialProvider[]}
|
|
792
857
|
*/
|
|
793
|
-
socials?:
|
|
858
|
+
socials?: SocialProvider[] | false;
|
|
794
859
|
/**
|
|
795
860
|
* @description Enable or disable the history feature. Enabled by default.
|
|
796
861
|
* @type {boolean}
|
|
@@ -816,6 +881,25 @@ export type Features = {
|
|
|
816
881
|
* @default false
|
|
817
882
|
*/
|
|
818
883
|
legalCheckbox?: boolean;
|
|
884
|
+
/**
|
|
885
|
+
* @description The order of the connect methods. This is experimental and subject to change.
|
|
886
|
+
* @default ['email', 'social', 'wallet']
|
|
887
|
+
* @type {('email' | 'social' | 'wallet')[]}
|
|
888
|
+
*/
|
|
889
|
+
connectMethodsOrder?: ConnectMethod[];
|
|
890
|
+
/**
|
|
891
|
+
* @
|
|
892
|
+
* @description The order of the wallet features. This is experimental and subject to change.
|
|
893
|
+
* @default ['receive' | 'onramp' | 'swaps' | 'send']
|
|
894
|
+
* @type {('receive' | 'onramp' | 'swaps' | 'send')[]}
|
|
895
|
+
*/
|
|
896
|
+
walletFeaturesOrder?: WalletFeature[];
|
|
897
|
+
/**
|
|
898
|
+
* @description Enable or disable the collapse wallets as a single "Continue with wallet" button for simple UI in connect page.
|
|
899
|
+
* This can be activated when only have another connect method like email or social activated along with wallets.
|
|
900
|
+
* @default false
|
|
901
|
+
*/
|
|
902
|
+
collapseWallets?: boolean;
|
|
819
903
|
};
|
|
820
904
|
export type FeaturesKeys = keyof Features;
|
|
821
905
|
export type WalletGuideType = 'get-started' | 'explore';
|
|
@@ -833,3 +917,4 @@ export type UseAppKitNetworkReturn = {
|
|
|
833
917
|
};
|
|
834
918
|
export type BadgeType = 'none' | 'certified';
|
|
835
919
|
export type ConnectionStatus = 'connected' | 'disconnected' | 'connecting' | 'reconnecting';
|
|
920
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4-rc.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/esm/exports/index.js",
|
|
6
6
|
"types": "./dist/types/exports/index.d.ts",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@walletconnect/universal-provider": "2.17.0",
|
|
40
40
|
"valtio": "1.11.2",
|
|
41
41
|
"viem": "2.x",
|
|
42
|
-
"@reown/appkit-common": "1.5.
|
|
43
|
-
"@reown/appkit-wallet": "1.5.
|
|
42
|
+
"@reown/appkit-common": "1.5.4-rc.2.0",
|
|
43
|
+
"@reown/appkit-wallet": "1.5.4-rc.2.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {},
|
|
46
46
|
"devDependencies": {
|