forked from coinbase/onchainkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
1 / 11 of 1 issue completedLabels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsgood first issueGood for newcomersGood for newcomersinvalidThis doesn't seem rightThis doesn't seem right
Description
Reviewer's Guide
This pull request refactors provider composition and dynamic configuration for Wagmi and React Query, introduces auto-connection and new MiniKit hooks, overhauls batch ENS resolution into bulk utilities and hooks, modernizes the advanced send flow with a dedicated recipient state hook, makes wallet sign-up optional in the modal, simplifies CSS to use font imports and external style sheets, and updates the build and release toolchain (Vite config, version injection, CI hardening, prerelease script).
Sequence diagram for AutoConnect in MiniKitProvider
sequenceDiagram
participant MiniKitProvider
participant AutoConnect
participant Wagmi
participant FarcasterSDK
participant User as actor
User->MiniKitProvider: Loads MiniKit app
MiniKitProvider->AutoConnect: Renders children
AutoConnect->FarcasterSDK: Checks sdk.context
FarcasterSDK-->>AutoConnect: Returns context (in mini app)
AutoConnect->Wagmi: Checks isConnected, isConnecting
AutoConnect->Wagmi: Finds farcasterFrame or farcasterMiniApp connector
AutoConnect->Wagmi: Calls connect({ connector })
Wagmi-->>AutoConnect: Connects wallet
Sequence diagram for batch ENS/basename resolution via useAddresses
sequenceDiagram
participant Component
participant useAddresses
participant getAddresses
participant PublicClient
Component->useAddresses: useAddresses({ names: [...] })
useAddresses->getAddresses: getAddresses({ names })
getAddresses->PublicClient: getEnsAddress({ name }) for each name
PublicClient-->>getAddresses: Returns address/null for each
getAddresses-->>useAddresses: [address1, address2, ...]
useAddresses-->>Component: { data: [address1, address2, ...] }
Sequence diagram for WalletModal sign up button logic
sequenceDiagram
participant WalletModal
participant useOnchainKit
participant User as actor
User->WalletModal: Opens modal
WalletModal->useOnchainKit: Reads config.wallet.signUpEnabled
alt signUpEnabled === false
WalletModal-->>User: Hides Sign Up button
WalletModal-->>User: Shows 'Connect your wallet' only
else signUpEnabled === true or undefined
WalletModal-->>User: Shows Sign Up button and divider
end
Class diagram for new SendProvider and recipient state management
classDiagram
class SendProvider {
- selectedToken: PortfolioTokenWithFiatValue | null
- fiatAmount: string | null
- cryptoAmount: string | null
- lifecycleStatus: SendLifecycleStatus
- ethBalance: number | undefined
- recipientState: RecipientState
- updateRecipientInput(input: string)
- validateRecipientInput(input: string)
- selectRecipient(selection: RecipientState)
- deselectRecipient()
+ handleTokenSelection(token: PortfolioTokenWithFiatValue)
+ handleResetTokenSelection()
}
class RecipientState {
<<interface>>
phase: 'input' | 'validated' | 'selected'
input: string
address: Address | null
displayValue: string | null
}
SendProvider --> RecipientState : uses
Class diagram for new MiniKitProvider and AutoConnect
classDiagram
class MiniKitProvider {
+context: Context.FrameContext | null
+autoConnect: boolean
+notificationProxyUrl: string
+connectors: Connector[]
+value: MiniKitContextType
}
class AutoConnect {
+enabled: boolean
+useEffect()
}
MiniKitProvider --> AutoConnect : wraps children with
Class diagram for new batch ENS/basename resolution utilities and hooks
classDiagram
class getAddresses {
+getAddresses(names: string[]): Promise<Address[]>
}
class useAddresses {
+useAddresses(names: string[], queryOptions?): QueryResult<Address[]>
}
getAddresses <.. useAddresses : used by
Class diagram for new MiniKit hooks
classDiagram
class useComposeCast {
+composeCast(params)
+composeCastAsync(params)
}
class useViewCast {
+viewCast(params)
+viewCastAsync(params)
}
class useIsInMiniApp {
+isInMiniApp: boolean
}
Class diagram for OnchainKitProvider and clientMetaManager
classDiagram
class OnchainKitProvider {
+sessionId: string
+isMiniKit: boolean
+useEffect() // initializes clientMetaManager
}
class clientMetaManager {
+init(isMiniKit)
+isInitialized()
+getClientMeta(): Promise<ClientMeta>
-clientMeta: ClientMeta | null
-initPromise: Promise<ClientMeta> | null
}
OnchainKitProvider --> clientMetaManager : initializes
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Refactor default provider setup into separate Wagmi and QueryClient components |
|
src/DefaultOnchainKitProviders.tsx |
| Add AutoConnect component and MiniKit-specific hooks |
|
src/minikit/components/AutoConnect.tsxsrc/minikit/hooks/useIsInMiniApp.tsxsrc/minikit/hooks/useComposeCast.tsxsrc/minikit/hooks/useViewCast.tsxsrc/core/clientMeta/clientMetaManager.ts |
| Batch ENS/Basename resolution and hook support |
|
src/identity/utils/getAddresses.tssrc/identity/utils/getNames.tssrc/identity/utils/getSocials.tssrc/identity/hooks/useAddresses.ts |
| Refactor advanced send flow with dedicated recipient state hook |
|
src/wallet/components/wallet-advanced-send/components/SendAddressInput.tsxsrc/wallet/components/wallet-advanced-send/components/SendAddressSelector.tsxsrc/wallet/components/wallet-advanced-send/components/SendProvider.tsxsrc/wallet/components/wallet-advanced-send/hooks/useRecipientState.tsxsrc/wallet/components/wallet-advanced-send/types.ts |
| Make wallet sign-up optional in WalletModal |
|
src/wallet/components/WalletModal.tsx |
| Simplify CSS to external imports and Tailwind base |
|
src/styles/index.csssrc/styles/ock.css |
| Enhance build/release toolchain and CI hardening |
|
vite.config.tsscripts/publish-prerelease.js.github/workflows/release.yml |
Possibly linked issues
- chore: version packages 🚀 (coinbase#2427) #8: The issue serves as a comprehensive review guide detailing all the extensive changes implemented in the PR, including package upgrades, provider refactoring, new MiniKit hooks, and build pipeline updates.
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull
request title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment@sourcery-ai summaryon the pull request to
(re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others. - Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Originally posted by @sourcery-ai[bot] in #17 (comment)
Sub-issues
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationduplicateThis issue or pull request already existsThis issue or pull request already existsgood first issueGood for newcomersGood for newcomersinvalidThis doesn't seem rightThis doesn't seem right
Projects
Status
Done
Status
Done