@reown/appkit-core 1.3.0 → 1.3.2
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.map +1 -1
- package/dist/esm/exports/vue.js +12 -30
- package/dist/esm/exports/vue.js.map +1 -1
- package/dist/esm/src/controllers/ApiController.js +23 -16
- package/dist/esm/src/controllers/ApiController.js.map +1 -1
- package/dist/esm/src/controllers/ConnectionController.js +26 -25
- package/dist/esm/src/controllers/ConnectionController.js.map +1 -1
- package/dist/esm/src/controllers/SnackController.js +10 -4
- package/dist/esm/src/controllers/SnackController.js.map +1 -1
- package/dist/esm/src/controllers/SwapController.js +1 -0
- package/dist/esm/src/controllers/SwapController.js.map +1 -1
- package/dist/esm/src/utils/ConstantsUtil.js +1 -0
- package/dist/esm/src/utils/ConstantsUtil.js.map +1 -1
- package/dist/esm/tests/controllers/ApiController.test.js +16 -16
- package/dist/esm/tests/controllers/ApiController.test.js.map +1 -1
- package/dist/esm/tests/controllers/SnackController.test.js +18 -0
- package/dist/esm/tests/controllers/SnackController.test.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/types/exports/react.d.ts +3 -12
- package/dist/types/exports/vue.d.ts +5 -11
- package/dist/types/src/controllers/ApiController.d.ts +5 -5
- package/dist/types/src/controllers/SnackController.d.ts +10 -1
- package/dist/types/src/utils/SIWXUtil.d.ts +74 -37
- package/dist/types/src/utils/TypeUtil.d.ts +18 -1
- package/package.json +3 -3
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function useAppKitNetworkCore():
|
|
3
|
-
|
|
4
|
-
chainId: number | string | undefined;
|
|
5
|
-
caipNetworkId: CaipNetworkId | undefined;
|
|
6
|
-
};
|
|
7
|
-
export declare function useAppKitAccount(): {
|
|
8
|
-
caipAddress: `eip155:${string}:${string}` | `eip155:${number}:${string}` | `solana:${string}:${string}` | `solana:${number}:${string}` | `polkadot:${string}:${string}` | `polkadot:${number}:${string}` | undefined;
|
|
9
|
-
address: string | undefined;
|
|
10
|
-
isConnected: boolean;
|
|
11
|
-
status: "reconnecting" | "connected" | "disconnected" | "connecting" | undefined;
|
|
12
|
-
};
|
|
1
|
+
import type { UseAppKitAccountReturn, UseAppKitNetworkReturn } from '../src/utils/TypeUtil.js';
|
|
2
|
+
export declare function useAppKitNetworkCore(): Pick<UseAppKitNetworkReturn, 'caipNetwork' | 'chainId' | 'caipNetworkId'>;
|
|
3
|
+
export declare function useAppKitAccount(): UseAppKitAccountReturn;
|
|
13
4
|
export declare function useDisconnect(): {
|
|
14
5
|
disconnect: () => Promise<void>;
|
|
15
6
|
};
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
caipNetworkId: CaipNetworkId | undefined;
|
|
6
|
-
};
|
|
7
|
-
export declare function useAppKitAccount(): {
|
|
8
|
-
caipAddress: `eip155:${string}:${string}` | `eip155:${number}:${string}` | `solana:${string}:${string}` | `solana:${number}:${string}` | `polkadot:${string}:${string}` | `polkadot:${number}:${string}` | undefined;
|
|
9
|
-
address: string | undefined;
|
|
1
|
+
export declare function useAppKitAccount(): import("vue").Ref<{
|
|
2
|
+
address: string | null;
|
|
3
|
+
caipAddress: `eip155:${string}:${string}` | `solana:${string}:${string}` | `polkadot:${string}:${string}` | null;
|
|
4
|
+
status: "reconnecting" | "connected" | "disconnected" | "connecting" | null;
|
|
10
5
|
isConnected: boolean;
|
|
11
|
-
|
|
12
|
-
};
|
|
6
|
+
}>;
|
|
13
7
|
export declare function useDisconnect(): {
|
|
14
8
|
disconnect: () => Promise<void>;
|
|
15
9
|
};
|
|
@@ -15,10 +15,10 @@ export interface ApiControllerState {
|
|
|
15
15
|
export declare const ApiController: {
|
|
16
16
|
state: ApiControllerState;
|
|
17
17
|
subscribeKey<K extends keyof ApiControllerState>(key: K, callback: (value: ApiControllerState[K]) => void): () => void;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
_getSdkProperties(): {
|
|
19
|
+
projectId: string;
|
|
20
|
+
st: "appkit";
|
|
21
|
+
sv: import("../utils/TypeUtil.js").SdkVersion;
|
|
22
22
|
};
|
|
23
23
|
_filterOutExtensions(wallets: WcWallet[]): WcWallet[];
|
|
24
24
|
_fetchWalletImage(imageId: string): Promise<void>;
|
|
@@ -36,7 +36,7 @@ export declare const ApiController: {
|
|
|
36
36
|
searchWalletByIds({ ids }: {
|
|
37
37
|
ids: string[];
|
|
38
38
|
}): Promise<void>;
|
|
39
|
-
searchWallet({ search }: Pick<ApiGetWalletsRequest, 'search'>): Promise<void>;
|
|
39
|
+
searchWallet({ search, badge }: Pick<ApiGetWalletsRequest, 'search' | 'badge'>): Promise<void>;
|
|
40
40
|
reFetchWallets(): Promise<void>;
|
|
41
41
|
prefetch(): void;
|
|
42
42
|
fetchAnalyticsConfig(): Promise<void>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface SnackControllerState {
|
|
2
2
|
message: string;
|
|
3
3
|
variant: 'error' | 'success' | 'loading';
|
|
4
|
+
svg?: {
|
|
5
|
+
iconColor: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
};
|
|
4
8
|
open: boolean;
|
|
5
9
|
}
|
|
6
10
|
export declare const SnackController: {
|
|
@@ -8,7 +12,12 @@ export declare const SnackController: {
|
|
|
8
12
|
subscribeKey<K extends keyof SnackControllerState>(key: K, callback: (value: SnackControllerState[K]) => void): () => void;
|
|
9
13
|
showLoading(message: SnackControllerState['message']): void;
|
|
10
14
|
showSuccess(message: SnackControllerState['message']): void;
|
|
15
|
+
showSvg(message: SnackControllerState['message'], svg: NonNullable<SnackControllerState['svg']>): void;
|
|
11
16
|
showError(message: unknown): void;
|
|
12
17
|
hide(): void;
|
|
13
|
-
_showMessage(
|
|
18
|
+
_showMessage({ message, svg, variant }: {
|
|
19
|
+
message: SnackControllerState['message'];
|
|
20
|
+
svg?: SnackControllerState['svg'];
|
|
21
|
+
variant?: "loading" | "success" | "error" | undefined;
|
|
22
|
+
}): void;
|
|
14
23
|
};
|
|
@@ -3,7 +3,7 @@ import type { CaipNetworkId } from '@reown/appkit-common';
|
|
|
3
3
|
* @experimental - This is an experimental feature and it is not production ready
|
|
4
4
|
*/
|
|
5
5
|
export interface SIWXConfig {
|
|
6
|
-
createMessage: (input:
|
|
6
|
+
createMessage: (input: SIWXMessage.Input) => Promise<SIWXMessage>;
|
|
7
7
|
addSession: (session: SIWXSession) => Promise<void>;
|
|
8
8
|
revokeSession: (chainId: CaipNetworkId, address: string) => Promise<void>;
|
|
9
9
|
setSessions: (sessions: SIWXSession[]) => Promise<void>;
|
|
@@ -13,48 +13,85 @@ export interface SIWXConfig {
|
|
|
13
13
|
* @experimental - This is an experimental feature and it is not production ready
|
|
14
14
|
*/
|
|
15
15
|
export interface SIWXSession {
|
|
16
|
-
|
|
16
|
+
data: SIWXMessage.Data;
|
|
17
|
+
message: string;
|
|
17
18
|
signature: string;
|
|
19
|
+
cacao?: Cacao;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* @experimental - This is an experimental feature and it is not production ready
|
|
21
23
|
*/
|
|
22
|
-
export interface SIWXMessage extends
|
|
24
|
+
export interface SIWXMessage extends SIWXMessage.Data, SIWXMessage.Methods {
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
export declare namespace SIWXMessage {
|
|
27
|
+
/**
|
|
28
|
+
* @experimental - This is an experimental feature and it is not production ready
|
|
29
|
+
*/
|
|
30
|
+
interface Data extends Input, Metadata, Identifier {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @experimental - This is an experimental feature and it is not production ready
|
|
34
|
+
*/
|
|
35
|
+
interface Input {
|
|
36
|
+
accountAddress: string;
|
|
37
|
+
chainId: string;
|
|
38
|
+
notBefore?: Timestamp;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @experimental - This is an experimental feature and it is not production ready
|
|
42
|
+
*/
|
|
43
|
+
interface Metadata {
|
|
44
|
+
domain: string;
|
|
45
|
+
uri: string;
|
|
46
|
+
version: string;
|
|
47
|
+
nonce: string;
|
|
48
|
+
statement?: string;
|
|
49
|
+
resources?: string[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @experimental - This is an experimental feature and it is not production ready
|
|
53
|
+
*/
|
|
54
|
+
interface Identifier {
|
|
55
|
+
requestId?: string;
|
|
56
|
+
issuedAt?: Timestamp;
|
|
57
|
+
expirationTime?: Timestamp;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @experimental - This is an experimental feature and it is not production ready
|
|
61
|
+
*/
|
|
62
|
+
interface Methods {
|
|
63
|
+
toString: () => string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @experimental - This is an experimental feature and it is not production ready
|
|
67
|
+
*/
|
|
68
|
+
type Timestamp = string;
|
|
42
69
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
70
|
+
export interface Cacao {
|
|
71
|
+
h: Cacao.Header;
|
|
72
|
+
p: Cacao.Payload;
|
|
73
|
+
s: {
|
|
74
|
+
t: 'eip191' | 'eip1271';
|
|
75
|
+
s: string;
|
|
76
|
+
m?: string;
|
|
77
|
+
};
|
|
50
78
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
79
|
+
export declare namespace Cacao {
|
|
80
|
+
interface Header {
|
|
81
|
+
t: 'caip122';
|
|
82
|
+
}
|
|
83
|
+
interface Payload {
|
|
84
|
+
domain: string;
|
|
85
|
+
aud: string;
|
|
86
|
+
nonce: string;
|
|
87
|
+
iss: string;
|
|
88
|
+
version?: string;
|
|
89
|
+
iat?: string;
|
|
90
|
+
nbf?: string;
|
|
91
|
+
exp?: string;
|
|
92
|
+
statement?: string;
|
|
93
|
+
requestId?: string;
|
|
94
|
+
resources?: string[];
|
|
95
|
+
type?: string;
|
|
96
|
+
}
|
|
56
97
|
}
|
|
57
|
-
/**
|
|
58
|
-
* @experimental - This is an experimental feature and it is not production ready
|
|
59
|
-
*/
|
|
60
|
-
export type SIWXMessageTimestamp = string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { W3mFrameProvider, W3mFrameTypes } from '@reown/appkit-wallet';
|
|
2
|
-
import type { Balance, Transaction, CaipNetworkId, CaipNetwork, ChainNamespace, CaipAddress, AdapterType, SdkFramework, AppKitSdkVersion } from '@reown/appkit-common';
|
|
2
|
+
import type { Balance, Transaction, CaipNetworkId, CaipNetwork, ChainNamespace, CaipAddress, AdapterType, SdkFramework, AppKitSdkVersion, AppKitNetwork } from '@reown/appkit-common';
|
|
3
3
|
import type { ConnectionControllerClient } from '../controllers/ConnectionController.js';
|
|
4
4
|
import type { AccountControllerState } from '../controllers/AccountController.js';
|
|
5
5
|
import type { OnRampProviderOption } from '../controllers/OnRampController.js';
|
|
@@ -59,6 +59,7 @@ export type Metadata = {
|
|
|
59
59
|
export interface WcWallet {
|
|
60
60
|
id: string;
|
|
61
61
|
name: string;
|
|
62
|
+
badge_type?: BadgeType;
|
|
62
63
|
homepage?: string;
|
|
63
64
|
image_id?: string;
|
|
64
65
|
image_url?: string;
|
|
@@ -80,6 +81,7 @@ export interface ApiGetWalletsRequest {
|
|
|
80
81
|
chains: string;
|
|
81
82
|
entries: number;
|
|
82
83
|
search?: string;
|
|
84
|
+
badge?: BadgeType;
|
|
83
85
|
include?: string[];
|
|
84
86
|
exclude?: string[];
|
|
85
87
|
}
|
|
@@ -489,6 +491,7 @@ export type Event = {
|
|
|
489
491
|
swapToToken: string;
|
|
490
492
|
swapFromAmount: string;
|
|
491
493
|
swapToAmount: string;
|
|
494
|
+
message: string;
|
|
492
495
|
};
|
|
493
496
|
} | {
|
|
494
497
|
type: 'track';
|
|
@@ -579,6 +582,13 @@ export type Event = {
|
|
|
579
582
|
mobile_link: string;
|
|
580
583
|
name: string;
|
|
581
584
|
};
|
|
585
|
+
} | {
|
|
586
|
+
type: 'track';
|
|
587
|
+
event: 'SEARCH_WALLET';
|
|
588
|
+
properties: {
|
|
589
|
+
badge: string;
|
|
590
|
+
search: string;
|
|
591
|
+
};
|
|
582
592
|
};
|
|
583
593
|
export type DestinationWallet = {
|
|
584
594
|
address: string;
|
|
@@ -793,6 +803,11 @@ export type Features = {
|
|
|
793
803
|
* @type {boolean}
|
|
794
804
|
*/
|
|
795
805
|
smartSessions?: boolean;
|
|
806
|
+
/**
|
|
807
|
+
* Enable or disable the terms of service and/or privacy policy checkbox.
|
|
808
|
+
* @default false
|
|
809
|
+
*/
|
|
810
|
+
legalCheckbox?: boolean;
|
|
796
811
|
};
|
|
797
812
|
export type FeaturesKeys = keyof Features;
|
|
798
813
|
export type WalletGuideType = 'get-started' | 'explore';
|
|
@@ -806,5 +821,7 @@ export type UseAppKitNetworkReturn = {
|
|
|
806
821
|
caipNetwork: CaipNetwork | undefined;
|
|
807
822
|
chainId: number | string | undefined;
|
|
808
823
|
caipNetworkId: CaipNetworkId | undefined;
|
|
824
|
+
switchNetwork: (network: AppKitNetwork) => void;
|
|
809
825
|
};
|
|
826
|
+
export type BadgeType = 'none' | 'certified';
|
|
810
827
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
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.3.
|
|
43
|
-
"@reown/appkit-wallet": "1.3.
|
|
42
|
+
"@reown/appkit-common": "1.3.2",
|
|
43
|
+
"@reown/appkit-wallet": "1.3.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {},
|
|
46
46
|
"devDependencies": {
|