### TL;DR
This PR modifies the `generateFromAbi` function to ensure that the `format` function from Prettier is properly awaited. This solves issues with file writing inconsistencies.
### What changed?
- Added `await` to the `format` function calls within `generateFromAbi`.
### How to test?
1. Run the `generateFromAbi` script.
2. Ensure that generated files are consistently formatted.
### Why make this change?
This change ensures that the Prettier formatting is correctly applied before the files are written, resolving any inconsistencies and potential bugs caused by non-awaited formatting.
---
<!-- start pr-codex -->
## PR-Codex overview
This PR fixes the issue where the transaction button did not respect the theme prop in the `SponsoredTxPreview` component.
### Detailed summary
- Fixed transaction button theme prop issue in `SponsoredTxPreview`
- Added `isValidTheme` and `parseTheme` functions in `buttons.tsx`
- Updated `parseTheme` to validate theme and return default if invalid
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
To prevent popups from Coinbase wallet being blocked in Safari, pre-connection actions have been added. Specifically, popups will be displayed immediately upon connection request and before transaction preprocessing.
### What changed?
1. Removed the `COINBASE` constant and its related connection flow.
2. Integrated `onConnectRequested` optional function for wallets.
3. Updated Coinbase wallet's `onConnectRequested` to show the popup immediately.
4. Added `onTransactionRequested` to show popup before transaction processing.
### How to test?
1. Initiate connection with Coinbase wallet and observe that the popup appears immediately.
2. Perform a transaction with Coinbase wallet and ensure the popup is not blocked.
3. Test across different browsers, focusing on Safari.
### Why make this change?
Safari has stricter rules regarding popups, and the previous delay in showing the popup led to it being blocked. This change ensures a smoother user experience for Coinbase wallet users on Safari by addressing the popup blocking issue.
---
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to enhance wallet connectivity and transaction handling in the application.
### Detailed summary
- Added `onConnectRequested` and `onTransactionRequested` functions to wallet interfaces
- Updated wallet connection and transaction handling logic
- Preloaded wallet providers for smoother user experience
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
Updated the queryKey used in the useQuery hook to also include the walletInfo.data?.name parameter, ensuring that injectedWalletLocale queries are correctly keyed and updated when the wallet name changes.
### What changed?
The queryKey array in the useQuery hook was updated from `["injectedWalletLocale", localeId]` to `["injectedWalletLocale", localeId, walletInfo.data?.name]`.
### How to test?
1. Ensure the application runs without errors.
2. Verify that locale-specific wallet names are correctly handled when displayed in the UI.
### Why make this change?
The change ensures that the locale-based queries are properly identified and updated when the wallet name changes, preventing potential stale data from being used in the UI.
---
Refactor `usePreloadWalletProviders` to utilize `useQueries` from `@tanstack/react-query`. This change optimizes wallet provider preloading, ensuring a non-blocking, and parallel fetching of necessary providers. Removes the `useEffect` based logic.
---
<!-- start pr-codex -->
## PR-Codex overview
This PR fixes an issue with the Coinbase wallet popup not opening on Safari and improves inAppWallet web performance.
### Detailed summary
- Fixed Coinbase wallet popup not opening on Safari
- Improved inAppWallet web performance
- Added `usePreloadWalletProviders` hook
- Preloaded wallet providers for Coinbase and inApp wallet
- Updated `ConnectButton`, `ConnectEmbed`, `usePreloadWalletProviders`, and `ConnectModalContent` components
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### What changed?
This PR introduces several key enhancements to the `ContractFunction` and `CodeOverview` components:
1. **Environment Selection**: A new `extensionNamespace` state is added based on the enabled extensions in the contract ABI (`ERC20`, `ERC721`, `ERC1155`). This state determines the namespace used for different contract extensions.
2. **Code Snippets Generation**: Functions `buildJavascriptSnippet` and `buildReactSnippet` are added to dynamically generate code snippets based on the extension namespace and contract function type (read, write, event).
3. **Snippet Formatting**: The `formatSnippet` function is modified to include the newly generated code snippets, replacing placeholders with actual values.
### How to test?
1. **Setup**: Ensure you have a contract with varying enabled extensions (`ERC20`, `ERC721`, `ERC1155`).
2. **Test Snippet Generation**: For each contract, navigate to the code overview and ensure the generated snippets correspond to the contract's extensions and function types.
3. **Verify Placeholder Replacement**: Confirm that placeholders in the code (`{{contract_address}}`, `{{wallet_address}}`, etc.) are correctly replaced with real values.
### Why make this change?
This update enhances the flexibility and readability of the code snippets provided to developers, making it easier to interact with contract functions by displaying relevant code based on the contract's supported extensions and environment.
---
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to enhance code snippets generation for different contract extensions based on enabled extensions.
### Detailed summary
- Added logic to determine extension namespace based on enabled extensions
- Implemented functions to build JavaScript and React code snippets
- Created mapping for extension namespaces and functions
- Updated snippet formatting to include extension-specific code generation based on function and extension namespace
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
The focus of this PR is to optimize imports, remove unused code, and refactor UI components in the `CodeOverview` component.
### Detailed summary
- Removed unused imports and variables
- Refactored UI structure for better organization
- Updated code snippet rendering logic
- Improved tab functionality for functions and events
> The following files were skipped due to too many changes: `src/contract-ui/tabs/code/components/code-overview.tsx`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
The focus of this PR is to dynamically import the `CoinbaseWalletSDK` to resolve cloudflare bundler issues.
### Detailed summary
- Dynamically import `CoinbaseWalletSDK` to avoid bundler issues
- Updated import statement for `ProviderInterface`
- Removed unnecessary imports
- Refactored `getCoinbaseWebProvider` function to dynamically import `CoinbaseWalletSDK`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
Enhances the `ContractFunction` component by adding interactive code snippets for various environments, helping users utilize contract functions in their applications.
### What changed?
- Added code snippets under `use this function in your app` section.
- Introduced `CodeEnvironment` state to toggle between environments (e.g., JavaScript).
- Added import for `CodeSegment`, `COMMANDS`, `formatSnippet`, and `CodeEnvironment`.
- Removed console log statements and unused imports.
### How to test?
- Verify that code snippets appear as expected for different contract functions.
- Toggle between environments and ensure the correct code is displayed.
### Why make this change?
Provides developers with ready-to-use code snippets, streamlining the integration process for contract functions into applications.
---
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to refactor code related to contract function execution and UI components in the contract overview tab.
### Detailed summary
- Refactored code execution logic for contract functions
- Added `CodeSegment` component for displaying code snippets
- Updated function usage display in UI based on function type and state mutability
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
Add `abitype` library and refactor the codebase to utilize `formatAbiItem` for formatting contract functions and events.
### What changed?
- Added `abitype` library to `package.json` and `pnpm-lock.yaml` files.
- Refactored multiple files to replace existing ABI formatting logic with `formatAbiItem` from `abitype`.
- `contract-function.tsx`: Integrated `formatAbiItem` for formatting contract functions and events.
- `code-overview.tsx`: Unified ABI formatting using `formatAbiItem`.
- Removed dependency on `resolveMethod` from `thirdweb`.
### How to test?
1. Verify the `abitype` library installation in `package.json` and `pnpm-lock.yaml`.
2. Check the refactored files for correct usage of `formatAbiItem`.
3. Run the project and ensure no runtime errors occur related to ABI formatting.
4. Test contract functions and events to ensure they are formatted correctly.
### Why make this change?
To improve the consistency and reliability of ABI formatting across the codebase by using a dedicated library (`abitype`).
---
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to introduce the `abitype` package, update dependencies, and refactor code snippets in the `CodePlayground` component.
### Detailed summary
- Introduced `abitype` package
- Updated dependencies
- Refactored code snippets in `CodePlayground.tsx`
- Modified imports and functions in various files
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
Optimized the Accounts Table component by adding useMemo hooks to calculate total accounts and limit the end value of queries. Adjusted the logic to ensure safe conversion of total accounts to a number type.
### What changed?
- Added `useMemo` for calculating `totalAccountsNum` and `maxQueryEndValue`.
- Adjusted the `accountsQuery` to use `maxQueryEndValue` for its `end` parameter.
- Simplified the total pages calculation.
### How to test?
1. Navigate to the Accounts tab.
2. Ensure the total number of accounts loads correctly.
3. Check that pagination works as expected, especially when navigating to the last page.
### Why make this change?
This change improves the performance and reliability of the Accounts Table component by ensuring that calculations and query parameters are optimized and accurate.
---
<!-- start pr-codex -->
## PR-Codex overview
This PR updates Yarn installation and package versions, enhances test project scripts, and modifies Turbo tasks configuration.
### Detailed summary
- Updated Yarn installation to version 1.22.19
- Updated package versions in the test project
- Modified Turbo tasks configuration for various packages and builds
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
Implement pagination and count querying in the accounts page.
### What changed?
1. Modified `accounts-count.tsx` to use `totalAccounts` from `thirdweb/extensions/erc4337` instead of fetching all accounts.
2. Updated `accounts-table.tsx` to incorporate pagination with the help of `totalAccounts` and `getAccounts` functions from `thirdweb/extensions/erc4337`.
3. Adjusted `page.tsx` to pass the contract to `AccountsCount` and `AccountsTable` components instead of accountsQuery.
4. Introduced pagination controls and page size selection in `accounts-table.tsx`.
### How to test?
1. Navigate to the accounts page.
2. Verify that the total number of accounts is displayed correctly.
3. Check the pagination functionality by navigating through pages and adjusting the page size.
### Why make this change?
To improve the user experience on the accounts page by enabling efficient data fetching and display through pagination.
---
## Problem solved
Short description of the bug fixed or feature added
## Changes made
- [ ] Public API changes: list the public API changes made if any
- [ ] Internal API changes: explain the internal logic changes
## How to test
- [ ] Automated tests: link to unit test file
- [ ] Manual tests: step by step instructions on how to test
## Contributor NFT
Paste in your wallet address below and we will airdrop you a special NFT when your pull request is merged.
```Address: ```
<!-- start pr-codex -->
---
## PR-Codex overview
This PR updates dependencies in `package.json` and `pnpm-lock.yaml`, focusing on versions of `axios`, `@grpc/grpc-js`, and `braces`.
### Detailed summary
- Updated `@grpc/grpc-js` to version `1.10.9`
- Updated `braces` to version `3.0.3`
- Adjusted versions of `axios` and `@ethereumjs/util`
- Updated `fill-range` to version `7.1.1`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
This PR adds support for Modular Core and Modular Extension features, updates contract extension settings UI, and enhances extension management in the contract editor.
### Detailed summary
- Added support for `ModularCore` and `ModularExtension` features
- Updated contract extension settings UI
- Improved extension management in the contract editor
> The following files were skipped due to too many changes: `src/contract-ui/tabs/edit-extensions/components/InstalledExtensionsTable.tsx`, `src/contract-ui/tabs/edit-extensions/components/ExtensionForm.tsx`, `pnpm-lock.yaml`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
- Created a new component 'AddChainToWallet' to facilitate adding chains to wallet.
- Integrated 'AddChainToWallet' button into ChainPageLayout.
- Updated layout.tsx to include 'AddChainToWallet' button and its behavior.
- Refactored chain verification and metadata handling to accommodate the new feature.
- Adjusted related utility functions in utils.ts.
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to update the chainlist components by introducing a new `isVerified` flag and refactoring the rendering logic based on it.
### Detailed summary
- Introduces `isVerified` flag to determine if chain metadata is available
- Updates rendering logic in `ChainListRow` and `ChainListCard` components based on `isVerified`
- Adds `AddChainToWallet` component for connecting to chains
- Adjusts layout and styling based on `isVerified` flag and chain metadata
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
This PR updates dependencies in the project, including `@thirdweb-dev/react`, `@thirdweb-dev/react-core`, and `@thirdweb-dev/sdk`.
### Detailed summary
- Updated `@thirdweb-dev/react` from version 4.7.0 to 4.8.0
- Updated `@thirdweb-dev/react-core` from version 4.7.0 to 4.8.0
- Updated `@thirdweb-dev/sdk` from version 4.0.93 to 4.0.94
> The following files were skipped due to too many changes: `pnpm-lock.yaml`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
This PR improves the toggleService function in `filters.tsx` to correctly handle service selection in the client filters.
### Detailed summary
- Refactored logic to toggle service selection based on existing parameters
- Improved handling of adding/removing services in the search parameters
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
The focus of this PR is to improve chain filtering and display in the dashboard.
### Detailed summary
- Refactored `getChainsToRender` to return more data
- Updated data display to show total, filtered, and displayed chains
- Improved pagination logic to consider filtered chains
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
This PR updates the ESLint configuration to change the severity level of the `no-restricted-syntax` rule for `useEffect` calls from "warn" to "error".
### Detailed summary
- Updated `no-restricted-syntax` rule severity level for `useEffect` calls from "warn" to "error" in `.eslintrc.js`.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- start pr-codex -->
## PR-Codex overview
This PR adds a new ESLint rule to warn against using `useEffect` and suggests using `useQuery` for async functions instead.
### Detailed summary
- Added ESLint rule to warn against using `useEffect` for async functions
- Suggests using `useQuery` instead for async operations
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->