Skip to content

Conversation

@vortex-hue
Copy link

@vortex-hue vortex-hue commented Sep 8, 2025

Description

Summary: Complete migration from Web3 Onboard to Reown AppKit with prioritized wallet support, social login, and MiniPay compatibility.

Issue Fixed: #593 - Integrate with reown appkit

Motivation: The existing Web3 Onboard integration was becoming outdated and lacked the flexibility needed for prioritized wallet display and social authentication. Reown AppKit provides better wallet management, analytics, and modern React patterns that align with current best practices.

Context: This migration enables:

  • Prioritized wallet display (GoodWallet, Valora) in WalletConnect modal
  • Google social login integration
  • Better MiniPay support for mobile users
  • Modern React hooks and TypeScript support
  • Improved analytics and monitoring capabilities

How Has This Been Tested?

Local Development Testing:

  • yarn install - All dependencies installed successfully
  • yarn build - Project compiles without errors
  • ESLint checks pass - No linting errors
  • TypeScript compilation - All type errors resolved

Code Quality:

  • Removed all legacy @web3-onboard dependencies
  • Eliminated unused imports and dead code
  • Fixed TypeScript type mismatches
  • Resolved ESLint warnings

Checklist:

  • Prioritized wallet display (GoodWallet, Valora) in WalletConnect modal
  • Google social login integration
  • Better MiniPay support for mobile users
  • Improved analytics and monitoring capabilities
  • Removed all useActiveWeb3React and useActiveOnboard usages
  • Replaced with AppKit hooks where applicable
  • Clean build with no @web3-onboard dependencies

Description by Korbit AI

What change is being made?

Integrate Reown AppKit across the app, replace Web3 Onboard with AppKit-based wallet and network handling, and introduce wallet priorities and Google socials; update multiple components to consume AppKit hooks (account, network, label, etc.), and adjust explorer links and token network handling accordingly.

Why are these changes being made?

Converge to AppKit for consistent wallet/connect flows and network state, replacing the old Onboard integration; this simplifies state management, improves compatibility with new wallet providers, and enables wallet prioritization and Google social login support.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@korbit-ai
Copy link

korbit-ai bot commented Sep 8, 2025

Korbit doesn't automatically review large (3000+ lines changed) pull requests such as this one. If you want me to review anyway, use /korbit-review.

@vortex-hue vortex-hue changed the title Feat appkit Feat: Integrate Reown AppKit; replace Web3 Onboard; add wallet priorities and Google socials Sep 8, 2025
@vortex-hue
Copy link
Author

Hi @L03TJ3 , can you have a look of my draft pr for this task at your earliest convenience, so I can know if am on the right track and what's remaining for me to do, thanks alot 🙂

package.json Outdated
"@babel/runtime": "^7.18.9",
"@gooddollar/good-design": "^0.4.24",
"@gooddollar/goodprotocol": "2.0.34-beta.1",
"@gooddollar/good-design": "^0.4.21",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be updated/merged with master to reflect latest changes

return (
<TransactionWrapper>
<TransactionState url={getExplorerLink(chainId, hash, 'transaction')} dataAttr="external_explorer">
<TransactionState url={getExplorerLink(+(chainId ?? 1), hash, 'transaction')} dataAttr="external_explorer">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<TransactionState url={getExplorerLink(+(chainId ?? 1), hash, 'transaction')} dataAttr="external_explorer">
<TransactionState url={getExplorerLink(+(chainId ?? 42220), hash, 'transaction')} dataAttr="external_explorer">

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We default to celo, not ethereum mainnet

{i18n._(t`Disconnect`)}
</WalletAction>
)}
{(walletInfo?.name || isMiniPay()) &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is minipay should be variable, outside of render

//eslint-disable-next-line @typescript-eslint/no-unused-vars
const [{ wallet, connecting }, connect, disconnect] = useConnectWallet()

const { address } = useAppKitAccount()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a wrapper hook, something like 'useConnectionInfo' that returns things like wallet-info/chainId/account

replace everywhere we use more then one appkit hook

text={buttonText}
web3Action={noop}
supportedChains={[SupportedChains.CELO, SupportedChains.MAINNET, SupportedChains.FUSE, SupportedChains.XDC]}
supportedChains={[SupportedChains.CELO, SupportedChains.MAINNET, SupportedChains.FUSE]}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One merge with master has incorrect resolved conflicts.
How to resolve conflicts:

  1. master branch changes are almost always leading.
  2. when not sure, don't assume what should be resolution, ask the team please!

XDC is an added/new supported chain, and this should not be removed by your PR

const { chainId, error, active } = useActiveWeb3React()
const { initialized } = useAppKitState()
const { chainId } = useAppKitNetwork()
// TODO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

return (
<View style={{ ...styles }}>
<NavLink key={route} to={route} onPress={handleInternal}>
<NavLink key={index} to={route} onPress={handleInternal}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never use index as key


const { account, error } = useActiveWeb3React()
const { address } = useAppKitAccount()
// TODO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the todo?

@@ -0,0 +1,11 @@
export const WalletLabels: Readonly<string[]> = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have the different wallets been tested?
The main ones that should work are: minipay, goodwallet (using wallet-connect), valora.
metamask.

)
}, [address, open])

const handleError = useCallback(async (e) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this change?

@L03TJ3
Copy link
Collaborator

L03TJ3 commented Oct 3, 2025

Also, wallet-connect does not load when I run it from localhost. it works for you?

@vortex-hue vortex-hue marked this pull request as ready for review October 3, 2025 19:36
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We failed to fetch the diff for pull request #604

You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.

@korbit-ai
Copy link

korbit-ai bot commented Oct 3, 2025

Korbit doesn't automatically review large (3000+ lines changed) pull requests such as this one. If you want me to review anyway, use /korbit-review.

@vortex-hue
Copy link
Author

Also, wallet-connect does not load when I run it from localhost. it works for you?

works well actually: https://www.loom.com/share/992e55bd5efc410aa76e3702737aad4b?sid=a14f2393-1071-40eb-90a7-1f9268ff41be

Resolved conflicts and API compatibility:
- AppBar.tsx: Integrated with new AppKit hooks
- NetworkModal/index.tsx: Combined AppKit with activeNetworksByFeature
- ClaimBalance.tsx: Updated to use new SDK API
- OldClaim.tsx: Kept AppKit connection handling
- WalletBalance/index.tsx: Fixed chainId type conversion
- All locale files: Accepted master's updated translations
- yarn.lock: Regenerated with updated dependencies

Note: New SDK version - useG no longer accepts chainId parameter
@vortex-hue vortex-hue requested a review from L03TJ3 November 10, 2025 22:02

// walletInfo provided by useConnectionInfo

const miniPay = React.useMemo(() => isMiniPay(), [])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see a need for useMemo, also, following style across the dapp, we import useMemo, not using from React namespace


const { G$ } = useG$Balance(5, chainId)
const reserveEnabled = isFeatureActive('reserveEnabled', Number(chainId))
const { G$ } = useG$Balance(5, Number(chainId))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your merge with master went wrong, this should not have any changes. master is the code that is expected

}/${currencyB === ETHER ? WETH[chainId].address : currencyId(currencyB)}`}
>
Receive W{Currency.getNativeCurrencySymbol(chainId)}
Receive W{Currency.getNativeCurrencySymbol(getSafeChainId(chainId))}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use assigning 'safeChainId' as const, and re-use that. no sense in repeating the same method throughout this component

const [toAddNetwork, setToAddNetwork] = useState<SupportedChains | undefined>()

const networkLabel: string | null = error ? null : (NETWORK_LABEL as any)[chainId]
const networkLabel: string | null = error ? null : (NETWORK_LABEL as any)[+(chainId ?? 1)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default fallback should be 42220

borderBottomRightRadius={12}
>
<WalletBalance balances={balances} chainId={chainId} />
<WalletBalance balances={balances} chainId={+(chainId ?? 1)} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fallback default is 42220

dispatch(
addTransaction({
chainId: chainId!,
chainId: +(chainId ?? 1)!,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fallback 42220, everywhere

}

// Supported chain IDs for validation
const SUPPORTED_CHAINS = [1, 122, 42220] // MAINNET, FUSE, CELO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be based on SupportedChains (import from web3sdk-v2)

// params[0].gasPrice = gasPriceSettings[chainId].maxFeePerGas
delete params[0].gasPrice
params[0] = { ...params[0], ...gasPriceSettings[chainId] }
params[0] = { ...params[0], ...gasSettings }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how third-party provider handle nested/chain gasPriceSettings

for safety, please revert back to only passing down the current connected chain gas settings ...gasSettings[Number(chainId)]

XDC:
process.env.REACT_APP_GOODID_XDC_EXPLORER ??
`https://api.etherscan.io/v2/api?chainid=50&apikey=${process.env.REACT_APP_ETHERSCAN_KEY}&`,
XDC: process.env.REACT_APP_GOODID_XDC_EXPLORER ?? 'https://xdc.blocksscan.io/api?&',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the explorer endpoint changed exactly?

}
return false
}, [connect, activeChainFeatures])
// const handleConnect = useCallback(async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out and not fixed?

The user-flow is when clicking on the claim-button when not connected, it should trigger the connect flow. What happens now is that when I click, all the button say is 'connecting..' but I am not actually connecting

@L03TJ3
Copy link
Collaborator

L03TJ3 commented Nov 18, 2025

@vortex-hue What also needs to be fixed is the 'disconnect' flow when using wallet-connect.
there is from the dapp seemingly no way to disconnect a wallet-connect connected wallet

@L03TJ3 L03TJ3 linked an issue Nov 21, 2025 that may be closed by this pull request
4 tasks
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

Successfully merging this pull request may close these issues.

[Feat] Integrate with reown appkit

3 participants