@reown/appkit-core 1.6.8 → 1.6.9-venice.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/react.js +24 -14
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/vue.js +40 -44
- package/dist/esm/exports/vue.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 +34 -27
- package/dist/esm/src/controllers/ChainController.js.map +1 -1
- package/dist/esm/src/controllers/ConnectorController.js +2 -2
- package/dist/esm/src/controllers/ConnectorController.js.map +1 -1
- package/dist/esm/src/utils/ConnectorUtil.js +26 -0
- package/dist/esm/src/utils/ConnectorUtil.js.map +1 -0
- package/dist/esm/src/utils/DeeplinkUtil.js +2 -0
- package/dist/esm/src/utils/DeeplinkUtil.js.map +1 -0
- package/dist/esm/tests/hooks/react.test.js +69 -78
- package/dist/esm/tests/hooks/react.test.js.map +1 -1
- package/dist/esm/tests/hooks/vue.test.js +56 -0
- package/dist/esm/tests/hooks/vue.test.js.map +1 -0
- package/dist/esm/tests/mocks/ChainController.js +24 -0
- package/dist/esm/tests/mocks/ChainController.js.map +1 -0
- package/dist/esm/tests/mocks/useAppKitAccount.js +41 -0
- package/dist/esm/tests/mocks/useAppKitAccount.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/exports/react.d.ts +4 -1
- package/dist/types/exports/vue.d.ts +4 -1
- package/dist/types/src/controllers/AccountController.d.ts +1 -1
- package/dist/types/src/controllers/ChainController.d.ts +3 -2
- package/dist/types/src/controllers/ConnectorController.d.ts +1 -1
- package/dist/types/src/controllers/SendController.d.ts +49 -40
- package/dist/types/src/utils/ConnectorUtil.d.ts +4 -0
- package/dist/types/src/utils/DeeplinkUtil.d.ts +0 -0
- package/dist/types/src/utils/TypeUtil.d.ts +1 -22
- package/dist/types/tests/hooks/vue.test.d.ts +2 -0
- package/dist/types/tests/mocks/ChainController.d.ts +2 -0
- package/dist/types/tests/mocks/useAppKitAccount.d.ts +40 -0
- package/package.json +3 -3
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { ChainNamespace } from '@reown/appkit-common';
|
|
1
2
|
import type { UseAppKitAccountReturn, UseAppKitNetworkReturn } from '../src/utils/TypeUtil.js';
|
|
2
3
|
export declare function useAppKitNetworkCore(): Pick<UseAppKitNetworkReturn, 'caipNetwork' | 'chainId' | 'caipNetworkId'>;
|
|
3
|
-
export declare function useAppKitAccount(
|
|
4
|
+
export declare function useAppKitAccount(options?: {
|
|
5
|
+
namespace?: ChainNamespace;
|
|
6
|
+
}): UseAppKitAccountReturn;
|
|
4
7
|
export declare function useDisconnect(): {
|
|
5
8
|
disconnect: () => Promise<void>;
|
|
6
9
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
|
+
import type { ChainNamespace } from '@reown/appkit-common';
|
|
2
3
|
import type { UseAppKitAccountReturn } from '../src/utils/TypeUtil.js';
|
|
3
|
-
export declare function useAppKitAccount(
|
|
4
|
+
export declare function useAppKitAccount(options?: {
|
|
5
|
+
namespace?: ChainNamespace;
|
|
6
|
+
}): Ref<UseAppKitAccountReturn>;
|
|
4
7
|
export declare function useDisconnect(): {
|
|
5
8
|
disconnect: () => Promise<void>;
|
|
6
9
|
};
|
|
@@ -37,7 +37,7 @@ export declare const AccountController: {
|
|
|
37
37
|
setBalance(balance: AccountControllerState['balance'], balanceSymbol: AccountControllerState['balanceSymbol'], chain: ChainNamespace): void;
|
|
38
38
|
setProfileName(profileName: AccountControllerState['profileName'], chain: ChainNamespace): void;
|
|
39
39
|
setProfileImage(profileImage: AccountControllerState['profileImage'], chain?: ChainNamespace): void;
|
|
40
|
-
setUser(user: AccountControllerState['user']): void;
|
|
40
|
+
setUser(user: AccountControllerState['user'], chain: ChainNamespace | undefined): void;
|
|
41
41
|
setAddressExplorerUrl(explorerUrl: AccountControllerState['addressExplorerUrl'], chain: ChainNamespace | undefined): void;
|
|
42
42
|
setSmartAccountDeployed(isDeployed: boolean, chain: ChainNamespace | undefined): void;
|
|
43
43
|
setCurrentTab(currentTab: AccountControllerState['currentTab']): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CaipAddress, type CaipNetwork, type CaipNetworkId, type ChainNamespace } from '@reown/appkit-common';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AdapterNetworkState, ChainAdapter, NetworkControllerClient } from '../utils/TypeUtil.js';
|
|
3
3
|
import { type AccountControllerState } from './AccountController.js';
|
|
4
4
|
import { type ConnectionControllerClient } from './ConnectionController.js';
|
|
5
5
|
export type ChainControllerClients = {
|
|
@@ -37,7 +37,7 @@ export declare const ChainController: {
|
|
|
37
37
|
switchActiveNetwork(network: CaipNetwork): Promise<void>;
|
|
38
38
|
getNetworkControllerClient(chainNamespace?: ChainNamespace): NetworkControllerClient;
|
|
39
39
|
getConnectionControllerClient(_chain?: ChainNamespace): ConnectionControllerClient;
|
|
40
|
-
getAccountProp<K_2 extends keyof
|
|
40
|
+
getAccountProp<K_2 extends keyof AccountControllerState>(key: K_2, _chain?: ChainNamespace): AccountControllerState[K_2] | undefined;
|
|
41
41
|
getNetworkProp<K_3 extends keyof AdapterNetworkState>(key: K_3, namespace: ChainNamespace): AdapterNetworkState[K_3] | undefined;
|
|
42
42
|
getRequestedCaipNetworks(chainToFilter: ChainNamespace): CaipNetwork[];
|
|
43
43
|
getAllRequestedCaipNetworks(): CaipNetwork[];
|
|
@@ -59,4 +59,5 @@ export declare const ChainController: {
|
|
|
59
59
|
disconnect(): Promise<void>;
|
|
60
60
|
setIsSwitchingNamespace(isSwitchingNamespace: boolean): void;
|
|
61
61
|
getFirstCaipNetworkSupportsAuthConnector(): CaipNetwork | undefined;
|
|
62
|
+
getAccountDataByChainNamespace(chainNamespace?: ChainNamespace): AccountControllerState | undefined;
|
|
62
63
|
};
|
|
@@ -21,7 +21,7 @@ export declare const ConnectorController: {
|
|
|
21
21
|
getConnectorName(name: string | undefined): string | undefined;
|
|
22
22
|
getUniqueConnectorsByName(connectors: Connector[]): Connector[];
|
|
23
23
|
addConnector(connector: Connector | AuthConnector): void;
|
|
24
|
-
getAuthConnector(): AuthConnector | undefined;
|
|
24
|
+
getAuthConnector(chainNamespace?: ChainNamespace): AuthConnector | undefined;
|
|
25
25
|
getAnnouncedConnectorRdns(): (string | undefined)[];
|
|
26
26
|
getConnector(id: string, rdns?: string | null): ConnectorWithProviders | undefined;
|
|
27
27
|
syncIfAuthConnector(connector: Connector | AuthConnector): void;
|
|
@@ -1,47 +1,56 @@
|
|
|
1
|
-
import { type Balance } from '@reown/appkit-common'
|
|
1
|
+
import { type Balance } from '@reown/appkit-common'
|
|
2
|
+
|
|
2
3
|
export interface TxParams {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
receiverAddress: string
|
|
5
|
+
sendTokenAmount: number
|
|
6
|
+
gasPrice: bigint
|
|
7
|
+
decimals: string
|
|
7
8
|
}
|
|
8
9
|
export interface ContractWriteParams {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
receiverAddress: string
|
|
11
|
+
tokenAddress: string
|
|
12
|
+
sendTokenAmount: number
|
|
13
|
+
decimals: string
|
|
13
14
|
}
|
|
14
15
|
export interface SendControllerState {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
token?: Balance
|
|
17
|
+
sendTokenAmount?: number
|
|
18
|
+
receiverAddress?: string
|
|
19
|
+
receiverProfileName?: string
|
|
20
|
+
receiverProfileImageUrl?: string
|
|
21
|
+
gasPrice?: bigint
|
|
22
|
+
gasPriceInUSD?: number
|
|
23
|
+
networkBalanceInUSD?: string
|
|
24
|
+
loading: boolean
|
|
24
25
|
}
|
|
25
26
|
export declare const SendController: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
state: SendControllerState
|
|
28
|
+
subscribe(callback: (newState: SendControllerState) => void): () => void
|
|
29
|
+
subscribeKey<K extends keyof SendControllerState>(
|
|
30
|
+
key: K,
|
|
31
|
+
callback: (value: SendControllerState[K]) => void
|
|
32
|
+
): () => void
|
|
33
|
+
setToken(token: SendControllerState['token']): void
|
|
34
|
+
setTokenAmount(sendTokenAmount: SendControllerState['sendTokenAmount']): void
|
|
35
|
+
setReceiverAddress(receiverAddress: SendControllerState['receiverAddress']): void
|
|
36
|
+
setReceiverProfileImageUrl(
|
|
37
|
+
receiverProfileImageUrl: SendControllerState['receiverProfileImageUrl']
|
|
38
|
+
): void
|
|
39
|
+
setReceiverProfileName(receiverProfileName: SendControllerState['receiverProfileName']): void
|
|
40
|
+
setGasPrice(gasPrice: SendControllerState['gasPrice']): void
|
|
41
|
+
setGasPriceInUsd(gasPriceInUSD: SendControllerState['gasPriceInUSD']): void
|
|
42
|
+
setNetworkBalanceInUsd(networkBalanceInUSD: SendControllerState['networkBalanceInUSD']): void
|
|
43
|
+
setLoading(loading: SendControllerState['loading']): void
|
|
44
|
+
sendToken(): void
|
|
45
|
+
sendEvmToken(): void
|
|
46
|
+
fetchNetworkBalance(): Promise<void>
|
|
47
|
+
isInsufficientNetworkTokenForGas(
|
|
48
|
+
networkBalanceInUSD: string,
|
|
49
|
+
gasPriceInUSD: number | undefined
|
|
50
|
+
): boolean
|
|
51
|
+
hasInsufficientGasFunds(): boolean
|
|
52
|
+
sendNativeToken(params: TxParams): Promise<void>
|
|
53
|
+
sendERC20Token(params: ContractWriteParams): Promise<void>
|
|
54
|
+
sendSolanaToken(): void
|
|
55
|
+
resetSend(): void
|
|
56
|
+
}
|
|
File without changes
|
|
@@ -818,31 +818,10 @@ export type AdapterNetworkState = {
|
|
|
818
818
|
allowUnsupportedCaipNetwork?: boolean;
|
|
819
819
|
smartAccountEnabledNetworks?: number[];
|
|
820
820
|
};
|
|
821
|
-
export type AdapterAccountState = {
|
|
822
|
-
currentTab: number;
|
|
823
|
-
caipAddress?: CaipAddress;
|
|
824
|
-
address?: string;
|
|
825
|
-
addressLabels: Map<string, string>;
|
|
826
|
-
allAccounts: AccountType[];
|
|
827
|
-
balance?: string;
|
|
828
|
-
balanceSymbol?: string;
|
|
829
|
-
profileName?: string | null;
|
|
830
|
-
profileImage?: string | null;
|
|
831
|
-
addressExplorerUrl?: string;
|
|
832
|
-
smartAccountDeployed?: boolean;
|
|
833
|
-
socialProvider?: SocialProvider;
|
|
834
|
-
tokenBalance?: Balance[];
|
|
835
|
-
shouldUpdateToAddress?: string;
|
|
836
|
-
connectedWalletInfo?: ConnectedWalletInfo;
|
|
837
|
-
preferredAccountType?: W3mFrameTypes.AccountType;
|
|
838
|
-
socialWindow?: Window;
|
|
839
|
-
farcasterUrl?: string;
|
|
840
|
-
status?: 'reconnecting' | 'connected' | 'disconnected' | 'connecting';
|
|
841
|
-
};
|
|
842
821
|
export type ChainAdapter = {
|
|
843
822
|
connectionControllerClient?: ConnectionControllerClient;
|
|
844
823
|
networkControllerClient?: NetworkControllerClient;
|
|
845
|
-
accountState?:
|
|
824
|
+
accountState?: AccountControllerState;
|
|
846
825
|
networkState?: AdapterNetworkState;
|
|
847
826
|
namespace?: ChainNamespace;
|
|
848
827
|
caipNetworks?: CaipNetwork[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const defaultAccountState: {
|
|
2
|
+
allAccounts: never[];
|
|
3
|
+
address: undefined;
|
|
4
|
+
caipAddress: undefined;
|
|
5
|
+
isConnected: boolean;
|
|
6
|
+
status: undefined;
|
|
7
|
+
embeddedWalletInfo: undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare const connectedAccountState: {
|
|
10
|
+
allAccounts: never[];
|
|
11
|
+
address: string;
|
|
12
|
+
caipAddress: string;
|
|
13
|
+
isConnected: boolean;
|
|
14
|
+
status: string;
|
|
15
|
+
embeddedWalletInfo: undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare const disconnectedAccountState: {
|
|
18
|
+
allAccounts: never[];
|
|
19
|
+
address: undefined;
|
|
20
|
+
caipAddress: undefined;
|
|
21
|
+
isConnected: boolean;
|
|
22
|
+
status: string;
|
|
23
|
+
embeddedWalletInfo: undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const connectedWithEmbeddedWalletState: {
|
|
26
|
+
allAccounts: never[];
|
|
27
|
+
address: string;
|
|
28
|
+
caipAddress: string;
|
|
29
|
+
isConnected: boolean;
|
|
30
|
+
status: string;
|
|
31
|
+
embeddedWalletInfo: {
|
|
32
|
+
user: {
|
|
33
|
+
username: string;
|
|
34
|
+
email: string;
|
|
35
|
+
};
|
|
36
|
+
accountType: string;
|
|
37
|
+
authProvider: string;
|
|
38
|
+
isSmartAccountDeployed: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9-venice.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.18.0",
|
|
40
40
|
"valtio": "1.13.2",
|
|
41
41
|
"viem": ">=2.23",
|
|
42
|
-
"@reown/appkit-
|
|
43
|
-
"@reown/appkit-
|
|
42
|
+
"@reown/appkit-wallet": "1.6.9-venice.0",
|
|
43
|
+
"@reown/appkit-common": "1.6.9-venice.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {},
|
|
46
46
|
"devDependencies": {
|