Skip to content

Conversation

@vortex-hue
Copy link
Contributor

This PR adds a MiniPay wagmi connector package and improves the user experience with connection status feedback. The implementation follows the official MiniPay documentation patterns to ensure proper integration.

Summary of implementation

  1. Restructured MiniPay connector configuration: Replaced custom miniPayConnector with standard injected() connector (listed first in connectors array) as per MiniPay documentation requirements
  2. Implemented auto-connect on page load: Added automatic connection when MiniPay is detected, following the pattern connect({ connector: connectors[0] })
  3. Added connection status display: Created a centered status box that shows real-time MiniPay connection progress (detecting, connecting, success, error states)
  4. Removed button hiding logic: Connect button now displays even when MiniPay is detected (as per user request)
  5. Updated to use useAccount() from wagmi: Replaced custom hooks with standard wagmi useAccount() hook for address retrieval

Motivation and Context

The previous implementation used a custom connector which caused type compatibility issues and connection failures. The "unknown account #0" error indicated that the wallet wasn't connecting properly. This PR restructures the implementation to follow the official MiniPay documentation exactly:

  • Uses injected() connector (listed first)
  • Auto-connects on page load using connectors[0]
  • Uses useAccount() from wagmi for address retrieval
  • Properly waits for MiniPay provider initialization

Dependencies

  • wagmi
  • @reown/appkit
  • No new dependencies required

How Has This Been Tested?

  1. TypeScript compilation: Verified no TypeScript errors (yarn tsc --noEmit)
  2. Linting: All ESLint checks pass
  3. Build: Successfully builds without errors (yarn build)
  4. Connection logic:
    • Tested MiniPay detection using waitForMiniPayProvider() utility
    • Verified auto-connect triggers when MiniPay is detected
    • Confirmed connection status updates display correctly

Note: Full integration testing requires running the app in MiniPay browser/standalone app (Android/iOS device with Developer Mode enabled).


Checklist:

  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

@sirpy @Lewis - Please review.

pbkompasz and others added 30 commits August 4, 2025 09:45
…ority (GoodWallet, Valora), Google socials, MiniPay labeling; migrate connect flows to AppKit
… refactor, useConnectionInfo, restore XDC, clean TODOs, fix keys and ESLint warnings
…Chat, AccountDetails, Web3ReactManager, Web3Network)
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 and others added 9 commits November 27, 2025 16:55
- Only add MiniPay connector to array when MiniPay is actually detected
- Prevents 'connector not found' errors when MiniPay is not available
- Fallback to injected() connector for other wallets
# Conflicts:
#	src/language/locales/af/catalog.po
#	src/language/locales/ar/catalog.po
#	src/language/locales/ca/catalog.po
#	src/language/locales/cs/catalog.po
#	src/language/locales/da/catalog.po
#	src/language/locales/de/catalog.po
#	src/language/locales/el/catalog.po
#	src/language/locales/en/catalog.po
#	src/language/locales/es-419/catalog.po
#	src/language/locales/es/catalog.po
#	src/language/locales/fi/catalog.po
#	src/language/locales/fr/catalog.po
#	src/language/locales/he/catalog.po
#	src/language/locales/hi/catalog.po
#	src/language/locales/hu/catalog.po
#	src/language/locales/it/catalog.po
#	src/language/locales/ja/catalog.po
#	src/language/locales/ko/catalog.po
#	src/language/locales/nl/catalog.po
#	src/language/locales/no/catalog.po
#	src/language/locales/pl/catalog.po
#	src/language/locales/pt-BR/catalog.po
#	src/language/locales/pt/catalog.po
#	src/language/locales/ro/catalog.po
#	src/language/locales/ru/catalog.po
#	src/language/locales/sr/catalog.po
#	src/language/locales/sv/catalog.po
#	src/language/locales/tr/catalog.po
#	src/language/locales/uk/catalog.po
#	src/language/locales/vi/catalog.po
#	src/language/locales/zh-CN/catalog.po
#	src/language/locales/zh-TW/catalog.po
#	src/language/locales/zh/catalog.po
#	src/pages/gd/Swap/SwapCore/mentoReserve.tsx
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.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 20000 lines

@vortex-hue vortex-hue closed this Dec 12, 2025
@vortex-hue vortex-hue deleted the fix/minipay-auto-connect branch December 12, 2025 11:48
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.

3 participants