@reown/appkit-core 1.2.1 → 1.3.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.
@@ -1,15 +1,6 @@
1
- import type { CaipNetwork, CaipNetworkId } from '@reown/appkit-common';
2
- export declare function useAppKitNetworkCore(): {
3
- caipNetwork: CaipNetwork | undefined;
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
- import type { CaipNetwork, CaipNetworkId } from '@reown/appkit-common';
2
- export declare function useAppKitNetworkCore(): {
3
- caipNetwork: CaipNetwork | undefined;
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;
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
- status: "reconnecting" | "connected" | "disconnected" | "connecting" | undefined;
12
- };
6
+ }>;
13
7
  export declare function useDisconnect(): {
14
8
  disconnect: () => Promise<void>;
15
9
  };
@@ -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: SIWXMessageInput) => Promise<SIWXMessage>;
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
- message: SIWXMessage;
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 SIWXMessageInput, SIWXMessageMetadata, SIWXMessageIdentifier, SIWXMessageMethods {
24
+ export interface SIWXMessage extends SIWXMessage.Data, SIWXMessage.Methods {
23
25
  }
24
- /**
25
- * @experimental - This is an experimental feature and it is not production ready
26
- */
27
- export interface SIWXMessageInput {
28
- accountAddress: string;
29
- chainId: string;
30
- notBefore?: SIWXMessageTimestamp;
31
- }
32
- /**
33
- * @experimental - This is an experimental feature and it is not production ready
34
- */
35
- export interface SIWXMessageMetadata {
36
- domain: string;
37
- uri: string;
38
- version: string;
39
- nonce: string;
40
- statement?: string;
41
- resources?: string[];
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
- * @experimental - This is an experimental feature and it is not production ready
45
- */
46
- export interface SIWXMessageIdentifier {
47
- requestId?: string;
48
- issuedAt?: SIWXMessageTimestamp;
49
- expirationTime?: SIWXMessageTimestamp;
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
- * @experimental - This is an experimental feature and it is not production ready
53
- */
54
- export interface SIWXMessageMethods {
55
- toString: () => string;
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';
@@ -793,6 +793,11 @@ export type Features = {
793
793
  * @type {boolean}
794
794
  */
795
795
  smartSessions?: boolean;
796
+ /**
797
+ * Enable or disable the terms of service and/or privacy policy checkbox.
798
+ * @default false
799
+ */
800
+ legalCheckbox?: boolean;
796
801
  };
797
802
  export type FeaturesKeys = keyof Features;
798
803
  export type WalletGuideType = 'get-started' | 'explore';
@@ -806,5 +811,6 @@ export type UseAppKitNetworkReturn = {
806
811
  caipNetwork: CaipNetwork | undefined;
807
812
  chainId: number | string | undefined;
808
813
  caipNetworkId: CaipNetworkId | undefined;
814
+ switchNetwork: (network: AppKitNetwork) => void;
809
815
  };
810
816
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reown/appkit-core",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
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.2.1",
43
- "@reown/appkit-wallet": "1.2.1"
42
+ "@reown/appkit-common": "1.3.1",
43
+ "@reown/appkit-wallet": "1.3.1"
44
44
  },
45
45
  "peerDependencies": {},
46
46
  "devDependencies": {