Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is recommended to upgrade tronwallet-adapter-walletconnect to Web3Modal V4 #60

Open
hhun opened this issue May 4, 2024 · 5 comments

Comments

@hhun
Copy link

hhun commented May 4, 2024

It is recommended to upgrade tronwallet-adapter-walletconnect to Web3Modal V4
建议 tronwallet-adapter-walletconnect 升级为 Web3Modal V4

Upgrade Guide https://docs.walletconnect.com/web3modal/upgrade

@svein1010
Copy link

Web3Modal V4 now is for Ethereum compatible chains and can not be used in Tron.
You can track the progress by this issue

@PaulvanMotman
Copy link

For me the Web3Modal of @web3modal/standalone isn't showing up.

Web3Modal is used by @tronweb3/walletconnect-tron, which is used by @tronweb3/tronwallet-adapter-walletconnect.

It seems that @web3modal/standalone is deprecated.

To resolve it I have patched @tronweb3/walletconnect-tron to use @walletconnect/modal:

diff --git a/lib/cjs/adapter.js b/lib/cjs/adapter.js
index 0195c084fdbc789e62cb0562e50d8f04f5f5b22b..a399f2a17a40bf84f05ccb47e3430a7ea6fb1c48 100644
--- a/lib/cjs/adapter.js
+++ b/lib/cjs/adapter.js
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
 };
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.WalletConnectWallet = exports.WalletConnectMethods = exports.WalletConnectChainID = void 0;
-const standalone_1 = require("@web3modal/standalone");
+const standalone_1 = require("@walletconnect/modal");
 const sign_client_1 = __importDefault(require("@walletconnect/sign-client"));
 const utils_1 = require("@walletconnect/utils");
 const errors_js_1 = require("./errors.js");
@@ -43,7 +43,7 @@ class WalletConnectWallet {
         this._options = config.options;
         this._network = config.network;
         this._web3ModalConfig = config.web3ModalConfig || {};
-        this.web3Modal = new standalone_1.Web3Modal(Object.assign(Object.assign({}, this._web3ModalConfig), { projectId: this._options.projectId, walletConnectVersion: 2 }));
+        this.web3Modal = new standalone_1.WalletConnectModal(Object.assign(Object.assign({}, this._web3ModalConfig), { projectId: this._options.projectId, walletConnectVersion: 2 }));
     }
     connect() {
         var _a;
diff --git a/lib/esm/adapter.js b/lib/esm/adapter.js
index 6ef476874f6392cc466d65a9268f5708af09cb8b..f45deee90bf6bea6fb16dcec58a73802db1bd9b8 100644
--- a/lib/esm/adapter.js
+++ b/lib/esm/adapter.js
@@ -1,4 +1,4 @@
-import { Web3Modal } from '@web3modal/standalone';
+import { WalletConnectModal } from '@walletconnect/modal';
 import WalletConnectClient from '@walletconnect/sign-client';
 import { getSdkError } from '@walletconnect/utils';
 import { ClientNotInitializedError, Web3ModalError } from './errors.js';
@@ -28,7 +28,7 @@ export class WalletConnectWallet {
         this._options = config.options;
         this._network = config.network;
         this._web3ModalConfig = config.web3ModalConfig || {};
-        this.web3Modal = new Web3Modal({
+        this.web3Modal = new WalletConnectModal({
             ...this._web3ModalConfig,
             projectId: this._options.projectId,
             walletConnectVersion: 2,
diff --git a/lib/types/adapter.d.ts b/lib/types/adapter.d.ts
index 99e8c2f2ef1aa411005fe78cfbeb3817d2848165..1b1a12b699c6d3196a58384343b8d7fa39e90ee8 100644
--- a/lib/types/adapter.d.ts
+++ b/lib/types/adapter.d.ts
@@ -1,7 +1,7 @@
-import { Web3ModalConfig } from '@web3modal/standalone';
+import { WalletConnectModalConfig } from '@walletconnect/modal';
 import WalletConnectClient from '@walletconnect/sign-client';
 import type { SignClientTypes } from '@walletconnect/types';
-export type WalletConnectWeb3ModalConfig = Omit<Web3ModalConfig, 'walletConnectVersion' | 'projectId'>;
+export type WalletConnectWeb3ModalConfig = Omit<WalletConnectModalConfig, 'walletConnectVersion' | 'projectId'>;
 export interface WalletConnectWalletAdapterConfig {
     network: WalletConnectChainID;
     options: SignClientTypes.Options;
diff --git a/package.json b/package.json
index ad9109a51e944f5a791ea82b2d0d23b744a3a6ac..a73f6d29d0ddd27f8703ee0d15d49dba477298c2 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,6 @@
   "dependencies": {
     "@walletconnect/sign-client": "^2.1.3",
     "@walletconnect/utils": "^2.1.3",
-    "@web3modal/standalone": "^2.4.1"
+    "@walletconnect/modal": "^2.6.2"
   }
 }

Without using @walletconnect/modal, the walletconnect modal is not showing up. Let me know if you would like me to submit a PR for this/or if you need more info.

@way2ex
Copy link
Contributor

way2ex commented May 24, 2024

Thanks a lot for your remind.
We will consider updating to @walletconnect/modal and release a new version soon.

@way2ex
Copy link
Contributor

way2ex commented Jul 16, 2024

@tronweb3/[email protected] is released. Thanks for your attention.

@MiracleWeb3
Copy link

@tronweb3/[email protected] is released. Thanks for your attention.

Thank you a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants