Skip to content

Commit

Permalink
Fix Coinbase Wallet autoconnect (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalzieu authored Nov 12, 2024
1 parent 7f9ef2f commit 3f53b99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 0 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1691,8 +1691,6 @@ PODS:
- React-logger (= 0.74.5)
- React-perflogger (= 0.74.5)
- React-utils (= 0.74.5)
- ReactNativeAvoidSoftinput (4.0.1):
- React-Core
- ReactNativeIosContextMenu (2.5.1):
- ContextMenuAuxiliaryPreview (~> 0.3)
- DGSwiftUtilities
Expand Down Expand Up @@ -1966,7 +1964,6 @@ DEPENDENCIES:
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- ReactNativeAvoidSoftinput (from `../node_modules/react-native-avoid-softinput`)
- ReactNativeIosContextMenu (from `../node_modules/react-native-ios-context-menu`)
- ReactNativeIosUtilities (from `../node_modules/react-native-ios-utilities`)
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
Expand Down Expand Up @@ -2245,8 +2242,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/react/utils"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
ReactNativeAvoidSoftinput:
:path: "../node_modules/react-native-avoid-softinput"
ReactNativeIosContextMenu:
:path: "../node_modules/react-native-ios-context-menu"
ReactNativeIosUtilities:
Expand Down Expand Up @@ -2417,7 +2412,6 @@ SPEC CHECKSUMS:
React-runtimescheduler: db7189185a2e5912b0d17194302e501f801a381e
React-utils: 3f1fcffc14893afb9a7e5b7c736353873cc5fc95
ReactCommon: f79ae672224dc1e6c2d932062176883c98eebd57
ReactNativeAvoidSoftinput: a096aae8faf85c0f3225c2179bccdab00b8b6354
ReactNativeIosContextMenu: e5f972174bd78ab3a552bd6ee4745762ffaa42b3
ReactNativeIosUtilities: 8ea45df073a05d24b9fd75e4ec5fe1de19051466
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
Expand Down
13 changes: 12 additions & 1 deletion utils/evm/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import {
useSetActiveWallet,
useSwitchActiveWalletChain,
} from "thirdweb/react";
import { Account } from "thirdweb/wallets";
import { Account, createWallet } from "thirdweb/wallets";
import { useExternalWalletPickerContext } from "../../features/ExternalWalletPicker/ExternalWalletPicker.context";
import { DEFAULT_SUPPORTED_CHAINS } from "./wallets";
import config from "../../config";

let signerSingleton: Signer | undefined = undefined;
let accountSingleton: Account | undefined = undefined;
Expand Down Expand Up @@ -182,5 +183,15 @@ export const useAutoConnectExternalWallet = () => {
// thirdweb external wallet
useAutoConnect({
client: thirdwebClient,
// The Coinbase wallet callbackURL needs to be set
// here also for autoconnect to work
wallets: [
createWallet("com.coinbase.wallet", {
appMetadata: config.walletConnectConfig.appMetadata,
mobileConfig: {
callbackURL: `https://${config.websiteDomain}/coinbase`,
},
}),
],
});
};

0 comments on commit 3f53b99

Please sign in to comment.