Skip to content

Commit

Permalink
fix(app): update walletconnect web3 onbaord due to breaking change (p…
Browse files Browse the repository at this point in the history
…assportxyz#1446)

* fix(app): update walletconnect web3 onbaord due to breaking change

* fix(app): add sample env variable and yarn lock

* Update app/utils/onboard.ts

include default value

Co-authored-by: Aminah <[email protected]>

* fix(app): linting

* fix(app): add default projectId

---------

Co-authored-by: Aminah <[email protected]>
  • Loading branch information
Tim Schultz and aminah-io authored Jul 7, 2023
1 parent 71f76b8 commit 117f4d1
Showing 4 changed files with 123 additions and 156 deletions.
1 change: 1 addition & 0 deletions app/.env-example.env
Original file line number Diff line number Diff line change
@@ -69,3 +69,4 @@ NEXT_PUBLIC_ENABLE_TESTNET=on
# NEXT_PUBLIC_MAINTENANCE_MODE_ON=
NEXT_PUBLIC_MAINTENANCE_MODE_ON=["2023-06-07T21:00:00.000Z", "2023-06-08T22:15:00.000Z"]

NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=YOUR_WALLET_CONNECT_PROJECT_ID
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
"@web3-onboard/injected-wallets": "^2.9.0",
"@web3-onboard/ledger": "^2.4.6",
"@web3-onboard/react": "^2.8.4",
"@web3-onboard/walletconnect": "^2.3.8",
"@web3-onboard/walletconnect": "2.4.0",
"@web3-onboard/walletlink": "^2.0.4",
"broadcast-channel": "^4.11.0",
"did-session": "^1.0.0",
8 changes: 6 additions & 2 deletions app/utils/onboard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { init } from "@web3-onboard/react";
import injectedModule from "@web3-onboard/injected-wallets";
import ledgerModule from "@web3-onboard/ledger";
import walletConnectModule from "@web3-onboard/walletconnect";
import walletConnectModule, { WalletConnectOptions } from "@web3-onboard/walletconnect";

// RPC urls
const MAINNET_RPC_URL = process.env.NEXT_PUBLIC_PASSPORT_MAINNET_RPC_URL as string;
@@ -12,7 +12,11 @@ const injected = injectedModule();

// web3Onboard modules

const walletConnect = walletConnectModule();
const walletConnectOptions: WalletConnectOptions = {
projectId: (process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID as string) || "default-project-id",
};

const walletConnect = walletConnectModule(walletConnectOptions);
// Include ledger capabilities
const ledger = ledgerModule();

Loading

0 comments on commit 117f4d1

Please sign in to comment.