@reown/appkit-core 1.2.0 → 1.2.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,5 +1,5 @@
1
1
  import type { CaipNetwork, CaipNetworkId } from '@reown/appkit-common';
2
- export declare function useAppKitNetwork(): {
2
+ export declare function useAppKitNetworkCore(): {
3
3
  caipNetwork: CaipNetwork | undefined;
4
4
  chainId: number | string | undefined;
5
5
  caipNetworkId: CaipNetworkId | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { CaipNetwork, CaipNetworkId } from '@reown/appkit-common';
2
- export declare function useAppKitNetwork(): {
2
+ export declare function useAppKitNetworkCore(): {
3
3
  caipNetwork: CaipNetwork | undefined;
4
4
  chainId: number | string | undefined;
5
5
  caipNetworkId: CaipNetworkId | undefined;
@@ -23,6 +23,7 @@ export declare const ChainController: {
23
23
  setAccountProp(prop: keyof AccountControllerState, value: AccountControllerState[keyof AccountControllerState], chain: ChainNamespace | undefined, replaceState?: boolean): void;
24
24
  setActiveNamespace(chain: ChainNamespace | undefined): void;
25
25
  setActiveCaipNetwork(caipNetwork: AdapterNetworkState['caipNetwork']): void;
26
+ addCaipNetwork(caipNetwork: AdapterNetworkState['caipNetwork']): void;
26
27
  switchActiveNetwork(network: CaipNetwork): Promise<void>;
27
28
  setActiveConnector(connector: ChainControllerState['activeConnector']): void;
28
29
  getNetworkControllerClient(chainNamespace?: ChainNamespace): import("../utils/TypeUtil.js").NetworkControllerClient;
@@ -1,5 +1,5 @@
1
1
  import type { CustomWallet, Features, Metadata, ProjectId, SdkVersion, Tokens } from '../utils/TypeUtil.js';
2
- import type { SWIXConfig } from '../utils/SIWXUtil.js';
2
+ import type { SIWXConfig } from '../utils/SIWXUtil.js';
3
3
  export interface OptionsControllerStatePublic {
4
4
  /**
5
5
  * A boolean that allows you to add or remove the "All Wallets" button on the modal
@@ -104,7 +104,7 @@ export interface OptionsControllerStatePublic {
104
104
  * Enable Sign In With X (SIWX) feature in your AppKit.
105
105
  * @default undefined
106
106
  */
107
- siwx?: SWIXConfig;
107
+ siwx?: SIWXConfig;
108
108
  }
109
109
  export interface OptionsControllerStateInternal {
110
110
  sdkType: 'appkit';
@@ -24,7 +24,7 @@ type TransactionAction = {
24
24
  onCancel?: () => void;
25
25
  };
26
26
  export interface RouterControllerState {
27
- view: 'Account' | 'AccountSettings' | 'SelectAddresses' | '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' | 'UpgradeToSmartAccount' | 'WalletReceive' | 'WalletSend' | 'WalletSendPreview' | 'WalletSendSelectToken' | 'WhatIsANetwork' | 'WhatIsAWallet' | 'WhatIsABuy' | 'Swap' | 'SwapSelectToken' | 'SwapPreview' | 'ConnectingMultiChain' | 'SwitchActiveChain' | 'SmartSessionCreated' | 'SmartSessionList';
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' | 'UpgradeToSmartAccount' | '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;
@@ -1,12 +1,13 @@
1
+ import type { CaipNetworkId } from '@reown/appkit-common';
1
2
  /**
2
3
  * @experimental - This is an experimental feature and it is not production ready
3
4
  */
4
- export interface SWIXConfig {
5
- createMessage: (chainId: string) => Promise<SIWXMessage>;
5
+ export interface SIWXConfig {
6
+ createMessage: (input: SIWXMessageInput) => Promise<SIWXMessage>;
6
7
  addSession: (session: SIWXSession) => Promise<void>;
7
- revokeSession: (chainId: string, address: string) => Promise<void>;
8
+ revokeSession: (chainId: CaipNetworkId, address: string) => Promise<void>;
8
9
  setSessions: (sessions: SIWXSession[]) => Promise<void>;
9
- getSessions: (chainId: string) => Promise<SIWXSession[]>;
10
+ getSessions: (chainId: CaipNetworkId, address: string) => Promise<SIWXSession[]>;
10
11
  }
11
12
  /**
12
13
  * @experimental - This is an experimental feature and it is not production ready
@@ -18,18 +19,42 @@ export interface SIWXSession {
18
19
  /**
19
20
  * @experimental - This is an experimental feature and it is not production ready
20
21
  */
21
- export interface SIWXMessage {
22
+ export interface SIWXMessage extends SIWXMessageInput, SIWXMessageMetadata, SIWXMessageIdentifier, SIWXMessageMethods {
23
+ }
24
+ /**
25
+ * @experimental - This is an experimental feature and it is not production ready
26
+ */
27
+ export interface SIWXMessageInput {
28
+ accountAddress: string;
22
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 {
23
36
  domain: string;
24
- accountAddress: string;
25
37
  uri: string;
26
38
  version: string;
27
39
  nonce: string;
28
40
  statement?: string;
29
41
  resources?: string[];
30
- issuedAt?: string;
31
- expirationTime?: string;
32
- notBefore?: string;
42
+ }
43
+ /**
44
+ * @experimental - This is an experimental feature and it is not production ready
45
+ */
46
+ export interface SIWXMessageIdentifier {
33
47
  requestId?: string;
48
+ issuedAt?: SIWXMessageTimestamp;
49
+ expirationTime?: SIWXMessageTimestamp;
50
+ }
51
+ /**
52
+ * @experimental - This is an experimental feature and it is not production ready
53
+ */
54
+ export interface SIWXMessageMethods {
34
55
  toString: () => string;
35
56
  }
57
+ /**
58
+ * @experimental - This is an experimental feature and it is not production ready
59
+ */
60
+ export type SIWXMessageTimestamp = string;
@@ -796,4 +796,15 @@ export type Features = {
796
796
  };
797
797
  export type FeaturesKeys = keyof Features;
798
798
  export type WalletGuideType = 'get-started' | 'explore';
799
+ export type UseAppKitAccountReturn = {
800
+ caipAddress: CaipAddress | undefined;
801
+ address: string | undefined;
802
+ isConnected: boolean;
803
+ status: AccountControllerState['status'];
804
+ };
805
+ export type UseAppKitNetworkReturn = {
806
+ caipNetwork: CaipNetwork | undefined;
807
+ chainId: number | string | undefined;
808
+ caipNetworkId: CaipNetworkId | undefined;
809
+ };
799
810
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reown/appkit-core",
3
- "version": "1.2.0",
3
+ "version": "1.2.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.0",
43
- "@reown/appkit-wallet": "1.2.0"
42
+ "@reown/appkit-common": "1.2.1",
43
+ "@reown/appkit-wallet": "1.2.1"
44
44
  },
45
45
  "peerDependencies": {},
46
46
  "devDependencies": {