* When `chain` or `chains` prop passed to UI components like `ConnectButton` , `ConnectEmbed` etc are updated - make sure that those chain makes their way to connection manager ( useActiveWalletChain ) and to all the wallets ( getChain )
This is mainly for dashboard - where users can modify the chains and we need to update the chain objects when that's done
<!-- start pr-codex -->
---
## PR-Codex overview
This PR updates wallet adapters to use cached chain objects for improved performance.
### Detailed summary
- Added `getCachedChainIfExists` function to retrieve cached chain objects.
- Updated `getChain` method in wallet adapters to use cached chains.
- Removed unnecessary `cacheChains` function calls.
- Added `useConnectionManager` hook to manage defined chains store.
> The following files were skipped due to too many changes: `packages/thirdweb/src/react/native/ui/connect/ConnectButton.tsx`, `packages/thirdweb/src/wallets/manager/index.ts`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
Added a new test case to `sign-message.test.ts` to verify the signature generated by the `signMessage` function when provided with a specific message and private key.
### What changed?
The test file `sign-message.test.ts` in the `thirdweb` package has been updated to include a new test case that checks the signature generated by the `signMessage` function.
### How to test?
Run the test suite for the `thirdweb` package to ensure all tests, including the new one, pass correctly.
### Why make this change?
To enhance test coverage and ensure that the `signMessage` function generates the expected signature when given specific inputs.
---
FIXES: #3912
### TL;DR
This PR fixes the handling of account switching within a connected wallet in Sign-In with Ethereum (SIWE) authentication states.
### What changed?
- Updated the `isLoggedIn` function to accept an `address` argument and added more checks to validate the JWT and the associated address.
- Pass `account` as a new parameter to `useSiweAuth` to ensure the correct account is handled.
- Removed experimental server external packages from `next.config.mjs`.
- Removed `@shikijs/twoslash` dependency from `package.json`.
### How to test?
1. Switch accounts within a connected wallet and ensure the SIWE authentication state updates correctly.
2. Verify that the application runs without errors related to the removed experimental packages and dependencies.
### Why make this change?
To ensure better account management and state consistency within the SIWE authentication framework, and to remove unused or experimental configurations for better stability and performance.
---
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on enhancing account switching in SIWE authentication states.
### Detailed summary
- Updated functions to include `account` parameter for SIWE authentication
- Changed login and authentication logic
- Added `getAuthResult` function for server-side auth
- Updated dependencies and imports
> 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 -->
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on adding a conditional test suite for the `eip1559` function based on the presence of a secret key.
### Detailed summary
- Conditionally runs the `eip1559` test suite based on the presence of `TW_SECRET_KEY` environment variable.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR skips unit tests requiring a secret key and updates a URL in the downloadMock function.
### Detailed summary
- Skips unit tests in claimERC20, claimERC721, and claimERC1155 if no secret key available
- Updated URL in `downloadMock` function in `storage.ts`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
## TL;DR
This PR introduces support for Telegram OAuth across various components of the thirdweb packages.
## What changed?
- Added 'Telegram' as an OAuth option in `WALLETS` array within the `constants.ts` file.
- Introduced `telegramIconUri` constant and its usage across the application.
- Updated `socialIcons` object and methods to handle new Telegram icon.
- Enhanced `WalletImage` components to recognize and display the Telegram icon.
- Included Telegram in OAuth login path determination within `oauthSignIn.ts`.
- Updated enumerations and type definitions to include Telegram.
- Modified `InAppNativeConnector` and `InAppWebConnector` to handle Telegram OAuth redirection.
## How to test?
1. Navigate to the authentication section in the application.
2. Check for the new 'Sign in with Telegram' option.
3. Attempt to sign in using a Telegram account and verify the successful login flow.
## Why make this change?
To expand the authentication options available to users, providing more flexibility and convenience. Telegram is a popular messaging app, and integrating it as an OAuth option can enhance user experience.
---
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to add `Telegram` as a supported authentication option across various parts of the application.
### Detailed summary
- Added `Telegram` as an authentication option in various files
- Included `TELEGRAM_ICON` in multiple components
- Updated social icons with `telegramIconUri`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR enhances error handling and callback functionality in various components like `TransactionButton` and `CreateDirectListingButton`.
### Detailed summary
- Added guidance for error handling and callbacks in `TransactionButton`
- Updated comments in `CreateDirectListingButton`
- Improved error handling info in `ClaimButton`
- Added examples and instructions for handling errors and callbacks in components
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
Happened to write this quick test when debugging an issue
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to add a test for the `numberToHex` function in `hex.ts`.
### Detailed summary
- Added a test suite for `numberToHex` function in `hex.ts`
- Tested conversion of a number to a hexadecimal string with specified size and sign
- Asserted the correctness of the conversion result
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
This PR updates the fetch utility in the Thirdweb package to exclude the authorization token from being sent when the endpoint is related to the pay service. This ensures that requests to 'pay.' prefixed URLs are always made on behalf of the 'developer' rather than the 'end user.' It introduces a new function, isPayUrl, to determine if the URL belongs to the pay service.
---
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to add a `type` field to `DirectListing` and `EnglishAuction` types in the marketplace extensions.
### Detailed summary
- Added `type` field to `DirectListing` and `EnglishAuction` types
- Updated components to handle `type` field for pricing display
- Refactored contract role checks for Marketplace v3 compatibility
> The following files were skipped due to too many changes: `apps/dashboard/src/contract-ui/tabs/listings/components/list-form.tsx`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to add `msw` for network call mocking, update dependencies, and enhance wallet integration tests.
### Detailed summary
- Added `msw` for network call mocking in tests
- Updated dependencies
- Improved wallet integration tests with new functions
> 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 -->
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR introduces enhancements related to wallet interactions, contract calls, and event monitoring in the application.
### Detailed summary
- Added functionality to pre-authenticate users via email or phone number
- Enhanced wallet connection components with account abstraction and gas sponsorship options
- Updated wallet connection buttons to support account abstraction and gas sponsorship
- Improved wallet information retrieval with examples
- Expanded capabilities for fetching wallet balances for native and specific tokens
- Enhanced contract call preparation with examples of different method signatures and value options
- Improved contract event monitoring with event extensions and custom event watching
- Updated contract read hooks to automatically update on contract changes
> The following files were skipped due to too many changes: `packages/thirdweb/src/react/core/hooks/contract/useReadContract.ts`, `packages/thirdweb/src/transaction/actions/send-transaction.ts`, `packages/thirdweb/src/react/web/hooks/transaction/useSendTransaction.tsx`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to update test files in `PayEmbed-disconnected.test.tsx` and `PayEmbed.test.tsx` to use `waitFor` for asynchronous operations.
### Detailed summary
- Added `waitFor` for asynchronous operations in test files
- Updated test cases to handle asynchronous rendering and interactions
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
### TL;DR
Fix occasional iframe error when logging in with oauth
### What changed?
Removed error throwing for invalid event type in OAuth login flow.
### How to test?
Attempt OAuth login and ensure no errors occur related to iframes.
### Why make this change?
To prevent unnecessary exceptions which impede the OAuth login user experience.
---
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR adds Korean and French locales, updates wallet connection screens, and adds smart wallet content.
### Detailed summary
- Added Korean and French locales
- Updated wallet connection screens with new locales
- Added smart wallet content for Korean locale
> The following files were skipped due to too many changes: `packages/thirdweb/src/react/web/wallets/local/locale/kr.ts`, `packages/thirdweb/src/react/web/wallets/shared/locale/kr.ts`, `packages/thirdweb/src/react/web/wallets/local/locale/fr.ts`, `packages/thirdweb/src/react/web/wallets/local/locale/ja.ts`, `packages/thirdweb/src/react/web/wallets/shared/locale/ja.ts`, `packages/thirdweb/src/react/web/wallets/shared/locale/fr.ts`, `packages/thirdweb/src/react/web/ui/ConnectWallet/locale/kr.ts`, `packages/thirdweb/src/react/web/ui/ConnectWallet/locale/fr.ts`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
2024-08-01 08:07:23 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
### TL;DR
Improved social authentication flexibility by adding support for an optional `redirectUrl` parameter and a new `mobile` mode.
### What changed?
- `getLoginPath.ts`: Added handling for `redirectUrl` and a new mode `mobile`.
- `native-auth.ts`: Updated social login to use `mobile` mode and include `redirectUrl`.
- `auth/middleware.ts`: Enhanced error handling for recovery codes by attempting fallback recovery code method.
- `native-connector.ts`: Fixed typo in console error message and ensured `redirectUrl` defaults correctly for native social logins.
### How to test?
1. Initiate a social login with the added `mobile` mode and verify if the `redirectUrl` functions correctly.
2. Trigger an error scenario in recovery code fetching and check that the fallback method is attempted and appropriate error is thrown if both fail.
3. Check the console for corrected error messages.
### Why make this change?
To increase the robustness and flexibility of social authentication by supporting mobile specific workflows and enhanced error resilience.
---
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to enhance mobile authentication in the thirdweb application by updating redirect URLs and recovery code handling.
### Detailed summary
- Updated authentication mode to "mobile" instead of "popup"
- Added `redirectUrl` parameter for mobile authentication
- Improved error handling for recovery code retrieval
- Modified login path generation to support mobile authentication
> ✨ 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 `CreateDirectListingButton` component for the Marketplace v3, allowing users to create direct listings for NFTs.
### Detailed summary
- Added `CreateDirectListingButton` component
- Updated `getPayMetadata` function
- Added test file for `CreateDirectListingButton`
- Updated `CreateDirectListingButton` component implementation
> ✨ 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 error messages for connection management hooks used outside `ThirdwebProvider`.
### Detailed summary
- Added `useConnectionManagerCtx` to provide specific error messages
- Updated hooks to use `useConnectionManagerCtx` instead of `useConnectionManager`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
FIXES: DASH-104
<!-- start pr-codex -->
## PR-Codex overview
This PR focuses on fixing the `useAutoConnectCore` function in `useAutoConnect.ts` to handle auto-connect for wallets from the "All wallets" screen.
### Detailed summary
- Fixed autoConnect for wallets from "All wallets" screen
- Added `createWallet` import
- Updated logic to handle lastActiveWalletId not found in availableWallets
> ✨ 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 German localization to the `thirdweb` package, including translations and locale updates for various wallet-related components.
### Detailed summary
- Added German localization to the `thirdweb` package
- Updated `LocaleId` type to include `"de_DE"`
- Added German translations for wallet connection screens and instructions
- Updated locale files for smart wallets, injected wallets, and shared wallets to include German translations
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
## Problem solved
- add refund status
## 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 adds a new status "REFUNDED" to the `getStatus.ts` file and defines a new `SwapType` type with values "SAME_CHAIN" and "CROSS_CHAIN".
### Detailed summary
- Added status "REFUNDED" to possible statuses in `getStatus.ts`
- Defined new `SwapType` type with values "SAME_CHAIN" and "CROSS_CHAIN"
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
FIXES: DASH-50
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to temporarily disable CLI login and provide guidance on using secret keys for specific commands.
### Detailed summary
- Temporarily disable CLI login functionality
- Provide guidance on passing secret keys for specific commands
- Check for missing -k flag in certain commands
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->