2288 Commits
Author SHA1 Message Date
Jonas Danielsandgithub-actions[bot] 5dcc8c57ab Version Packages (#3426)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-27 10:27:48 -07:00
gregfromstl f9f5250b58 feat(auth): fetch ecosystem auth options from server (#3528)
<!-- start pr-codex -->

## PR-Codex overview
The focus of this PR is to refactor ecosystem wallet related functions, update UI components, and integrate new auth options fetching mechanism.

### Detailed summary
- Refactored ecosystem wallet related functions for better clarity and consistency.
- Updated UI components in various files for improved user experience.
- Integrated a new mechanism to fetch auth options for ecosystem wallets.
- Added a loading screen component for better user feedback during data fetching.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-27 17:12:13 +00:00
gregfromstl 4dae68796e fix(ts): in-app wallet user op signatures (#3507)
### TL;DR

This PR updates the message handling in the in-app-account module of the thirdweb package. Specifically, it modifies the message decoding process and removes an unused import.

### What changed?

- Modified the IFrameWallet class to handle messages that are bytes or strings.
- Removed the `uint8ArrayToString` import which was no longer needed.

### How to test?

1. Run the existing test suite to ensure all tests pass.
2. Manually test the in-app wallet functionality to validate the message handling changes.

### Why make this change?

To improve the robustness and maintainability of the in-app-account module in the thirdweb package by cleaning up the code and ensuring proper handling of different message types.

---
2024-06-27 03:58:32 +00:00
gregfromstl c330d0d815 fix(ens): enhance ENS resolution tests and error handling (#3513)
<!-- start pr-codex -->

## PR-Codex overview
This PR enhances ENS resolution in `thirdweb` extension. It now returns null if no ENS exists for an address.

### Detailed summary
- Updated `resolveName` to return null if no ENS exists
- Added error handling to catch specific error code
- Updated tests to reflect changes in ENS resolution behavior

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-27 03:41:20 +00:00
MananTank 16ea2bc684 Fix openWindow not working inside iframe (#3521)
<!-- start pr-codex -->

## PR-Codex overview
The focus of this PR is to fix the wallet app not opening when using `ConnectButton` inside an iframe.

### Detailed summary
- Updated `WalletConnectConnection.tsx` to handle opening wallet app inside iframes
- Modified `openWindow.ts` to address issues with `window.open` on iOS and WebViews

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-27 03:25:53 +00:00
Jonas Daniels fbb1493f1e [Chore] Enhance tsconfig and error handling across multiple packages (#3506) 2024-06-25 21:43:50 -07:00
gregfromstl 9b46a730b3 fix(transaction): update EIP721 to EIP712 naming in getEip721Domain and prepare-transaction (#3480)
<!-- start pr-codex -->

## PR-Codex overview
This PR updates transaction options and serialization to use EIP712 instead of EIP721.

### Detailed summary
- Renamed `EIP721TransactionOptions` to `EIP712TransactionOptions`
- Renamed `EIP721SerializedTransaction` to `EIP712SerializedTransaction`
- Updated function parameters and return types accordingly

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-25 21:57:36 +00:00
jnsdls 75a2736962 [Chore] Add conditional check in PayEmbed-disconnected test using TW_SECRET_KEY (#3490)
### TL;DR
Update PayEmbed and PayEmbed-disconnected tests to include conditional running based on TW_SECRET_KEY.

### What changed?
- Added conditional checks for TW_SECRET_KEY in PayEmbed-disconnected.test.tsx and PayEmbed.test.tsx
- Ensured tests run only if TW_SECRET_KEY is defined

### How to test?
1. Ensure TW_SECRET_KEY is set in your environment
2. Run the updated tests
3. Verify that the tests only execute if TW_SECRET_KEY is present

### Why make this change?
To add more robust control over test execution based on the presence of secret keys.

---

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to refactor test files for `PayEmbed` component by using `describe.runIf` to conditionally run tests based on the environment secret key.

### Detailed summary
- Refactored test files for `PayEmbed` component to conditionally run tests based on the secret key environment variable using `describe.runIf`.
- Updated test cases to improve readability and maintainability.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-25 21:02:49 +00:00
gregfromstl edd904bd9e fix(auth): add warning and improve parameter checks in verifySignature (#3488)
### TL;DR
Added a warning that gets triggered once when the EOA signature verification fails and neither the chain nor the client parameter is provided in the verifySignature function. This is crucial to guide users on setting up smart accounts properly.

### What changed?
- Introduced a `warningTriggered` flag to ensure the warning is only logged once.
- Added a warning message to notify about missing chain and client parameters when EOA signature verification fails.
- Updated `isVerifyContractWalletSignatureParams` to explicitly check for undefined values in chain and client parameters.

### How to test?
1. Call the `verifySignature` function without providing the `chain` and `client` parameters.
2. Observe the console for the warning message.
3. Ensure the warning triggers only once even with multiple calls to `verifySignature` without the required parameters.

### Why make this change?
This change improves the developer experience by providing clear guidance when critical parameters are missing for using smart accounts with the Auth module. This helps in debugging and ensures proper setup for smart accounts.

---

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to add a warning message when verifying a signature without a chain or client provided.

### Detailed summary
- Added a warning message when verifying a signature without a chain or client
- Updated the `isVerifyContractWalletSignatureParams` function to check for `options.chain` and `options.client` values

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-25 20:10:06 +00:00
kien-ngo 88070422ff Export getClaimConditionById for Drop1155 (#3481)
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on exporting `getClaimConditionById` for Drop1155 in the `erc1155.ts` file.

### Detailed summary
- Export `getClaimConditionById` for Drop1155
- Import `GetClaimConditionByIdParams` from generated file

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-25 19:39:36 +00:00
gregfromstl 95cceff1a9 test(ts): improve airdrop test robustness (#3489)
This pull request updates multiple test cases to use the `sendAndConfirmTransaction` method instead of the `sendTransaction` method. The tests affected include those for airdropERC1155WithSignature, airdropERC20WithSignature, airdropERC721WithSignature, claimERC1155, claimERC20, and claimERC721. The main goal is to ensure transactions are confirmed within the tests for improved reliability and accuracy.

### TL;DR
Replaced `sendTransaction` with `sendAndConfirmTransaction` in multiple test cases to ensure transactions are confirmed.

### What changed?
- Updated `airdropERC1155WithSignature.test.ts` to use `sendAndConfirmTransaction`
- Updated `airdropERC20WithSignature.test.ts` to use `sendAndConfirmTransaction`
- Updated `airdropERC721WithSignature.test.ts` to use `sendAndConfirmTransaction`
- Updated `claimERC1155.test.ts` to use `sendAndConfirmTransaction`
- Updated `claimERC20.test.ts` to use `sendAndConfirmTransaction`
- Updated `claimERC721.test.ts` to use `sendAndConfirmTransaction`

### How to test?
Run the test suite to ensure all tests pass with the updated method.

### Why make this change?
This change improves the reliability and accuracy of the test cases by ensuring that transactions are confirmed within the tests.

---

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates transaction handling in airdrop ERC contracts tests to use `sendAndConfirmTransaction` instead of `sendTransaction`.

### Detailed summary
- Replaced `sendTransaction` with `sendAndConfirmTransaction` in airdrop ERC contracts tests for better transaction handling.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-25 11:58:37 -07:00
jnsdls 29102740a5 [Chore] Update PayEmbed test to increase timeout for connect wallet button (#3484)
<!-- start pr-codex -->

## PR-Codex overview
The focus of this PR is to skip a flaky test for `eth_getLogs` and add a timeout to a test for rendering a connect wallet button.

### Detailed summary
- Skipped flaky test for `eth_getLogs`
- Added a timeout to the test for rendering a connect wallet button

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-25 17:58:33 +00:00
CryptoFennecandManan Tank 70b31ddcd0 Fixed switch chain on WalletConnect (#3465)
Co-authored-by: Manan Tank <[email protected]>
2024-06-24 12:38:05 -07:00
IDubuque 860f61c727 Isaac/pay usage tracker schema (#3447)
## Problem solved

- update usage tracker schema with pay fields
- - chainName: String
- - tokenSymbol: String
- - dstChainId: UInt64
- - dstTokenAddress: String
- - dstChainName: String
- - dstTokenSymbol: String
- - msLatency: UInt64
- - toAmountUSDCents: UInt64
- - secondaryProvider: String
- - onRampId: String

## Changes made

- [x] service-utils: Update usage tracker schema

## 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 new fields to the `UsageEvent` schema in the `usage.ts` file of the `service-utils` package for Cloudflare worker usage tracking.

### Detailed summary
- Added `chainName`, `tokenSymbol`, `dstChainId`, `dstTokenAddress`, `dstChainName`, `dstTokenSymbol`, `msLatency`, `toAmountUSDCents`, `secondaryProvider`, and `onRampId` fields to `UsageEvent` schema.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-24 19:10:32 +00:00
Manan Tank 02a70b928d Pay UI improvements (#3421) 2024-06-24 14:53:01 +00:00
gregfromstl c35a9adb69 docs(contributing): add instructions for testing React Native SDK changes (#3459)
### TL;DR

This PR adds a section for testing changes in the React Native SDK to the contributing guidelines and updates the formatting of type versions in the `package.json` file.

### What changed?

1. **Contributing Guidelines**: Added detailed instructions for testing React Native changes by creating a local React Native project, linking local changes, and using tools like wml and watchman.

2. **Formatting in `package.json`**: Updated the formatting of type versions to a more compact and readable style.

### How to test?

1. Follow the newly added instructions in the contributing guidelines to create a local React Native project and test changes using wml and watchman.
2. Verify that the `package.json` file's type versions formatting is correct and does not affect the build process.

### Why make this change?

This change aims to provide clearer guidance for contributors who need to test React Native SDK changes and improve the readability of the `package.json` file.

---

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update the `package.json` file in the `thirdweb` package and provide detailed instructions for testing React Native changes.

### Detailed summary
- Updated the `typesVersions` configuration in `package.json`
- Added instructions for testing React Native changes locally
- Provided steps for setting up `wml` and `watchman` for monitoring changes
- Included guidance on linking the local SDK to a React Native project

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-24 08:41:26 +00:00
Jelilat Anofiu 2eb6278a47 fix: update chain import paths (#3458) 2024-06-23 22:42:07 -07:00
gregfromstl 224463175e [Feature] Add session transaction storage (#3451)
https://linear.app/thirdweb/issue/CNCT-1398/ts-sdk-store-in-session-transactions-in-wallet

This update introduces the ability to track transactions during a "session" within the thirdweb SDK. The key additions and changes are:

1. Exporting `getSessionTransactions` from `transaction-store.js`.
2. Adding calls to `addTransactionToSession` in `send-gasless-transaction.ts` and `send-transaction.ts`.
3. Creating a new test file `transaction-store.test.ts` to cover the transaction session functionalities.
4. Including new constants in `settings.ts` specific to session storage keys.
5. Extending `LocalStorage` class functionalities to handle transaction session data.

These changes will act as the foundation of the v1 "transactions" page in the react SDK

---

<!-- start pr-codex -->

---

## PR-Codex overview
This PR adds a `getTransactionStore` function to retrieve transaction stores and updates transaction handling in the `sendTransaction` and `sendGaslessTransaction` actions.

### Detailed summary
- Added `getTransactionStore` function to retrieve transaction stores for addresses
- Updated `sendTransaction` action to store transactions
- Added `addTransactionToStore` function to update transaction stores
- Updated `sendGaslessTransaction` action to store gasless transactions

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-23 21:35:20 +00:00
jnsdls ce77f84407 [Refactor] Simplify ConnectModal properties and related components (#3453)
### TL;DR
Refactor the `ConnectWallet` modal to clean up and streamline the code.

### What changed?
- Refactored the `ConnectModal`, `ConnectEmbed`, `WalletSelector`, `SmartWalletConnectUI`, `InAppWalletFormUI`, etc. to replace the nested `connectModal` props with flatter independent props.
- Improved prop handling using `useMemo` hooks for better performance.
- Cleaned up redundant imports and types.

### How to test?
1. Ensure all modals (`ConnectModal`, `ConnectEmbed`) render correctly with different sizes (compact/wide).
2. Verify functionality of Wallet Selector and Connect UI components across various scenarios e.g. different wallet types, sizes, and settings.

### Why make this change?
To improve the maintainability and readability of the code, making it easier to manage and extend in the future. It also optimizes prop handling for better performance.

---

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating wallet connection modals and button sizes for different locales.

### Detailed summary
- Updated wallet connection modals and button sizes for multiple locales
- Removed unnecessary size property from ConnectModal
- Standardized size property across different components
- Improved consistency and clarity in wallet connection UI components

> The following files were skipped due to too many changes: `packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletSelectionUI.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/screens/StartScreen.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx`, `packages/thirdweb/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/shared/WalletConnectConnection.tsx`, `packages/thirdweb/src/react/web/wallets/ecosystem/EcosystemWalletFormUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletFormUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-23 00:05:31 +00:00
jnsdls eaa509359f [Refactor] Remove unused ConnectUIContext and refactor wallet connection components (#3449)
This pull request aims to clean up the codebase by removing unused packages and files. The following tasks were carried out:

### What changed?

1. Deleted the `useWalletConnectionCtx.ts` file from the `thirdweb` package.
2. Deleted the `wallet-connection.tsx` file from the `thirdweb` package.
3. Updated `ConnectButton.tsx`, `AllWalletsUI.tsx`, `AnyWalletConnectUI.tsx`, `ConnectEmbed.tsx`, and other UI components to remove references to the deleted files.
4. Modified various other files in the `thirdweb` and `react` packages to ensure that no part of the codebase relies on the removed files.

### How to test?

1. Run the project and navigate through the UI to ensure that the wallet connection features are functioning as expected without any errors.
2. Check the console for any warnings or errors related to missing files or dependencies.

### Why make this change?

Removing unused packages and files helps to streamline the codebase, improving maintainability, and potentially reducing build times. This cleanup is part of ongoing efforts to ensure the codebase remains clean and efficient.

---

<!-- start pr-codex -->

---

## PR-Codex overview
This PR refactors context usage in the connect wallet UI and updates locale types for in-app wallets.

### Detailed summary
- Refactored context usage in connect wallet UI
- Updated locale types for in-app wallets
- Renamed functions for better clarity

> The following files were skipped due to too many changes: `packages/thirdweb/src/react/web/wallets/shared/GetStartedScreen.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/shared/CoinbaseSDKConnection.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/useConnectModal.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletSelectionUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx`, `packages/thirdweb/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/ecosystem/EcosystemWalletFormUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/screens/StartScreen.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx`, `packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx`, `packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletFormUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/shared/WalletConnectConnection.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-23 00:05:29 +00:00
gregfromstl fe775166d4 [Chore] Add missing walletconnect exports to RN wallet exports (#3444)
### TL;DR

Adds wallet connect functions to react native.

### What changed?

- Added `createWalletConnectClient`, `createWalletConnectSession`, `disconnectWalletConnectSession`, `getActiveWalletConnectSessions`, and `DefaultWalletConnectRequestHandlers` exports to `wallets.native.ts`
- Added type exports `WalletConnectClient` and `WalletConnectSession` to `wallets.native.ts`

### How to test?

1. Import the new functions and types in a React Native project.
2. Test creating, managing, and disconnecting WalletConnect sessions.

### Why make this change?

To provide WalletConnect support in the React Native SDK for better wallet management and interoperability.

---
2024-06-21 19:53:42 +00:00
Jonas Daniels 5f880b2b35 [Chore] Add conditional check in ERC721 mintTo test using TW_SECRET_KEY (#3445) 2024-06-21 12:34:07 -07:00
kumaryash90 ea46c70d7a Fix eip155 check (#3443)
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on fixing the EIP155 check for create2 factory deployment.

### Detailed summary
- Updated error handling logic in `any-evm-constants.ts` and `is-eip155-enforced.ts`
- Replaced `arr.some` with `forEach` loop for improved error checking efficiency

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-21 19:19:35 +00:00
Jonas Daniels c60d9086be [Chore] Add conditional check in ERC1155 claimTo test using TW_SECRET_KEY (#3442) 2024-06-21 22:48:32 +05:30
gregfromstl fc8dda15ef chore: upgrade TS (#3434)
<!-- start pr-codex -->

## PR-Codex overview
The focus of this PR is to update TypeScript versions across multiple packages to `5.5.2` and adjust some configurations accordingly.

### Detailed summary
- Updated `typescript` to version `5.5.2` in multiple `package.json` files
- Adjusted `typescript.tsdk` setting in `vscode/settings.json`
- Modified function in `resolve-abi.ts` for explicit typing

> The following files were skipped due to too many changes: `packages/thirdweb/package.json`, `pnpm-lock.yaml`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-21 07:10:27 +00:00
gregfromstl a3a4008831 feat(wallets): add disconnect functionality to WalletConnectReceiverScreen (#3429)
<!-- start pr-codex -->

## PR-Codex overview
The focus of this PR is to add a WalletConnect disconnect screen in the `thirdweb` package.

### Detailed summary
- Added a new component `WalletConnectDisconnectScreen`
- Updated `WalletConnectReceiverScreen` to handle disconnecting WalletConnect sessions
- Imported necessary dependencies and types
- Implemented disconnect functionality with error handling

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-21 03:23:30 +00:00
gregfromstl 6429acc1f7 feat(wallets): Adds dawn wallet support (#3381)
Adds Dawn Wallet since it's WC settings filter it out
2024-06-20 20:55:05 +00:00
jnsdls 1fb60a65be format with biome (#3415)
## 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 formatting scripts to use `biome` instead of `prettier`.

### Detailed summary
- Updated formatting scripts in multiple package.json files
- Replaced `prettier` with `biome` for code formatting
- Minor code formatting changes in various files

> The following files were skipped due to too many changes: `legacy_packages/sdk/src/evm/common/any-evm-utils/deployCreate2Factory.ts`, `apps/dashboard/src/contract-ui/tabs/overview/components/LatestEvents.tsx`, `apps/dashboard/src/pages/[chain_id]/[...paths].tsx`, `legacy_packages/sdk/src/evm/core/classes/contract-roles.ts`, `legacy_packages/sdk/src/core/schema/properties.ts`, `legacy_packages/wallets/src/evm/connectors/blocto/index.ts`, `legacy_packages/sdk/src/evm/common/any-evm-utils/getCreate2FactoryAddress.ts`, `legacy_packages/sdk/src/evm/core/classes/erc-20.ts`, `legacy_packages/react/src/payments/additional.d.ts`, `legacy_packages/sdk/src/evm/core/classes/internal/marketplace/marketplace-auction.ts`, `legacy_packages/react-core/src/evm/hooks/async/roles.ts`, `legacy_packages/react/src/wallet/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts`, `legacy_packages/sdk/src/evm/core/classes/erc-721.ts`, `legacy_packages/sdk/src/evm/common/any-evm-utils/getCreate2FactoryDeploymentInfo.ts`, `legacy_packages/sdk/src/evm/common/claim-conditions/processClaimConditionInputs.ts`, `legacy_packages/sdk/src/evm/core/classes/erc-1155.ts`, `legacy_packages/sdk/src/evm/integrations/thirdweb-checkout.ts`, `legacy_packages/sdk/src/evm/core/classes/contract-royalty.ts`, `legacy_packages/wallets/src/evm/wallets/abstract.ts`, `legacy_packages/auth/src/next/router-pages/types/index.ts`, `apps/dashboard/src/contract-ui/tabs/events/components/events-feed.tsx`, `legacy_packages/wallets/src/evm/connectors/smart-wallet/lib/erc4337-provider.ts`, `legacy_packages/merkletree/src/merkletree/MerkleTree.ts`, `legacy_packages/sdk/src/evm/core/classes/internal/erc1155/erc-1155-standard.ts`, `legacy_packages/sdk/src/evm/core/classes/extension-manager.ts`, `legacy_packages/cli/src/core/types/sync-disk-cache.d.ts`, `legacy_packages/auth/src/next/router-app/routes/switch-account.ts`, `legacy_packages/sdk/src/evm/contracts/prebuilt-implementations/pack.ts`, `legacy_packages/auth/src/next/index.ts`, `legacy_packages/react/src/wallet/ConnectWallet/screens/Buy/PaymentSelection.tsx`, `legacy_packages/react/src/components/modalElements.tsx`, `legacy_packages/wallets/src/evm/connectors/gcp-kms/signer.ts`, `legacy_packages/auth/src/next/router-app/routes/login.ts`, `legacy_packages/auth/src/next/router-app/types/index.ts`, `legacy_packages/sdk/src/evm/core/classes/internal/contract-wrapper.ts`, `legacy_packages/sdk/src/evm/core/classes/marketplacev3-english-auction.ts`, `legacy_packages/wallets/src/evm/index.ts`, `legacy_packages/react/src/wallet/ConnectWallet/screens/SwapTransactionsScreen.tsx`, `legacy_packages/cli/src/generate/command.ts`, `legacy_packages/sdk/src/evm/core/classes/marketplacev3-direct-listings.ts`, `legacy_packages/wallets/src/evm/wallets/aws-kms.ts`, `legacy_packages/wallets/src/evm/connectors/wallet-connect/qrModalOptions.d.ts`, `apps/dashboard/src/pages/api/og/chain/[chainId].tsx`, `legacy_packages/react/src/wallet/wallets/embeddedWallet/ExportPrivateKey.tsx`, `apps/dashboard/src/pages/api/og/contract.tsx`, `legacy_packages/sdk/src/evm/common/modular/compatibleExtensions.ts`, `legacy_packages/crypto/src/utils/uint8array-extras.d.ts`, `apps/dashboard/src/pages/api/og/profile.tsx`, `apps/dashboard/src/pages/api/og/publishedContract.tsx`, `legacy_packages/react/src/wallet/wallets/magicEden/magicEdenWallet.tsx`, `apps/dashboard/src/graphql/generated.ts`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-20 20:36:16 +00:00
Jonas Daniels fab5cd43be Update changesets and dependencies (#3428) 2024-06-20 12:06:37 -07:00
gregfromstl b24e9b2320 feat(wallet): add support for ecosystem wallets (#3270)
This PR adds a new wallet type called `ecosystemWallet` to the thirdweb SDK.

### TL;DR

- New `ecosystemWallet` added to `thirdweb` SDK.

### What changed?

- `wallets.ts`: Added new export for `ecosystemWallet`
- `ConnectButtonProps.ts`: Adjusted types to account for new wallet.
- `create-wallet.ts`: Added new case for handling `ecosystemWallet` in the `createWallet` function.
- `types.ts`: Defined new types for `ecosystemWallet`.
- Updated various internal files to integrate `ecosystemWallet` functionality.

### How to test?

- Ensure the `ecosystemWallet` can be created and connected using different account types (smart account, direct connection, etc.)
- Test the new `integratorId` feature, which allows integration with a designated ecosystem.
- Validate that autoConnect functionality works as expected with `ecosystemWallet`.

### Why make this change?

This change aims to facilitate the integration of third-party ecosystem wallets into the thirdweb SDK, improving the overall flexibility and usability of the SDK for different blockchain ecosystems.

---

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a minor update to `thirdweb` by adding ecosystem wallet UI and integrating ecosystemWallet to TS SDK.

### Detailed summary
- Added ecosystem wallet UI
- Integrated ecosystemWallet to TS SDK
- Updated wallet details for various platforms
- Refactored wallet locale types
- Improved wallet connection handling
- Added ecosystem partner permissions functionality

> The following files were skipped due to too many changes: `packages/thirdweb/src/wallets/ecosystem/is-ecosystem-wallet.ts`, `packages/thirdweb/src/wallets/__generated__/wallet/com.payperless/index.ts`, `packages/thirdweb/src/wallets/in-app/web/lib/auth/base-login.ts`, `packages/thirdweb/src/wallets/__generated__/wallet/fun.tobi/index.ts`, `apps/playground-web/src/components/code/code-example.tsx`, `packages/thirdweb/src/wallets/in-app/core/wallet/types.ts`, `packages/thirdweb/src/react/web/ui/components/WalletImage.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/useInAppWalletLocale.ts`, `packages/thirdweb/scripts/wallets/generate.ts`, `packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ManageWalletScreen.tsx`, `packages/thirdweb/src/wallets/__generated__/wallet/com.safemoon/index.ts`, `packages/thirdweb/src/wallets/__generated__/wallet-ids.ts`, `packages/thirdweb/src/wallets/ecosystem/is-ecosystem-wallet.test.ts`, `packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts`, `packages/thirdweb/src/wallets/in-app/web/types.ts`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletSelectionUI.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletSocialLogin.tsx`, `packages/thirdweb/src/wallets/in-app/web/lib/auth/abstract-login.ts`, `packages/thirdweb/src/react/web/wallets/ecosystem/EcosystemWalletHeader.tsx`, `packages/thirdweb/src/wallets/ecosystem/get-ecosystem-wallet-info.test.ts`, `packages/thirdweb/src/wallets/in-app/core/authentication/type.ts`, `packages/thirdweb/src/wallets/native/create-wallet.ts`, `packages/thirdweb/src/wallets/__generated__/wallet/app.clot/image.ts`, `packages/thirdweb/src/wallets/__generated__/wallet/co.lifedefi/image.ts`, `packages/thirdweb/src/utils/fetch.ts`, `packages/thirdweb/src/wallets/__generated__/wallet-infos.ts`, `packages/thirdweb/src/wallets/in-app/web/utils/iFrameCommunication/IframeCommunicator.ts`, `packages/thirdweb/src/wallets/ecosystem/get-ecosystem-wallet-info.ts`, `packages/thirdweb/src/wallets/in-app/web/lib/auth/iframe-auth.ts`, `packages/thirdweb/src/react/web/ui/ConnectWallet/screens/PrivateKey.tsx`, `packages/thirdweb/src/wallets/in-app/web/ecosystem.ts`, `packages/thirdweb/src/wallets/in-app/web/lib/auth/index.ts`, `packages/thirdweb/src/wallets/wallet-types.ts`, `packages/thirdweb/src/wallets/create-wallet.ts`, `packages/thirdweb/src/wallets/in-app/core/constants/settings.ts`, `packages/thirdweb/src/wallets/__generated__/wallet/fun.tobi/image.ts`, `packages/thirdweb/src/react/web/utils/usePreloadWalletProviders.ts`, `packages/thirdweb/src/wallets/in-app/web/utils/iFrameCommunication/InAppWalletIframeCommunicator.ts`, `packages/thirdweb/src/react/web/wallets/ecosystem/EcosystemWalletFormUI.tsx`, `packages/thirdweb/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletPassKeyLogin.tsx`, `packages/thirdweb/src/wallets/__generated__/wallet/me.komet/image.ts`, `packages/thirdweb/src/wallets/in-app/core/wallet/index.ts`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx`, `packages/thirdweb/src/wallets/in-app/core/wallet/ecosystem-core.ts`, `packages/thirdweb/src/wallets/__generated__/wallet/com.payperless/image.ts`, `packages/thirdweb/src/wallets/in-app/web/lib/web-connector.ts`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletOTPLoginUI.tsx`, `packages/thirdweb/src/wallets/in-app/web/lib/in-app-account.ts`, `packages/thirdweb/src/wallets/in-app/web/utils/Storage/LocalStorage.ts`, `packages/thirdweb/src/wallets/in-app/web/lib/auth/passkeys.ts`, `packages/thirdweb/src/wallets/__generated__/getWalletInfo.ts`, `packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx`, `packages/thirdweb/src/wallets/__generated__/wallet/xyz.bonuz/image.ts`, `packages/thirdweb/src/react/web/wallets/in-app/InAppWalletFormUI.tsx`, `pnpm-lock.yaml`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-20 16:46:37 +00:00
6e6ab8753d Version Packages (#3423)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-06-20 09:29:11 -07:00
Manan Tank de354305ee Fix Connect UI not able to connect to unknown injected wallet + Fix icon, autoConnect (#3422) 2024-06-20 20:57:44 +05:30
b5a7b9d6d9 Version Packages (#3379)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-06-20 18:01:58 +12:00
joaquim-verges 6818c1194b refactor: update mobile upload to use getClientFetch for fetching (#3417)
<!-- start pr-codex -->

## PR-Codex overview
The focus of this PR is to fix the `uploadMobile` function in the `thirdweb` package to properly handle the `bundleId` parameter.

### Detailed summary
- Updated `UploadFile` type in `types.ts` to include a generic object
- Modified `uploadMobile` function in `uploadMobile.ts` to handle options parameter correctly
- Refactored `uploadBatchMobile` function in `mobile.ts` to use `getClientFetch` for fetching

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-20 03:57:30 +00:00
joaquim-verges 59a846283b fix: always use CustomThemeProvider's theme prop in React (#3416)
### Main issue

StyledComponents come with their own `theme` prop, overriding our own `theme` prop. So instead of trying to use the `theme` prop in our Button component, always use the `CustomThemeProvider` one.

### TL;DR
This PR introduces a change to ensure that the `CustomThemeProvider` and related components respect an undefined `theme` prop. This is achieved by removing the default fallback to the `dark` theme when the `theme` prop is not provided.

### What changed?
- Updated `CustomThemeProvider` to accept `undefined` as a valid `theme` value.
- Modified components that use `CustomThemeProvider` to pass the `theme` prop directly without defaulting to `dark`.
- Replaced direct import and usage of `parseTheme` in `TransactionButton` with wrapping the button in `CustomThemeProvider`.
- Removed unnecessary imports and streamlined theme handling in the `Button` component to utilize `useCustomTheme`.
- Updated `dev:dashboard` script to also filter `./packages/thirdweb`.

### How to test?
- Verify the application operates correctly when the `theme` prop is explicitly set to `undefined` or not provided.
- Ensure all components render with the default theme correctly without any regressions.

### Why make this change?
This change ensures more flexible theme handling in the application and reduces the assumption that a `dark` theme should always be the fallback. This is particularly useful for dynamic theming use cases where the theme might not always be determinable upfront.

---
2024-06-20 03:39:27 +00:00
gregfromstl 7a5d9bc6b8 fix(wallets): add error handling to WalletConnectReceiverScreen and related modules (#3412)
<!-- start pr-codex -->

## PR-Codex overview
This PR refactors error messages and exports for better readability in the Wallet Connect module.

### Detailed summary
- Refactored error messages in Wallet Connect module for clarity.
- Updated exports for Wallet Connect client and session.
- Modified handling of session proposal and request errors.
- Improved error handling in session request fulfillment.
- Updated dependencies and imports for better organization.

> The following files were skipped due to too many changes: `packages/thirdweb/src/wallets/wallet-connect/receiver/session-request.test.ts`, `packages/thirdweb/src/wallets/wallet-connect/receiver/index.ts`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-20 02:58:26 +00:00
jnsdls 5ca9094e26 update dependencies: (#3414)
<!-- start pr-codex -->

## PR-Codex overview
This PR updates dependencies, enables linter rules, and refactors styled components in various files.

### Detailed summary
- Updated `ora` dependency to version `^8.0.1`
- Added `"@typescript-eslint/no-unused-vars": "warn"` to ESLint config
- Updated `@swc/cli` dependency to version `0.3.12`
- Enabled linter rules in `biome.json`
- Refactored styled components in multiple files

> The following files were skipped due to too many changes: `packages/thirdweb/src/react/web/ui/components/formElements.tsx`, `packages/thirdweb/src/react/web/ui/components/modalElements.tsx`, `legacy_packages/unity-js-bridge/package.json`, `legacy_packages/react/src/wallet/ConnectWallet/screens/Buy/swap/SwapScreen.tsx`, `legacy_packages/react/src/wallet/ConnectWallet/Modal/ConnectModalInline.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx`, `legacy_packages/crypto/package.json`, `legacy_packages/chains/package.json`, `legacy_packages/merkletree/package.json`, `packages/thirdweb/src/react/web/ui/ConnectWallet/MenuButton.tsx`, `packages/thirdweb/src/react/web/wallets/in-app/LinkButton.tsx`, `legacy_packages/react/src/wallet/wallets/embeddedWallet/LinkButton.tsx`, `packages/thirdweb/src/react/web/ui/components/Overlay.tsx`, `packages/thirdweb/src/react/web/ui/components/OTPInput.tsx`, `legacy_packages/react/src/components/OTPInput.tsx`, `legacy_packages/react/src/wallet/wallets/safe/SelectAccount.tsx`, `legacy_packages/react/src/wallet/ConnectWallet/Details.tsx`, `legacy_packages/eslint-config-thirdweb/package.json`, `.changeset/khaki-apricots-turn.md`, `legacy_packages/react/src/components/Drawer.tsx`, `legacy_packages/react/src/components/text.tsx`, `packages/thirdweb/src/react/web/ui/components/Drawer.tsx`, `packages/thirdweb/src/react/web/ui/components/text.tsx`, `legacy_packages/wallets/package.json`, `legacy_packages/react/src/wallet/ConnectWallet/screens/SwapTransactionsScreen.tsx`, `packages/thirdweb/src/react/web/ui/components/buttons.tsx`, `legacy_packages/auth/package.json`, `legacy_packages/react/src/components/basic.tsx`, `legacy_packages/storage/package.json`, `.vscode/settings.json`, `packages/thirdweb/src/react/web/ui/components/basic.tsx`, `legacy_packages/react-core/package.json`, `packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx`, `legacy_packages/react/src/wallet/ConnectWallet/NetworkSelector.tsx`, `legacy_packages/react/src/components/buttons.tsx`, `packages/react-native-adapter/package.json`, `legacy_packages/react/src/components/modalElements.tsx`, `packages/service-utils/package.json`, `legacy_packages/cli/package.json`, `apps/playground-web/src/icons/sdks/UnityIcon.tsx`, `legacy_packages/sdk/package.json`, `legacy_packages/react/package.json`, `apps/playground-web/src/icons/sdks/TypeScriptIcon.tsx`, `apps/playground-web/src/components/ui/button.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx`, `apps/playground-web/package.json`, `apps/playground-web/src/icons/sdks/SolidityIcon.tsx`, `package.json`, `apps/dashboard/package.json`, `apps/playground-web/src/icons/thirdweb.tsx`, `packages/thirdweb/package.json`, `apps/playground-web/src/icons/sdks/PythonIcon.tsx`, `apps/playground-web/src/icons/sdks/DotNetIcon.tsx`, `apps/playground-web/src/icons/sdks/GoIcon.tsx`, `apps/playground-web/src/icons/products/contracts/ContractBuildIcon.tsx`, `apps/playground-web/src/icons/products/payments/PaymentsNFTCheckoutIcon.tsx`, `apps/playground-web/src/icons/products/payments/PayIcon.tsx`, `apps/playground-web/src/icons/products/contracts/ContractPublishIcon.tsx`, `apps/playground-web/src/icons/products/wallets/WalletsAuthIcon.tsx`, `apps/playground-web/src/icons/products/contracts/ContractExploreIcon.tsx`, `apps/playground-web/src/icons/solutions/GamingIcon.tsx`, `apps/playground-web/src/icons/products/wallets/WalletsConnectIcon.tsx`, `apps/playground-web/src/icons/products/contracts/ContractDeployIcon.tsx`, `apps/playground-web/src/icons/products/wallets/WalletsInAppIcon.tsx`, `apps/playground-web/src/icons/products/contracts/ContractInteractIcon.tsx`, `apps/playground-web/src/icons/products/infra/InfraRPCIcon.tsx`, `apps/playground-web/src/icons/products/infra/InfraStorageIcon.tsx`, `apps/playground-web/src/icons/products/payments/PaymentsSponsoredIcon.tsx`, `apps/playground-web/src/icons/products/wallets/WalletsSmartIcon.tsx`, `apps/playground-web/src/icons/products/infra/InfraEngineIcon.tsx`, `apps/playground-web/src/components/ui/dropdown-menu.tsx`, `apps/playground-web/src/icons/sdks/ReactIcon.tsx`, `pnpm-lock.yaml`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-20 02:01:29 +00:00
gregfromstl 29a643df2c fix(wallets): always pass a string for in-app wallet signatures (#3411)
### TL;DR

Updated the in-app wallet's `signMessage` function to properly handle different message formats. The function now decodes a message from a string, a `Uint8Array`, or a hex format into a string before signing.

### What changed?

- Imported `uint8ArrayToString` and `hexToString` utilities.
- Updated the `signMessage` method to decode messages from multiple formats (string, `Uint8Array`, and hex).
- Adjusted the type annotations and added in-line comments for clarity.

### How to test?

1. Attempt to sign a message with the in-app wallet using different message formats.
2. Verify that the message is correctly signed in each case without errors.

### Why make this change?

This update ensures that the in-app wallet can handle and correctly process various message formats, improving interoperability and user experience.

---

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on fixing hex-based signatures for in-app wallets by ensuring messages are properly decoded before signing.

### Detailed summary
- Fixed hex-based signatures for in-app wallets
- Added `uint8ArrayToString` import
- Updated `signMessage` method to handle different message types
- Ensured `message` parameter is always passed as a string for signing

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-20 01:32:14 +00:00
d88203a981 feat(react): add useWalletDetailsModal.open.onDisconnect prop to respond to disconnections (#3387)
Co-authored-by: Manan Tank <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-06-20 13:28:58 +12:00
kien-ngo 9f5d472797 More unit tests (#3354)
<!-- start pr-codex -->

## PR-Codex overview
This PR adds test cases for ERC721 minting and ERC1155 claiming extensions in the Thirdweb project.

### Detailed summary
- Added test cases for ERC721 `mintTo` extension
- Added test cases for ERC1155 `claimTo` extension
- Imported necessary functions and constants for testing

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 22:25:21 +00:00
kien-ngo 11423125fa Small typos in docs (#3405)
<!-- start pr-codex -->

## PR-Codex overview
This PR updates the method signature in `read-contract.ts` and adds an event filter in `useContractEvents.ts`.

### Detailed summary
- Updated method signature in `read-contract.ts` to include full function signature
- Added event filter for `tokensClaimedEvent` in `useContractEvents.ts`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 21:13:54 +00:00
omahs 988e10e755 fix: typos (#3399)
Signed-off-by: omahs <[email protected]>
2024-06-19 10:51:41 -07:00
jnsdls db6d2520e7 [Dependencies] Chore: Update dependencies and refactor code consistency (#3392)
The PR primarily focuses on updating the versions of several npm dependencies, notably React, React-DOM, and Zod, ensuring compatibility with their latest major versions. Additionally, various code enhancements were made for better TypeScript type usage, specifically replacing manual type declarations with more precise React types. Unnecessary imports and redundant code blocks were removed to streamline the codebase.

### TL;DR
Updated package versions for React, React-DOM, and Zod, improved TypeScript type safety, and cleaned up the codebase.

### What changed?
- Updated React and React-DOM versions from specific sub-versions to any version within major version 18.
- Changed Zod versioning from specific sub-versions to any version within major version 3.
- Replaced manual React type declarations with standard React types for components and props.
- Removed unnecessary imports and redundant type definitions.
- Updated the `pnpm-lock.yaml` file accordingly.

### How to test?
1. Run `pnpm install` to update the dependencies to their latest versions.
2. Run the test suite to ensure all unit tests pass with the new versions.
3. Manually test the application to verify that no runtime issues occur due to these dependency upgrades.
4. Pay special attention to areas that heavily rely on React types and Zod schemas.

### Why make this change?
To ensure the codebase remains up-to-date with the latest versions of crucial libraries and to improve overall type safety and code quality.

---

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates package versions, switches linter settings, and refactors type imports in various files.

### Detailed summary
- Updated linter settings to disable `enabled` flag in `biome.json`
- Updated package versions in multiple `package.json` files
- Refactored type imports in various files to use `^18` version for `@types/react`

> 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 -->
2024-06-19 09:24:03 +00:00
gregfromstl ff75450c11 feat(wallets): add watchAsset functionality to wallet API (#3388)
### TL;DR
This pull request introduces the `watchAsset` functionality to the injected wallets in the thirdweb package.

### What changed?
A new method `watchAsset` is added to the `createAccount` function and `Account` type. This method allows users to add an ERC-20 asset to their wallet's watchlist.

### How to test?
1. Create an account using the `createAccount` function.
2. Call the `watchAsset` method with appropriate parameters to watch an ERC-20 asset.
3. Verify if the asset is added to the wallet's watchlist.

### Why make this change?
This change is made to enhance the functionality of the injected wallets by allowing users to easily add ERC-20 assets to their watchlist, improving the user experience and making asset management more convenient.

---

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to add `watchAsset` support in injected wallet accounts.

### Detailed summary
- Added `watchAsset` method in injected wallet accounts
- Defined `WatchAssetParams` type for asset watching
- Provided example usage for `watchAsset` method

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 03:15:45 +00:00
gregfromstl c238caf4c5 feat(connect-wallet): support custom chains in WalletConnect (#3372)
Allows use of chains not explicitly specified on the connecting app but specified by the receiver.

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to enhance the Wallet Connect feature by adding support for custom chains and improving session handling.

### Detailed summary
- Added support for custom chains in Wallet Connect feature.
- Enhanced session handling with custom chains in session proposals.
- Updated session proposal tests to include custom chains.
- Improved chain handling in session proposal functions.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 02:40:14 +00:00
gregfromstl d931436036 feat(wallets): add support for wallet_addEthereumChain and wallet_switchEthereumChain (#3371)
<!-- start pr-codex -->

## PR-Codex overview
This PR enhances the WalletConnect functionality by adding support for switching Ethereum chains and adding new chains.

### Detailed summary
- Updated `sign.ts` to include raw message in `account.signMessage`
- Added `checksumAddress` validation in `validateAccountAddress`
- Implemented `handleSwitchChain` for switching Ethereum chains
- Added support for `wallet_addEthereumChain` and `wallet_switchEthereumChain` requests
- Updated types and interfaces for wallet interactions

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 02:40:09 +00:00
gregfromstl 9266254199 fix(wallets): cache walletConnectClient (#3310)
### TL;DR

Implemented a caching mechanism for WalletConnect clients to improve performance and added error messaging for failed connections.

### What changed?

- Introduced a caching mechanism for WalletConnect clients using a WeakMap to store instances.
- Removed redundant console.log error message in WalletConnectReceiverScreen.tsx.
- Updated disconnect message to "Disconnected".

### How to test?

1. Trigger multiple WalletConnect sessions and ensure that the client is retrieved from the cache after the initial creation.
2. Test error handling by forcing a connection failure and verifying that the error message is set correctly.
3. Disconnect a WalletConnect session and ensure the disconnect message is accurate.

### Why make this change?

This change enhances the performance by reducing redundant WalletConnect client creations and improves the clarity of error and disconnect messages.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR optimizes WalletConnect client caching and error handling.

### Detailed summary
- Added caching mechanism for WalletConnect clients
- Improved error message handling during connection establishment
- Updated disconnect message to "Disconnected"

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 02:40:04 +00:00
gregfromstl ac5bb56a2d refactor: update icon usage in ConnectWallet component (#3309)
Replace usage of WalletIcon with new and more specific wallet and coin icons. New icons include GenericWalletIcon, OutlineWalletIcon, and CoinsIcon.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the Connect Modal icons in the `thirdweb` package.

### Detailed summary
- Renamed `WalletIcon` component to `GenericWalletIcon`
- Added new `CoinsIcon` component
- Added `OutlineWalletIcon` component
- Updated icon imports in various files

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 02:39:59 +00:00
gregfromstl b5a71a3eed feat(react): Adds WalletConnect Receiver (#3294)
### TL;DR

Simplified the `ConnectWallet` modal by removing unused icons/components and migrate `wallet-connect` functionalities to receiver.

### What changed?
- Updated wallet-connect imports to use the `receiver` directory instead of the `consumer` directory.
- Removed unused icons and components (`ShuffleIcon`, `KeyIcon`, `SwitchMetamaskAccount`, etc.) from `Details.tsx`.
- Added new `ManageWalletScreen` and `WalletConnectReceiverScreen` components.
- Refactored `MenuButton` into a separate component file.

### How to test?
1. Open the `ConnectWallet` modal.
2. Ensure that the removed components are no longer present in the UI.
3. Test Manage Wallet functionalities by navigating to the new `ManageWalletScreen` and `WalletConnectReceiverScreen`.
4. Verify that wallet-connect functionalities work seamlessly after the migration.

### Why make this change?
To streamline the UI by removing redundant elements and improving the organization of wallet-connect functionalities.

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to refactor the wallet connect functionality, introduce new screens, and improve UI components.

### Detailed summary
- Added new `WalletDetailsModalScreen` options
- Updated imports for wallet connect files
- Modified UI components for better user experience
- Introduced new icons and screens for wallet management

> The following files were skipped due to too many changes: `packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ManageWalletScreen.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.tsx`, `packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-06-19 00:59:03 +00:00
Alec AnanianandManan Tank 8d7f8db39a fix(react): return type on useConnectModal.connect (#3385)
Co-authored-by: Manan Tank <[email protected]>
2024-06-19 11:07:43 +12:00