@reown/appkit 1.6.0 → 1.6.1-rc.1.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.
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "1.6.0";
1
+ export declare const PACKAGE_VERSION = "1.6.1-rc.1.0";
@@ -1,11 +1,11 @@
1
1
  import { type CaipAddress, type CaipNetwork, type ChainNamespace } from '@reown/appkit-common';
2
2
  import type { ChainAdapterConnector } from './ChainAdapterConnector.js';
3
- import { type AccountType, type AccountControllerState, type Connector as AppKitConnector, type Tokens } from '@reown/appkit-core';
3
+ import { type AccountType, type AccountControllerState, type Connector as AppKitConnector, type Tokens, type WriteContractArgs } from '@reown/appkit-core';
4
4
  import type UniversalProvider from '@walletconnect/universal-provider';
5
5
  import type { W3mFrameProvider } from '@reown/appkit-wallet';
6
6
  import type { AppKitOptions } from '../utils/index.js';
7
7
  import type { AppKit } from '../client.js';
8
- type EventName = 'disconnect' | 'accountChanged' | 'switchNetwork' | 'pendingTransactions';
8
+ type EventName = 'disconnect' | 'accountChanged' | 'switchNetwork' | 'connectors' | 'pendingTransactions';
9
9
  type EventData = {
10
10
  disconnect: () => void;
11
11
  accountChanged: {
@@ -16,6 +16,7 @@ type EventData = {
16
16
  address?: string;
17
17
  chainId: number | string;
18
18
  };
19
+ connectors: ChainAdapterConnector[];
19
20
  pendingTransactions: () => void;
20
21
  };
21
22
  type EventCallback<T extends EventName> = (data: EventData[T]) => void;
@@ -254,13 +255,7 @@ export declare namespace AdapterBlueprint {
254
255
  type EstimateGasTransactionResult = {
255
256
  gas: bigint;
256
257
  };
257
- type WriteContractParams = {
258
- receiverAddress: string;
259
- tokenAmount: bigint;
260
- tokenAddress: string;
261
- fromAddress: string;
262
- method: 'send' | 'transfer' | 'call';
263
- abi: any;
258
+ type WriteContractParams = WriteContractArgs & {
264
259
  caipNetwork: CaipNetwork;
265
260
  provider?: AppKitConnector['provider'];
266
261
  caipAddress: CaipAddress;
@@ -1 +1,2 @@
1
1
  export { AdapterBlueprint } from './ChainAdapterBlueprint.js';
2
+ export type { ChainAdapterConnector } from './ChainAdapterConnector.js';
@@ -15,7 +15,8 @@ declare global {
15
15
  }
16
16
  export { AccountController };
17
17
  export interface OpenOptions {
18
- view: 'Account' | 'Connect' | 'Networks' | 'ApproveTransaction' | 'OnRampProviders';
18
+ view: 'Account' | 'Connect' | 'Networks' | 'ApproveTransaction' | 'OnRampProviders' | 'ConnectingWalletConnectBasic';
19
+ uri?: string;
19
20
  }
20
21
  type Adapters = Record<ChainNamespace, AdapterBlueprint>;
21
22
  export declare class AppKit {
@@ -89,7 +90,7 @@ export declare class AppKit {
89
90
  getCaipAddress: (chainNamespace?: ChainNamespace) => `eip155:${string}:${string}` | `eip155:${number}:${string}` | `solana:${string}:${string}` | `solana:${number}:${string}` | `polkadot:${string}:${string}` | `polkadot:${number}:${string}` | `bip122:${string}:${string}` | `bip122:${number}:${string}` | undefined;
90
91
  getAddressByChainNamespace: (chainNamespace: ChainNamespace) => string | undefined;
91
92
  getAddress: (chainNamespace?: ChainNamespace) => string | undefined;
92
- getProvider: () => Provider | UniversalProvider | import("@reown/appkit-core").CombinedProvider | undefined;
93
+ getProvider: () => UniversalProvider | Provider | import("@reown/appkit-core").CombinedProvider | undefined;
93
94
  getPreferredAccountType: () => W3mFrameTypes.AccountType;
94
95
  setCaipAddress: (typeof AccountController)['setCaipAddress'];
95
96
  setProvider: (typeof AccountController)['setProvider'];
@@ -128,6 +129,7 @@ export declare class AppKit {
128
129
  setCollapseWallets(collapseWallets: boolean): void;
129
130
  setSocialsOrder(socialsOrder: SocialProvider[]): void;
130
131
  disconnect(): Promise<void>;
132
+ getConnectMethodsOrder(): ConnectMethod[];
131
133
  private initControllers;
132
134
  private getDefaultMetaData;
133
135
  private setUnsupportedNetwork;
@@ -156,7 +158,11 @@ export declare class AppKit {
156
158
  private initializeUniversalAdapter;
157
159
  getUniversalProvider(): Promise<UniversalProvider | undefined>;
158
160
  private createAuthProvider;
161
+ private createUniversalProviderForAdapter;
162
+ private createAuthProviderForAdapter;
159
163
  private createAdapters;
164
+ private createConnectorsForAdapter;
165
+ private onConnectors;
160
166
  private initChainAdapters;
161
167
  private setDefaultNetwork;
162
168
  private initOrContinue;
@@ -4,6 +4,7 @@ import type { AppKitOptions } from '../../utils/TypesUtil.js';
4
4
  import type { ChainNamespace } from '@reown/appkit-common';
5
5
  type OpenOptions = {
6
6
  view: 'Account' | 'Connect' | 'Networks' | 'ApproveTransaction' | 'OnRampProviders';
7
+ uri?: string;
7
8
  };
8
9
  type ThemeModeOptions = AppKitOptions['themeMode'];
9
10
  type ThemeVariablesOptions = AppKitOptions['themeVariables'];
@@ -2,6 +2,7 @@ import type UniversalProvider from '@walletconnect/universal-provider';
2
2
  import { AdapterBlueprint } from '../adapters/ChainAdapterBlueprint.js';
3
3
  import { type ChainNamespace } from '@reown/appkit-common';
4
4
  export declare class UniversalAdapter extends AdapterBlueprint {
5
+ constructor(options?: AdapterBlueprint.Params);
5
6
  connectWalletConnect(onUri: (uri: string) => void): Promise<void>;
6
7
  connect(params: AdapterBlueprint.ConnectParams): Promise<AdapterBlueprint.ConnectResult>;
7
8
  disconnect(): Promise<void>;
@@ -6,4 +6,18 @@ export declare const WcHelpersUtil: {
6
6
  createNamespaces(caipNetworks: CaipNetwork[]): NamespaceConfig;
7
7
  resolveReownName: (name: string) => Promise<string | false>;
8
8
  getChainsFromNamespaces(namespaces?: SessionTypes.Namespaces): CaipNetworkId[];
9
+ isSessionEventData(data: unknown): data is WcHelpersUtil.SessionEventData;
9
10
  };
11
+ export declare namespace WcHelpersUtil {
12
+ type SessionEventData = {
13
+ id: string;
14
+ topic: string;
15
+ params: {
16
+ chainId: string;
17
+ event: {
18
+ data: unknown;
19
+ name: string;
20
+ };
21
+ };
22
+ };
23
+ }
@@ -1,6 +1,7 @@
1
- import type { AppKitNetwork, CaipNetwork, ThemeVariables } from '@reown/appkit-common';
1
+ import type { AppKitNetwork, ThemeVariables } from '@reown/appkit-common';
2
2
  import type { ChainAdapter, Metadata, OptionsControllerState, ThemeMode } from '@reown/appkit-core';
3
3
  import type { AppKitSIWEClient } from '@reown/appkit-siwe';
4
+ import type UniversalProvider from '@walletconnect/universal-provider';
4
5
  export type AppKitOptions = {
5
6
  /**
6
7
  * Adapter array to be used by the AppKit.
@@ -71,8 +72,10 @@ export type AppKitOptions = {
71
72
  * @see https://cloud.walletconnect.com/
72
73
  */
73
74
  metadata?: Metadata;
75
+ /**
76
+ * UniversalProvider instance to be used by AppKit.
77
+ * AppKit will generate its own instance by default in none provided
78
+ * @default undefined
79
+ */
80
+ universalProvider?: UniversalProvider;
74
81
  } & OptionsControllerState;
75
- export type AppKitOptionsWithCaipNetworks = Omit<AppKitOptions, 'defaultNetwork' | 'networks'> & {
76
- defaultNetwork?: CaipNetwork;
77
- networks: [CaipNetwork, ...CaipNetwork[]];
78
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reown/appkit",
3
- "version": "1.6.0",
3
+ "version": "1.6.1-rc.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/esm/exports/index.js",
6
6
  "types": "./dist/types/exports/index.d.ts",
@@ -89,20 +89,20 @@
89
89
  }
90
90
  },
91
91
  "dependencies": {
92
- "@walletconnect/types": "2.17.0",
93
- "@walletconnect/universal-provider": "2.17.0",
94
- "@walletconnect/utils": "2.17.0",
92
+ "@walletconnect/types": "2.17.2",
93
+ "@walletconnect/universal-provider": "2.17.2",
94
+ "@walletconnect/utils": "2.17.2",
95
95
  "bs58": "6.0.0",
96
96
  "valtio": "1.11.2",
97
97
  "viem": "2.x",
98
- "@reown/appkit-common": "1.6.0",
99
- "@reown/appkit-core": "1.6.0",
100
- "@reown/appkit-polyfills": "1.6.0",
101
- "@reown/appkit-scaffold-ui": "1.6.0",
102
- "@reown/appkit-siwe": "1.6.0",
103
- "@reown/appkit-ui": "1.6.0",
104
- "@reown/appkit-utils": "1.6.0",
105
- "@reown/appkit-wallet": "1.6.0"
98
+ "@reown/appkit-core": "1.6.1-rc.1.0",
99
+ "@reown/appkit-scaffold-ui": "1.6.1-rc.1.0",
100
+ "@reown/appkit-polyfills": "1.6.1-rc.1.0",
101
+ "@reown/appkit-siwe": "1.6.1-rc.1.0",
102
+ "@reown/appkit-utils": "1.6.1-rc.1.0",
103
+ "@reown/appkit-wallet": "1.6.1-rc.1.0",
104
+ "@reown/appkit-common": "1.6.1-rc.1.0",
105
+ "@reown/appkit-ui": "1.6.1-rc.1.0"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@types/react": "18.3.1",
@@ -110,7 +110,7 @@
110
110
  "@vitest/coverage-v8": "2.1.3",
111
111
  "@vue/runtime-core": "3.4.3",
112
112
  "@walletconnect/types": "2.13.3",
113
- "@walletconnect/universal-provider": "2.17.0",
113
+ "@walletconnect/universal-provider": "2.17.2",
114
114
  "react": "18.3.1",
115
115
  "react-dom": "18.3.1",
116
116
  "vitest": "2.1.3",