@hashgraph/hedera-wallet-connect 2.1.3-canary.c6aa77e.0 → 2.1.3

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/README.md CHANGED
@@ -61,10 +61,14 @@ reviewing the [Reown docs](https://docs.reown.com/overview).
61
61
 
62
62
  ## Using Reown's AppKit (Recommended)
63
63
 
64
- > **For EVM developers:** If you're coming from Ethereum or other EVM chains, the `eip155` adapter
65
- > lets you use standard Ethereum methods (`personal_sign`, `eth_sendTransaction`, etc.) on Hedera's
66
- > EVM-compatible layer - no Hedera-specific RPC knowledge required. The native `hedera` adapter is
67
- > optional and only needed for Hedera-native operations (HTS tokens, HBAR transfers via SDK, etc.).
64
+ > **For EVM developers:** If you're coming from Ethereum or other EVM chains, use `WagmiAdapter`
65
+ > from `@reown/appkit-adapter-wagmi` for standard Ethereum methods (`personal_sign`,
66
+ > `eth_sendTransaction`, etc.) on Hedera's EVM-compatible layer - no Hedera-specific RPC knowledge
67
+ > required. The native `hedera` adapter is only needed for Hedera-native operations (HTS tokens,
68
+ > HBAR transfers via SDK, etc.).
69
+ >
70
+ > **Note:** The `HederaAdapter` with `namespace: 'eip155'` is deprecated. Use `WagmiAdapter` from
71
+ > `@reown/appkit-adapter-wagmi` instead. See the migration example below.
68
72
 
69
73
  1. Follow one of the quickstart instructions at
70
74
  https://docs.reown.com/appkit/overview#quickstart
@@ -72,7 +76,7 @@ reviewing the [Reown docs](https://docs.reown.com/overview).
72
76
  2. Add Hedera dependencies to your project:
73
77
 
74
78
  ```sh
75
- npm install @hashgraph/hedera-wallet-connect @hiero-ledger/sdk @walletconnect/universal-provider
79
+ npm install @hashgraph/hedera-wallet-connect @hiero-ledger/sdk @walletconnect/universal-provider @reown/appkit-adapter-wagmi
76
80
  ```
77
81
 
78
82
  3. Initialize adapters and create AppKit:
@@ -85,6 +89,7 @@ import {
85
89
  HederaChainDefinition,
86
90
  hederaNamespace,
87
91
  } from '@hashgraph/hedera-wallet-connect'
92
+ import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
88
93
  import { createAppKit } from '@reown/appkit'
89
94
 
90
95
  const projectId = 'YOUR_PROJECT_ID'
@@ -96,11 +101,10 @@ const metadata = {
96
101
  icons: ['https://avatars.githubusercontent.com/u/179229932'],
97
102
  }
98
103
 
99
- // EVM adapter (eip155)
100
- const hederaEVMAdapter = new HederaAdapter({
101
- projectId,
104
+ // EVM adapter using Reown's WagmiAdapter
105
+ const evmAdapter = new WagmiAdapter({
102
106
  networks: [HederaChainDefinition.EVM.Mainnet, HederaChainDefinition.EVM.Testnet],
103
- namespace: 'eip155',
107
+ projectId,
104
108
  })
105
109
 
106
110
  // Native adapter (hedera namespace)
@@ -116,7 +120,7 @@ const universalProvider = (await HederaProvider.init({
116
120
  })) as unknown as UniversalProvider
117
121
 
118
122
  const appKit = createAppKit({
119
- adapters: [hederaEVMAdapter, hederaNativeAdapter],
123
+ adapters: [evmAdapter, hederaNativeAdapter],
120
124
  // @ts-expect-error expected type mismatch
121
125
  universalProvider,
122
126
  projectId,
@@ -155,26 +159,15 @@ appKit.subscribeCaipNetworkChange((network) => {
155
159
  6. Sign a message (EVM):
156
160
 
157
161
  ```typescript
158
- const address = appKit.getAddress()
159
- const provider = hederaEVMAdapter.getWalletConnectProvider()
160
-
161
- const signature = await hederaEVMAdapter.signMessage({
162
- message: 'Hello from my Hedera dApp!',
163
- address,
164
- provider,
165
- })
162
+ // With WagmiAdapter, use standard wagmi/viem actions for EVM operations.
163
+ // See https://docs.reown.com/appkit/recipes/wagmi for more examples.
166
164
  ```
167
165
 
168
166
  7. Get balance:
169
167
 
170
168
  ```typescript
171
- const address = appKit.getAddress()
172
- const network = appKit.getCaipNetwork()
173
-
174
- const { balance, symbol } = await hederaEVMAdapter.getBalance({
175
- address,
176
- caipNetwork: network,
177
- })
169
+ // With WagmiAdapter, use standard wagmi hooks or actions (e.g., useBalance, getBalance)
170
+ // to query balances on Hedera's EVM layer.
178
171
  ```
179
172
 
180
173
  8. Sign and execute a Hedera native transaction:
@@ -36,12 +36,32 @@ export declare class HederaAdapter extends AdapterBlueprint {
36
36
  syncConnections(_params: AdapterBlueprint.SyncConnectionsParams): Promise<void>;
37
37
  getBalance(params: AdapterBlueprint.GetBalanceParams): Promise<AdapterBlueprint.GetBalanceResult>;
38
38
  signMessage(params: AdapterBlueprint.SignMessageParams): Promise<AdapterBlueprint.SignMessageResult>;
39
+ /**
40
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
41
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
42
+ */
39
43
  estimateGas(params: AdapterBlueprint.EstimateGasTransactionArgs): Promise<AdapterBlueprint.EstimateGasTransactionResult>;
44
+ /**
45
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
46
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
47
+ */
40
48
  sendTransaction(params: AdapterSendTransactionParams): Promise<AdapterBlueprint.SendTransactionResult>;
49
+ /**
50
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
51
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
52
+ */
41
53
  writeContract(params: AdapterBlueprint.WriteContractParams): Promise<AdapterBlueprint.WriteContractResult>;
54
+ /**
55
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
56
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
57
+ */
42
58
  getEnsAddress(params: GetEnsAddressParams): Promise<GetEnsAddressResult>;
43
59
  parseUnits(params: AdapterBlueprint.ParseUnitsParams): AdapterBlueprint.ParseUnitsResult;
44
60
  formatUnits(params: AdapterBlueprint.FormatUnitsParams): AdapterBlueprint.FormatUnitsResult;
61
+ /**
62
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
63
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
64
+ */
45
65
  getCapabilities(params: AdapterBlueprint.GetCapabilitiesParams): Promise<unknown>;
46
66
  getProfile(): Promise<GetProfileResult>;
47
67
  grantPermissions(): Promise<unknown>;
@@ -13,6 +13,8 @@ export class HederaAdapter extends AdapterBlueprint {
13
13
  throw new Error('Namespace must be "hedera" or "eip155"');
14
14
  }
15
15
  if (params.namespace == 'eip155') {
16
+ console.warn('HederaAdapter with namespace "eip155" is deprecated and will be removed in the next major version. ' +
17
+ 'Use WagmiAdapter from @reown/appkit-adapter-wagmi for EVM wallet connectivity instead.');
16
18
  if ((_a = params.networks) === null || _a === void 0 ? void 0 : _a.some((n) => n.chainNamespace != 'eip155')) {
17
19
  throw new Error('Invalid networks for eip155 namespace');
18
20
  }
@@ -325,6 +327,10 @@ export class HederaAdapter extends AdapterBlueprint {
325
327
  }
326
328
  return { signature };
327
329
  }
330
+ /**
331
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
332
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
333
+ */
328
334
  async estimateGas(params) {
329
335
  const { caipNetwork, address } = params;
330
336
  if (this.namespace !== 'eip155') {
@@ -353,6 +359,10 @@ export class HederaAdapter extends AdapterBlueprint {
353
359
  }, address, Number(caipNetwork === null || caipNetwork === void 0 ? void 0 : caipNetwork.id));
354
360
  return { gas: result };
355
361
  }
362
+ /**
363
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
364
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
365
+ */
356
366
  async sendTransaction(params) {
357
367
  var _a, _b;
358
368
  if (this.namespace !== 'eip155') {
@@ -386,6 +396,10 @@ export class HederaAdapter extends AdapterBlueprint {
386
396
  }, params.address, Number((_b = params.caipNetwork) === null || _b === void 0 ? void 0 : _b.id));
387
397
  return { hash: tx };
388
398
  }
399
+ /**
400
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
401
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
402
+ */
389
403
  async writeContract(params) {
390
404
  if (this.namespace !== 'eip155') {
391
405
  throw new Error('Namespace is not eip155');
@@ -414,6 +428,10 @@ export class HederaAdapter extends AdapterBlueprint {
414
428
  else
415
429
  throw new Error('Contract method is undefined');
416
430
  }
431
+ /**
432
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
433
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
434
+ */
417
435
  async getEnsAddress(params) {
418
436
  if (this.namespace !== 'eip155') {
419
437
  throw new Error('Namespace is not eip155');
@@ -434,6 +452,10 @@ export class HederaAdapter extends AdapterBlueprint {
434
452
  formatUnits(params) {
435
453
  return formatUnits(params.value, params.decimals);
436
454
  }
455
+ /**
456
+ * @deprecated This method is only used with the eip155 namespace, which is deprecated.
457
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM operations instead.
458
+ */
437
459
  async getCapabilities(params) {
438
460
  var _a, _b;
439
461
  if (this.namespace !== 'eip155') {
@@ -23,6 +23,11 @@ export declare namespace HederaConnector {
23
23
  type Options = {
24
24
  provider: UniversalProvider;
25
25
  caipNetworks: CaipNetwork[];
26
+ /**
27
+ * The chain namespace for the connector.
28
+ * @remarks The `'eip155'` option is deprecated and will be removed in the next major version.
29
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
30
+ */
26
31
  namespace: 'hedera' | 'eip155';
27
32
  };
28
33
  }
@@ -1,6 +1,11 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import { SessionTypes } from '@walletconnect/types';
3
3
  import { IProvider, SessionNamespace, RpcProvidersMap, RequestParams, Namespace } from '@walletconnect/universal-provider';
4
+ /**
5
+ * @deprecated EIP155Provider is deprecated and will be removed in the next major version.
6
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
7
+ * Hedera's JSON-RPC relay makes it a standard EVM chain, so no custom EVM adapter is needed.
8
+ */
4
9
  declare class EIP155Provider implements IProvider {
5
10
  name: string;
6
11
  client: IProvider['client'];
@@ -3,10 +3,17 @@ import { HttpConnection } from '@walletconnect/jsonrpc-http-connection';
3
3
  import { formatJsonRpcRequest } from '@walletconnect/jsonrpc-utils';
4
4
  import { BUNDLER_URL, getChainId, HederaChainDefinition } from '../utils';
5
5
  import { createLogger } from '../../lib/shared/logger';
6
+ /**
7
+ * @deprecated EIP155Provider is deprecated and will be removed in the next major version.
8
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
9
+ * Hedera's JSON-RPC relay makes it a standard EVM chain, so no custom EVM adapter is needed.
10
+ */
6
11
  class EIP155Provider {
7
12
  constructor({ client, events, namespace, }) {
8
13
  this.name = 'eip155';
9
14
  this.logger = createLogger('EIP155Provider');
15
+ this.logger.warn('EIP155Provider is deprecated and will be removed in the next major version. ' +
16
+ 'Use WagmiAdapter from @reown/appkit-adapter-wagmi for EVM wallet connectivity instead.');
10
17
  this.namespace = namespace;
11
18
  this.events = events;
12
19
  this.client = client;
@@ -4,6 +4,10 @@ export declare const BUNDLER_URL = "https://rpc.walletconnect.org/v1/bundler";
4
4
  export declare const PROVIDER_EVENTS: {
5
5
  DEFAULT_CHAIN_CHANGED: string;
6
6
  };
7
+ /**
8
+ * @deprecated Eip155JsonRpcMethod is deprecated and will be removed in the next major version.
9
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
10
+ */
7
11
  export declare enum Eip155JsonRpcMethod {
8
12
  PersonalSign = "personal_sign",
9
13
  Sign = "eth_sign",
@@ -4,6 +4,10 @@ export const BUNDLER_URL = `${RPC_URL}bundler`;
4
4
  export const PROVIDER_EVENTS = {
5
5
  DEFAULT_CHAIN_CHANGED: 'default_chain_changed',
6
6
  };
7
+ /**
8
+ * @deprecated Eip155JsonRpcMethod is deprecated and will be removed in the next major version.
9
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
10
+ */
7
11
  // EIP-155 Wallet Methods
8
12
  export var Eip155JsonRpcMethod;
9
13
  (function (Eip155JsonRpcMethod) {
@@ -2,11 +2,17 @@
2
2
  * Gets message from various signing request methods by filtering out
3
3
  * a value that is not an address (thus is a message).
4
4
  * If it is a hex string, it gets converted to utf8 string
5
+ *
6
+ * @deprecated This function is deprecated and will be removed in the next major version.
7
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
5
8
  */
6
9
  export declare function getSignParamsMessage(params: string[]): string;
7
10
  /**
8
11
  * Gets data from various signTypedData request methods by filtering out
9
12
  * a value that is not an address (thus is data).
10
13
  * If data is a string convert it to object
14
+ *
15
+ * @deprecated This function is deprecated and will be removed in the next major version.
16
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
11
17
  */
12
18
  export declare function getSignTypedDataParamsData(params: string[]): any;
@@ -3,6 +3,9 @@ import { ethers } from 'ethers';
3
3
  * Gets message from various signing request methods by filtering out
4
4
  * a value that is not an address (thus is a message).
5
5
  * If it is a hex string, it gets converted to utf8 string
6
+ *
7
+ * @deprecated This function is deprecated and will be removed in the next major version.
8
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
6
9
  */
7
10
  export function getSignParamsMessage(params) {
8
11
  const message = params.filter((p) => !ethers.isAddress(p))[0];
@@ -15,6 +18,9 @@ export function getSignParamsMessage(params) {
15
18
  * Gets data from various signTypedData request methods by filtering out
16
19
  * a value that is not an address (thus is data).
17
20
  * If data is a string convert it to object
21
+ *
22
+ * @deprecated This function is deprecated and will be removed in the next major version.
23
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
18
24
  */
19
25
  export function getSignTypedDataParamsData(params) {
20
26
  const data = params.filter((p) => !ethers.isAddress(p))[0];
@@ -23,7 +23,8 @@ export interface EIP155WalletInterface {
23
23
  [Eip155JsonRpcMethod.SendRawTransaction](rawTransaction: string, provider: JsonRpcProvider): Promise<TransactionResponse>;
24
24
  }
25
25
  /**
26
- * Library
26
+ * @deprecated EIP155Wallet is deprecated and will be removed in the next major version.
27
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
27
28
  */
28
29
  export declare class EIP155Wallet implements EIP155WalletInterface {
29
30
  wallet: BaseEvmWallet;
@@ -3,10 +3,13 @@ import { formatJsonRpcError, formatJsonRpcResult, } from '@walletconnect/jsonrpc
3
3
  import { getSdkError } from '@walletconnect/utils';
4
4
  import { Eip155JsonRpcMethod, HederaChainDefinition, getSignParamsMessage, getSignTypedDataParamsData, } from '..';
5
5
  /**
6
- * Library
6
+ * @deprecated EIP155Wallet is deprecated and will be removed in the next major version.
7
+ * Use `WagmiAdapter` from `@reown/appkit-adapter-wagmi` for EVM wallet connectivity instead.
7
8
  */
8
9
  export class EIP155Wallet {
9
10
  constructor(wallet) {
11
+ console.warn('EIP155Wallet is deprecated and will be removed in the next major version. ' +
12
+ 'Use WagmiAdapter from @reown/appkit-adapter-wagmi for EVM wallet connectivity instead.');
10
13
  this.wallet = wallet;
11
14
  }
12
15
  connect(provider) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashgraph/hedera-wallet-connect",
3
- "version": "2.1.3-canary.c6aa77e.0",
3
+ "version": "2.1.3",
4
4
  "description": "A library to facilitate integrating Hedera with WalletConnect",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,6 +28,7 @@
28
28
  "prettier:fix": "prettier --write ./src/"
29
29
  },
30
30
  "peerDependencies": {
31
+ "@hiero-ledger/proto": "^2.25.0",
31
32
  "@hiero-ledger/sdk": "2.79.0",
32
33
  "@reown/appkit": "^1.8.10",
33
34
  "@reown/appkit-controllers": "^1.8.10",
@@ -36,13 +37,12 @@
36
37
  "ethers": "^6.13.5"
37
38
  },
38
39
  "devDependencies": {
39
- "@hiero-ledger/proto": "^2.25.0",
40
40
  "@swc/jest": "^0.2.37",
41
41
  "@types/jest": "^30.0.0",
42
42
  "jest": "^30.0.3",
43
43
  "nodemon": "^3.1.10",
44
44
  "prettier": "^3.8.1",
45
45
  "ts-node": "^10.9.2",
46
- "typescript": "^5.8.2"
46
+ "typescript": "^6.0.2"
47
47
  }
48
48
  }