Compare commits

..
Author SHA1 Message Date
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
4dce62de1c Version Packages (#3319)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-06-17 15:09:31 +12:00
joaquim-verges 1c533efcd5 fix: respect transaction button theme prop (#3341)
<!-- 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 -->
2024-06-17 02:39:52 +00:00
joaquim-verges eca6217f77 refactor: separate onConnectRequested impl between web and native (#3344) 2024-06-17 00:36:22 +00:00
joaquim-verges df84f9c4ce refactor: improve Coinbase connection handling (#3340)
### 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 -->
2024-06-16 23:02:22 +00:00
jnsdls 17c0e6f282 [ConnectWallet] Include wallet name in injectedWalletLocale query key (#3333)
### 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.

---
2024-06-16 22:56:42 +00:00
jnsdls d51c1883af [Refactor] Migrate usePreloadWalletProviders to useQueries for wallet preloading (#3331)
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.

---
2024-06-16 22:56:39 +00:00
joaquim-verges 9cf3a1d663 feat: preloading wallet providers for improved performance (#3330)
<!-- 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 -->
2024-06-16 22:56:36 +00:00
joaquim-verges c94bcd574a refactor: change Coinbase SDK import to dynamic in coinbaseSDKWallet.ts (#3329)
<!-- 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 -->
2024-06-15 04:55:17 +00:00
jnsdls 41c6d04c2f [dependencies] Bump turbo package to 2.0.4 (#3323)
<!-- 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 -->
2024-06-15 01:28:21 +00:00
jnsdls 3a78041de7 [Multi] Update dependencies and version packages (#3327)
## 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 -->
2024-06-14 22:32:39 +00:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
8b74602e3b chore(chains): update chains (#3311)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-14 13:23:51 -07:00
Joaquim VergesandGitHub f9081d58d4 refactor: inject storage and session handler in wallet connect connector [part 5] (#3314) 2024-06-14 19:11:03 +00:00
Joaquim VergesandGitHub b051d844d0 refactor: Inject storage EVERYWHERE [part 4] (#3312) 2024-06-14 19:00:12 +00:00
Joaquim VergesandGitHub f8e0c5f84b reafactor: reorganize react native export files [part 3] (#3304) 2024-06-14 18:54:24 +00:00
Joaquim VergesandGitHub 476b6cc271 refactor: separate native exports for inapp wallet [part 2] (#3300) 2024-06-14 18:43:27 +00:00
Joaquim VergesandGitHub ffaff744f7 refactor: separate native exports for cb wallet [part 1] (#3298) 2024-06-14 18:37:23 +00:00
FirekeeperandGitHub 198f72c493 [Unity] fix tx builder type parsing (#3317) 2024-06-14 18:20:49 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
5cb580e99e Version Packages (#3316)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-06-14 11:12:41 -07:00
Manan TankandGitHub eff710738c [v4 react] Allow configuring qrcode and qrModalOptions on various wallet configurators (#3315) 2024-06-14 17:28:41 +00:00
Jonas DanielsandGitHub fb6a07d4b8 [Multi] Optimize package.json types versions & update ERC4337 factory methods (#3318) 2024-06-14 17:19:35 +00:00
7768067bf4 Modular contracts (#2880)
Signed-off-by: Yash <[email protected]>
Co-authored-by: Jonas Daniels <[email protected]>
2024-06-14 16:32:34 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
5ece04cdc0 Version Packages (#3287)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-06-14 20:10:01 +12:00
1b15e7b1f2 docs: add examples for defineChain usage (#3308)
Co-authored-by: Joaquim Verges <[email protected]>
2024-06-14 18:48:02 +12:00
gregandGitHub a4086c6a39 refactor(constants): rename ADDRESS_ZERO to ZERO_ADDRESS and deprecate older name (#3307) 2024-06-14 06:16:41 +00:00
1aaa63eec7 fix(wallets): don't serialize eip5792 calls (#3306)
Co-authored-by: Joaquim Verges <[email protected]>
2024-06-14 06:16:02 +00:00
gregandGitHub 502c53ac0b fix(tests): zk AA tests (#3313) 2024-06-14 05:42:36 +00:00
gregandGitHub e7ba698f3e fix: set default recipients in sigMint and update tests (#3305) 2024-06-13 23:49:35 +00:00
github-actions[bot]andGitHub 6746416db9 chore(chains): update chains (#3289)
This PR was automatically created by a GitHub Action. It updates the chains package with the latest changes from the database.
2024-06-13 16:09:10 -07:00
fivecutandGitHub 2fb81bd4b7 chore: remove repeat words (#3297)
Signed-off-by: fivecut <[email protected]>
2024-06-13 15:57:16 +00:00
gregandGitHub 841c86aa12 feat: add export private key functionality (#3296) 2024-06-13 05:57:18 +00:00
Alec AnanianandGitHub 132b3cb45a feat(react): add ability to pass ReactNode for ConnectButton label (#3292) 2024-06-12 23:20:38 +00:00
b248afc160 fix(react): use custom title and icon in compact Connect modal (#3290)
Co-authored-by: Joaquim Verges <[email protected]>
2024-06-12 22:53:34 +00:00
github-actions[bot]GitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
9f42e4d241 chore(chains): update chains (#3279)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-12 10:37:25 -07:00
Winston YeoandGitHub 901427c33c [service-utils]: update usage tracker schema (#3286) 2024-06-12 16:22:00 +00:00
305 changed files with 12521 additions and 2215 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ jobs:
- name: Install Yarn (if needed)
if: matrix.package_manager == 'yarn'
run: npm install -g yarn
run: npm install -g yarn@1.22.19
- name: Create test project
run: |
@@ -1,9 +1,9 @@
import { getContract } from "thirdweb";
import { zkSyncSepolia } from "thirdweb/chains";
import { baseSepolia } from "thirdweb/chains";
import { THIRDWEB_CLIENT } from "../../lib/client";
export const chain = zkSyncSepolia;
export const editionDropAddress = "0xd563ACBeD80e63B257B2524562BdD7Ec666eEE77";
export const chain = baseSepolia;
export const editionDropAddress = "0x638263e3eAa3917a53630e61B1fBa685308024fa";
export const editionDropTokenId = 0n;
export const editionDropContract = getContract({
@@ -12,7 +12,6 @@ import {
useReadContract,
} from "thirdweb/react";
import { THIRDWEB_CLIENT } from "../../lib/client";
import { CodeExample } from "../code/code-example";
import { editionDropContract, editionDropTokenId } from "./constants";
export function SponsoredTxPreview() {
@@ -50,7 +49,7 @@ export function SponsoredTxPreview() {
/>
) : null}
{smartAccount ? (
<>
<div className="flex flex-col justify-center p-8">
<p className="font-semibold text-center mb-2">
You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}{" "}
Kittens
@@ -73,7 +72,7 @@ export function SponsoredTxPreview() {
>
Mint
</TransactionButton>
</>
</div>
) : (
<p
style={{
+21
View File
@@ -1,5 +1,26 @@
# @thirdweb-dev/auth
## 4.1.94
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.5.36
## 4.1.93
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.5.35
## 4.1.92
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.5.34
## 4.1.91
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/auth",
"version": "4.1.91",
"version": "4.1.94",
"main": "dist/thirdweb-dev-auth.cjs.js",
"module": "dist/thirdweb-dev-auth.esm.js",
"browser": {
+12
View File
@@ -1,5 +1,17 @@
# @thirdweb-dev/chains
## 0.1.119
### Patch Changes
- [#3311](https://github.com/thirdweb-dev/js/pull/3311) [`8b74602`](https://github.com/thirdweb-dev/js/commit/8b74602e3b7fbe011bf886b9d5ee0e2ea62f7447) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.118
### Patch Changes
- [#3279](https://github.com/thirdweb-dev/js/pull/3279) [`9f42e4d`](https://github.com/thirdweb-dev/js/commit/9f42e4d2412df536d1b5f03a4e2a8b516911facb) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.117
### Patch Changes
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 111223,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "Chennai Testnet",
"nativeCurrency": {
"name": "Chennai Testnet Token",
"symbol": "ZOD",
"decimals": 18
},
"networkId": 111223,
"redFlags": [],
"rpc": [
"https://111223.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/chennai/testnet/rpc"
],
"shortName": "Chennai Testnet",
"slug": "chennai-testnet",
"testnet": true
} as const satisfies Chain;
-6
View File
@@ -11,12 +11,6 @@ export default {
"name": "EIP155"
}
],
"icon": {
"url": "ipfs://QmVt5Y585JqBSrkpZmYaEnX9FW7tDwfDLmUGNyDdyV2Pd2",
"width": 48,
"height": 48,
"format": "svg"
},
"infoURL": "https://www.dioneprotocol.com/",
"name": "Odyssey Chain (Testnet)",
"nativeCurrency": {
+37
View File
@@ -0,0 +1,37 @@
import type { Chain } from "../src/types";
export default {
"chain": "Sei",
"chainId": 1328,
"explorers": [
{
"name": "Seitrace",
"url": "https://seitrace.com",
"standard": "EIP3091"
}
],
"faucets": [
"https://atlantic-2.app.sei.io/faucet"
],
"icon": {
"url": "ipfs://bafkreih3l3iisplmikofkbfyimqlox7nmixzlkzhjoewmpi4jbqitwryoa",
"width": 600,
"height": 600,
"format": "png"
},
"infoURL": "https://www.sei.io",
"name": "Sei Testnet",
"nativeCurrency": {
"name": "Sei",
"symbol": "SEI",
"decimals": 18
},
"networkId": 1328,
"rpc": [
"https://1328.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://evm-rpc-testnet.sei-apis.com",
"wss://evm-ws-testnet.sei-apis.com"
],
"shortName": "sei-testnet",
"slug": "sei-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 14299,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "Diego's",
"nativeCurrency": {
"name": "Diego's Token",
"symbol": "VMF",
"decimals": 18
},
"networkId": 14299,
"redFlags": [],
"rpc": [
"https://14299.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/diegos/testnet/rpc"
],
"shortName": "Diego's",
"slug": "diego-s",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Satori",
"chainId": 14801,
"explorers": [
{
"name": "satoriscan",
"url": "https://satori.vanascan.io",
"standard": "EIP3091"
}
],
"faucets": [
"https://faucet.vana.org"
],
"infoURL": "https://satori.vana.org",
"name": "Vana Satori Testnet",
"nativeCurrency": {
"name": "DAT",
"symbol": "DAT",
"decimals": 18
},
"networkId": 14801,
"rpc": [
"https://14801.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"http://rpc.satori.vana.org"
],
"shortName": "satori",
"slug": "vana-satori-testnet",
"testnet": true
} as const satisfies Chain;
+38
View File
@@ -0,0 +1,38 @@
import type { Chain } from "../src/types";
export default {
"chain": "TCC Network",
"chainId": 181155,
"explorers": [
{
"name": "Tcc Scan",
"url": "https://scan.tccworld.org/",
"standard": "181155",
"icon": {
"url": "ipfs://QmchZTtvuU7oRe3rSu1HNPELJQdnutV79NjcHxoybJ4SVo/tcc-coin.png",
"width": 100,
"height": 100,
"format": "png"
}
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmchZTtvuU7oRe3rSu1HNPELJQdnutV79NjcHxoybJ4SVo/tcc-coin.png",
"width": 100,
"height": 100,
"format": "png"
},
"name": "TCC Network",
"nativeCurrency": {
"name": "The ChampCoin",
"symbol": "TCC",
"decimals": 18
},
"networkId": 181155,
"redFlags": [],
"rpc": [],
"shortName": "TCC",
"slug": "tcc-network",
"testnet": false
} as const satisfies Chain;
-6
View File
@@ -10,12 +10,6 @@ export default {
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmdoUtvHDybu5ppYBZT8BMRp6AqByVSoQs8nFwKbaS55jd",
"width": 367,
"height": 367,
"format": "svg"
},
"infoURL": "https://milkomeda.com",
"name": "Milkomeda C1 Mainnet",
"nativeCurrency": {
-6
View File
@@ -10,12 +10,6 @@ export default {
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmdoUtvHDybu5ppYBZT8BMRp6AqByVSoQs8nFwKbaS55jd",
"width": 367,
"height": 367,
"format": "svg"
},
"infoURL": "https://milkomeda.com",
"name": "Milkomeda C1 Testnet",
"nativeCurrency": {
-6
View File
@@ -10,12 +10,6 @@ export default {
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmdoUtvHDybu5ppYBZT8BMRp6AqByVSoQs8nFwKbaS55jd",
"width": 367,
"height": 367,
"format": "svg"
},
"infoURL": "https://milkomeda.com",
"name": "Milkomeda A1 Mainnet",
"nativeCurrency": {
-6
View File
@@ -10,12 +10,6 @@ export default {
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmdoUtvHDybu5ppYBZT8BMRp6AqByVSoQs8nFwKbaS55jd",
"width": 367,
"height": 367,
"format": "svg"
},
"infoURL": "https://milkomeda.com",
"name": "Milkomeda A1 Testnet",
"nativeCurrency": {
+29
View File
@@ -0,0 +1,29 @@
import type { Chain } from "../src/types";
export default {
"chain": "Parodychain",
"chainId": 2078,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmR2ovc7zeM7gdzpL6FdvWBEhLyE8dL1w8GWnooHEk9uEZ/parodychain-logo.png",
"width": 512,
"height": 512,
"format": "png"
},
"name": "Parody Network",
"nativeCurrency": {
"name": "Parody",
"symbol": "PDY",
"decimals": 18
},
"networkId": 2078,
"redFlags": [],
"rpc": [
"https://2078.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://fraa-flashbox-4392-rpc.a.stagenet.tanssi.network"
],
"shortName": "Parody",
"slug": "parody-network",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 2144,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "Test Subnet Resources",
"nativeCurrency": {
"name": "Test Subnet Resources Token",
"symbol": "LNV",
"decimals": 18
},
"networkId": 2144,
"redFlags": [],
"rpc": [
"https://2144.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/testsubnet/testnet/rpc"
],
"shortName": "Test Subnet Resources",
"slug": "test-subnet-resources",
"testnet": true
} as const satisfies Chain;
+4 -9
View File
@@ -7,20 +7,15 @@ export default {
"name": "Blockscout",
"url": "https://testnet-explorer-v2.xai-chain.net",
"standard": "EIP3091"
},
{
"name": "blockscout",
"url": "https://testnet-explorer-v2.xai-chain.net/",
"standard": "EIP3091"
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmZKFekbHxDkB8gFmmmjWz89SLhwg38GkALmAKo3gn753N/2024-01-10%2012.50.15.jpg",
"width": 512,
"height": 512,
"format": "jpg"
"url": "ipfs://QmbWFbhjKw7zfsK5Rd9YxZgJgS43fpySPozjhYc98ibbEV/xai-icon.png",
"width": 1024,
"height": 1024,
"format": "png"
},
"infoURL": "https://xai.games",
"name": "Xai Sepolia",
+43
View File
@@ -0,0 +1,43 @@
import type { Chain } from "../src/types";
export default {
"chain": "Bahamut",
"chainId": 4058,
"explorers": [
{
"name": "blockscout",
"url": "https://ocean.ftnscan.com",
"standard": "none"
}
],
"faucets": [],
"features": [
{
"name": "EIP155"
},
{
"name": "EIP1559"
}
],
"icon": {
"url": "ipfs://QmSemioP83RXnDWwTZbet8VpwJxcFRboX4B3pcdhLZGodP",
"width": 200,
"height": 200,
"format": "png"
},
"infoURL": "https://bahamut.io",
"name": "Bahamut ocean",
"nativeCurrency": {
"name": "FTN",
"symbol": "FTN",
"decimals": 18
},
"networkId": 4058,
"rpc": [
"https://4058.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc1.ocean.bahamutchain.com"
],
"shortName": "ocean",
"slug": "bahamut-ocean",
"testnet": false,
"title": "Bahamut ocean"
} as const satisfies Chain;
+50
View File
@@ -0,0 +1,50 @@
import type { Chain } from "../src/types";
export default {
"chain": "Pentagon",
"chainId": 555555,
"explorers": [
{
"name": "Pentagon Testnet Explorer",
"url": "https://explorer-testnet.pentagon.games",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmfU7W3Tm3tGWgnHBTG9vjB4PXGMvcL7Cq8R6MaSaC33DC",
"width": 512,
"height": 512,
"format": "png"
}
}
],
"faucets": [
"https://bridge-testnet.pentagon.games"
],
"features": [
{
"name": "EIP155"
},
{
"name": "EIP1559"
}
],
"icon": {
"url": "ipfs://QmfU7W3Tm3tGWgnHBTG9vjB4PXGMvcL7Cq8R6MaSaC33DC",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://pentagon.games",
"name": "Pentagon Testnet",
"nativeCurrency": {
"name": "Pentagon",
"symbol": "PEN",
"decimals": 18
},
"networkId": 555555,
"rpc": [
"https://555555.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-testnet.pentagon.games"
],
"shortName": "pentagon-testnet",
"slug": "pentagon-testnet",
"testnet": true
} as const satisfies Chain;
+5 -5
View File
@@ -11,13 +11,13 @@ export default {
],
"faucets": [],
"icon": {
"url": "ipfs://QmWm9biSavZ4ixNNSe8KhxiYgYaejY6Y4xRaqmz9fXimo5",
"width": 1136,
"height": 1112,
"url": "ipfs://QmYV6beVVg3iS9RGPno7GAASpgjyBDoKmWGUcvAKe2nXWK",
"width": 50,
"height": 50,
"format": "png"
},
"infoURL": "https://explorer.coinsec.network/",
"name": "COINSEC",
"name": "COINSEC Network",
"nativeCurrency": {
"name": "COINSEC",
"symbol": "SEC",
@@ -29,7 +29,7 @@ export default {
"https://mainnet-rpc.coinsec.network"
],
"shortName": "coinsecnetwork",
"slug": "coinsec",
"slug": "coinsec-network",
"testnet": false,
"title": "COINSEC Network"
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 57923,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QI0614I1",
"nativeCurrency": {
"name": "QI0614I1 Token",
"symbol": "GZD",
"decimals": 18
},
"networkId": 57923,
"redFlags": [],
"rpc": [
"https://57923.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QI0614I1",
"slug": "qi0614i1",
"testnet": true
} as const satisfies Chain;
+40
View File
@@ -0,0 +1,40 @@
import type { Chain } from "../src/types";
export default {
"chain": "Open Campus Codex",
"chainId": 656476,
"explorers": [
{
"name": "Open Campus Codex",
"url": "https://opencampus-codex.blockscout.com",
"standard": "none",
"icon": {
"url": "ipfs://QmXbz7VEYvf6NVHezuBy5HpJTCiagEThBxxdDdfVXNQ8Bt",
"width": 30,
"height": 30,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmXbz7VEYvf6NVHezuBy5HpJTCiagEThBxxdDdfVXNQ8Bt",
"width": 30,
"height": 30,
"format": "png"
},
"infoURL": "https://raas.gelato.network/rollups/details/public/open-campus-codex",
"name": "Open Campus Codex",
"nativeCurrency": {
"name": "EDU",
"symbol": "EDU",
"decimals": 18
},
"networkId": 656476,
"rpc": [
"https://656476.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.open-campus-codex.gelato.digital"
],
"shortName": "open-campus-codex",
"slug": "open-campus-codex",
"testnet": false
} as const satisfies Chain;
+4 -4
View File
@@ -12,10 +12,10 @@ export default {
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmZKFekbHxDkB8gFmmmjWz89SLhwg38GkALmAKo3gn753N/2024-01-10%2012.50.15.jpg",
"width": 512,
"height": 512,
"format": "jpg"
"url": "ipfs://QmbWFbhjKw7zfsK5Rd9YxZgJgS43fpySPozjhYc98ibbEV/xai-icon.png",
"width": 1024,
"height": 1024,
"format": "png"
},
"infoURL": "https://xai.games/",
"name": "Xai Mainnet",
+24
View File
@@ -0,0 +1,24 @@
import type { Chain } from "../src/types";
export default {
"chain": "OX",
"chainId": 6699,
"explorers": [],
"faucets": [],
"infoURL": "https://ox.fun/chain",
"name": "OX Chain",
"nativeCurrency": {
"name": "OX",
"symbol": "OX",
"decimals": 18
},
"networkId": 6699,
"rpc": [
"https://6699.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.oxscan.io"
],
"shortName": "ox-chain",
"slug": "ox-chain",
"status": "incubating",
"testnet": false,
"title": "OX Chain"
} as const satisfies Chain;
+29
View File
@@ -0,0 +1,29 @@
import type { Chain } from "../src/types";
export default {
"chain": "Darwinia Koi",
"chainId": 701,
"explorers": [
{
"name": "blockscout",
"url": "https://koi-scan.darwinia.network",
"standard": "EIP3091"
}
],
"faucets": [],
"infoURL": "https://darwinia.network/",
"name": "Darwinia Koi Testnet",
"nativeCurrency": {
"name": "Koi Network Native Token",
"symbol": "KRING",
"decimals": 18
},
"networkId": 701,
"rpc": [
"https://701.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://koi-rpc.darwinia.network"
],
"shortName": "darwinia-koi",
"slip44": 1,
"slug": "darwinia-koi-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 74444,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QR0612T1TS",
"nativeCurrency": {
"name": "QR0612T1TS Token",
"symbol": "FYJ",
"decimals": 18
},
"networkId": 74444,
"redFlags": [],
"rpc": [
"https://74444.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/qr0612t1ts/testnet/rpc"
],
"shortName": "QR0612T1TS",
"slug": "qr0612t1ts",
"testnet": true
} as const satisfies Chain;
+2 -2
View File
@@ -19,8 +19,8 @@ export default {
"infoURL": "https://www.boraportal.com",
"name": "BORAchain mainnet",
"nativeCurrency": {
"name": "BGAS",
"symbol": "BGAS",
"name": "BORA",
"symbol": "BORA",
"decimals": 18
},
"networkId": 77001,
+3
View File
@@ -16,6 +16,7 @@ export default {
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://bafkreibqgh23s7yt7rikybybiwfivwtoh32n24scjykvgbgewo3ecbrcye",
"width": 512,
@@ -30,8 +31,10 @@ export default {
"decimals": 18
},
"networkId": 8047,
"redFlags": [],
"rpc": [
"https://8047.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc0.come.boats/",
"https://rpc0.come.boat/"
],
"shortName": "boat",
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 82529,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "Test Using Resources",
"nativeCurrency": {
"name": "Test Using Resources Token",
"symbol": "JMH",
"decimals": 18
},
"networkId": 82529,
"redFlags": [],
"rpc": [
"https://82529.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/testsize/testnet/rpc"
],
"shortName": "Test Using Resources",
"slug": "test-using-resources",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 85405,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QR0614T1tS",
"nativeCurrency": {
"name": "QR0614T1tS Token",
"symbol": "FTW",
"decimals": 18
},
"networkId": 85405,
"redFlags": [],
"rpc": [
"https://85405.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/qr0614t1ts/testnet/rpc"
],
"shortName": "QR0614T1tS",
"slug": "qr0614t1ts",
"testnet": true
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Supernet Testnet",
"chainId": 998899,
"explorers": [
{
"name": "supernet-testnet-explorer",
"url": "https://testnet-explorer.supernet.chaingames.io",
"standard": "EIP3091"
}
],
"faucets": [
"https://faucet.chaingames.io"
],
"name": "Supernet Testnet",
"nativeCurrency": {
"name": "CHAIN",
"symbol": "CHAIN",
"decimals": 18
},
"networkId": 998899,
"rpc": [
"https://998899.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnet-rpc.supernet.chaingames.io/"
],
"shortName": "supernetchain",
"slip44": 1,
"slug": "supernet-testnet",
"testnet": true,
"title": "Supernet Testnet"
} as const satisfies Chain;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/chains",
"version": "0.1.117",
"version": "0.1.119",
"main": "dist/thirdweb-dev-chains.cjs.js",
"module": "dist/thirdweb-dev-chains.esm.js",
"exports": {
File diff suppressed because one or more lines are too long
+29
View File
@@ -1,5 +1,34 @@
# thirdweb
## 0.14.9
### Patch Changes
- Updated dependencies [[`8b74602`](https://github.com/thirdweb-dev/js/commit/8b74602e3b7fbe011bf886b9d5ee0e2ea62f7447)]:
- @thirdweb-dev/chains@0.1.119
- @thirdweb-dev/sdk@4.0.96
- @thirdweb-dev/wallets@2.5.36
- @thirdweb-dev/auth@4.1.94
## 0.14.8
### Patch Changes
- Updated dependencies [[`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052)]:
- @thirdweb-dev/sdk@4.0.95
- @thirdweb-dev/wallets@2.5.35
- @thirdweb-dev/auth@4.1.93
## 0.14.7
### Patch Changes
- Updated dependencies [[`9f42e4d`](https://github.com/thirdweb-dev/js/commit/9f42e4d2412df536d1b5f03a4e2a8b516911facb)]:
- @thirdweb-dev/chains@0.1.118
- @thirdweb-dev/sdk@4.0.94
- @thirdweb-dev/wallets@2.5.34
- @thirdweb-dev/auth@4.1.92
## 0.14.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@thirdweb-dev/cli",
"main": "dist/cli/index.js",
"version": "0.14.6",
"version": "0.14.9",
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/cli",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -8,7 +8,7 @@
"@typescript-eslint/parser": "7.9.0",
"eslint-config-next": "14.2.1",
"eslint-config-prettier": "9.1.0",
"eslint-config-turbo": "1.13.2",
"eslint-config-turbo": "2.0.4",
"eslint-plugin-react": "7.34.1"
},
"publishConfig": {
+29
View File
@@ -1,5 +1,34 @@
# @thirdweb-dev/react-core
## 4.9.1
### Patch Changes
- Updated dependencies [[`8b74602`](https://github.com/thirdweb-dev/js/commit/8b74602e3b7fbe011bf886b9d5ee0e2ea62f7447)]:
- @thirdweb-dev/chains@0.1.119
- @thirdweb-dev/sdk@4.0.96
- @thirdweb-dev/wallets@2.5.36
- @thirdweb-dev/auth@4.1.94
## 4.9.0
### Patch Changes
- Updated dependencies [[`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052)]:
- @thirdweb-dev/sdk@4.0.95
- @thirdweb-dev/wallets@2.5.35
- @thirdweb-dev/auth@4.1.93
## 4.8.0
### Patch Changes
- Updated dependencies [[`9f42e4d`](https://github.com/thirdweb-dev/js/commit/9f42e4d2412df536d1b5f03a4e2a8b516911facb)]:
- @thirdweb-dev/chains@0.1.118
- @thirdweb-dev/sdk@4.0.94
- @thirdweb-dev/wallets@2.5.34
- @thirdweb-dev/auth@4.1.92
## 4.7.0
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-core",
"version": "4.7.0",
"version": "4.9.1",
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/react-core",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
+37
View File
@@ -1,5 +1,42 @@
# @thirdweb-dev/react
## 4.9.1
### Patch Changes
- Updated dependencies [[`8b74602`](https://github.com/thirdweb-dev/js/commit/8b74602e3b7fbe011bf886b9d5ee0e2ea62f7447)]:
- @thirdweb-dev/chains@0.1.119
- @thirdweb-dev/sdk@4.0.96
- @thirdweb-dev/react-core@4.9.1
- @thirdweb-dev/wallets@2.5.36
## 4.9.0
### Minor Changes
- [#3315](https://github.com/thirdweb-dev/js/pull/3315) [`eff7107`](https://github.com/thirdweb-dev/js/commit/eff710738ce3d4341257e5912311c95b28a34b5d) Thanks [@MananTank](https://github.com/MananTank)! - Allow configuring WalletConnect `qrcode` and `qrModalOptions` from wallet configurator functions like `metamaskWallet`, `coreWallet`, `zerionWallet` etc
### Patch Changes
- Updated dependencies [[`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052)]:
- @thirdweb-dev/sdk@4.0.95
- @thirdweb-dev/react-core@4.9.0
- @thirdweb-dev/wallets@2.5.35
## 4.8.0
### Minor Changes
- [#3296](https://github.com/thirdweb-dev/js/pull/3296) [`841c86a`](https://github.com/thirdweb-dev/js/commit/841c86aa125c5965f43472e5e6f54267eda65726) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Adds private key export
### Patch Changes
- Updated dependencies [[`9f42e4d`](https://github.com/thirdweb-dev/js/commit/9f42e4d2412df536d1b5f03a4e2a8b516911facb)]:
- @thirdweb-dev/chains@0.1.118
- @thirdweb-dev/sdk@4.0.94
- @thirdweb-dev/react-core@4.8.0
- @thirdweb-dev/wallets@2.5.34
## 4.7.0
### Minor Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
"version": "4.7.0",
"version": "4.9.1",
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/react",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -79,6 +79,7 @@ import { useChainQuery } from "../hooks/useChainQuery";
import { SwapScreen } from "./screens/Buy/swap/SwapScreen";
import { SwapTransactionsScreen } from "./screens/SwapTransactionsScreen";
import { swapTransactionsStore } from "./screens/Buy/swap/pendingSwapTx";
import { ExportPrivateKey } from "../wallets/embeddedWallet/ExportPrivateKey";
const TW_CONNECTED_WALLET = "tw-connected-wallet";
@@ -89,7 +90,8 @@ type WalletDetailsModalScreen =
| "buy"
| "receive"
| "network-switcher"
| "pending-tx";
| "pending-tx"
| "private-key";
export const ConnectedWalletDetails: React.FC<{
onDisconnect: () => void;
@@ -573,6 +575,23 @@ export const ConnectedWalletDetails: React.FC<{
</div>
)}
{/* Export Embedded Wallet */}
{activeWallet?.walletId === walletIds.embeddedWallet && (
<div>
<MenuButton
onClick={() => {
setScreen("private-key");
}}
style={{
fontSize: fontSize.sm,
}}
>
<PinBottomIcon width={iconSize.md} height={iconSize.md} />
<Text color="primaryText">{"Export Private Key"}</Text>
</MenuButton>
</div>
)}
{props.detailsModalFooter && (
<props.detailsModalFooter close={() => setIsOpen(false)} />
)}
@@ -645,6 +664,16 @@ export const ConnectedWalletDetails: React.FC<{
}}
/>
);
} else if (screen === "private-key") {
content = (
<ExportPrivateKey
theme={props.theme}
walletInstance={activeWallet}
onBack={() => {
setScreen("main");
}}
/>
);
} else if (screen === "send" && walletChainId) {
content = (
<SendFunds
@@ -6,6 +6,7 @@ import type {
import { Coin98Wallet, getInjectedCoin98Provider } from "@thirdweb-dev/wallets";
import { ExtensionOrWCConnectionUI } from "../_common/ExtensionORWCConnectionUI";
import { useTWLocale } from "../../../evm/providers/locale-provider";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
const coin98WalletUris = {
ios: "coin98://",
@@ -29,6 +30,22 @@ export type Coin98WalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -78,7 +95,11 @@ export const coin98Wallet = (
const wallet = new Coin98Wallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
return wallet;
@@ -10,6 +10,7 @@ import {
import { handelWCSessionRequest } from "../handleWCSessionRequest";
import { useTWLocale } from "../../../evm/providers/locale-provider";
import { ExtensionOrWCConnectionUI } from "../_common/ExtensionORWCConnectionUI";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
const coreWalletUris = {
ios: "core://",
@@ -33,6 +34,22 @@ export type CoreWalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -81,7 +98,11 @@ export const coreWallet = (
const wallet = new CoreWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
handelWCSessionRequest(wallet, coreWalletUris);
@@ -10,6 +10,7 @@ import {
import { useTWLocale } from "../../../evm/providers/locale-provider";
import { ExtensionOrWCConnectionUI } from "../_common/ExtensionORWCConnectionUI";
import { handelWCSessionRequest } from "../handleWCSessionRequest";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
const cryptoDefiWalletUris = {
ios: "dfw://",
@@ -33,6 +34,22 @@ export type CryptoDefiWalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -82,7 +99,11 @@ export const cryptoDefiWallet = (
const wallet = new CryptoDefiWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
handelWCSessionRequest(wallet, cryptoDefiWalletUris);
@@ -0,0 +1,45 @@
import {
Container,
ModalHeader,
} from "../../../components/basic";
import {
WalletInstance,
} from "@thirdweb-dev/react-core";
import { Theme } from "../../../design-system";
export const ExportPrivateKey: React.FC<{
onBack?: () => void;
walletInstance?: WalletInstance;
walletAddress?: string;
theme: "light" | "dark" | Theme;
}> = (props) => {
return (
<Container fullHeight animate="fadein">
<Container p="lg">
<ModalHeader
onBack={props.onBack}
title="Export Private Key"
/>
</Container>
<Container p="md">
<iframe
title="Export In-App Wallet"
style={{
width: "100%",
height: "250px",
}}
allow="clipboard-read; clipboard-write"
src={`https://embedded-wallet.thirdweb.com//sdk/2022-08-12/embedded-wallet/export-private-key?clientId=${
props.walletInstance?.getOptions()?.clientId
}&theme=${
typeof props.theme === "string" ? props.theme : props.theme.type
}`}
/>
</Container>
</Container>
);
};
@@ -6,6 +6,7 @@ import type {
import { ImTokenWallet, assertWindowEthereum } from "@thirdweb-dev/wallets";
import { useTWLocale } from "../../../evm/providers/locale-provider";
import { ExtensionOrWCConnectionUI } from "../_common/ExtensionORWCConnectionUI";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
const imTokenWalletUris = {
ios: "imtokenv2://",
@@ -15,6 +16,22 @@ const imTokenWalletUris = {
export type ImTokenWalletConfigOptions = {
projectId?: string;
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
export const imTokenWallet = (
@@ -30,7 +47,11 @@ export const imTokenWallet = (
const wallet = new ImTokenWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
return wallet;
@@ -6,6 +6,7 @@ import {
import { MetamaskConnectUI } from "./MetamaskConnectUI";
import { metamaskUris } from "./metamaskUris";
import { handelWCSessionRequest } from "../handleWCSessionRequest";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
/**
* @wallet
@@ -35,6 +36,22 @@ export type MetamaskWalletConfigOptions = {
* Default is `"walletconnect"`
*/
connectionMethod?: "walletConnect" | "metamaskBrowser";
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -89,7 +106,11 @@ export const metamaskWallet = (
const wallet = new MetaMaskWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
if (connectionMethod === "walletConnect") {
@@ -1,6 +1,7 @@
import type { WalletOptions, WalletConfig } from "@thirdweb-dev/react-core";
import { OKXWallet, getInjectedOKXProvider } from "@thirdweb-dev/wallets";
import { OKXConnectUI } from "./OKXConnectUI";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
/**
* @wallet
@@ -18,6 +19,22 @@ export type OKXWalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -67,7 +84,11 @@ export const okxWallet = (
const wallet = new OKXWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
return wallet;
@@ -6,6 +6,7 @@ import type {
import { OneKeyWallet, getInjectedOneKeyProvider } from "@thirdweb-dev/wallets";
import { useTWLocale } from "../../../evm/providers/locale-provider";
import { ExtensionOrWCConnectionUI } from "../_common/ExtensionORWCConnectionUI";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
export const oneKeyWalletUris = {
ios: "onekey-wallet://",
@@ -29,6 +30,22 @@ export type OneKeyWalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -78,7 +95,11 @@ export const oneKeyWallet = (
const wallet = new OneKeyWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
return wallet;
@@ -1,6 +1,7 @@
import type { WalletOptions, WalletConfig } from "@thirdweb-dev/react-core";
import { RabbyWallet, getInjectedRabbyProvider } from "@thirdweb-dev/wallets";
import { RabbyConnectUI } from "./RabbyConnectUI";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
/**
* @wallet
@@ -18,6 +19,22 @@ export type RabbyWalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -64,7 +81,11 @@ export const rabbyWallet = (
const wallet = new RabbyWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
return wallet;
@@ -7,6 +7,7 @@ import { TrustWallet, assertWindowEthereum } from "@thirdweb-dev/wallets";
import { handelWCSessionRequest } from "../handleWCSessionRequest";
import { useTWLocale } from "../../../evm/providers/locale-provider";
import { ExtensionOrWCConnectionUI } from "../_common/ExtensionORWCConnectionUI";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
const trustWalletUris = {
ios: "trust://",
@@ -30,6 +31,22 @@ export type TrustWalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -72,7 +89,11 @@ export const trustWallet = (
const wallet = new TrustWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
handelWCSessionRequest(wallet, trustWalletUris);
@@ -7,6 +7,7 @@ import { ZerionWallet, assertWindowEthereum } from "@thirdweb-dev/wallets";
import { handelWCSessionRequest } from "../handleWCSessionRequest";
import { useTWLocale } from "../../../evm/providers/locale-provider";
import { ExtensionOrWCConnectionUI } from "../_common/ExtensionORWCConnectionUI";
import type { QRModalOptions } from "@thirdweb-dev/wallets/src/evm/connectors/wallet-connect/qrModalOptions";
const zerionWalletUris = {
ios: "zerion://",
@@ -30,6 +31,22 @@ export type ZerionkWalletConfigOptions = {
* If true, the wallet will be tagged as "recommended" in ConnectWallet Modal
*/
recommended?: boolean;
/**
* Specify whether to open the official Wallet Connect Modal when connecting the wallet if no injected MetaMask provider is found when connecting the wallet.
*
* This should not be set if you are using ConnectWallet component and only when manually connecting the wallet using a hook like `useConnect`.
*
* You can set it to `true` or a configuration object to enable the Wallet Connect Modal.
*/
wcModal?:
| {
/**
* Configure the style of Wallet Connect Modal.
*/
qrModalOptions?: QRModalOptions;
}
| boolean;
};
/**
@@ -72,7 +89,11 @@ export const zerionWallet = (
const wallet = new ZerionWallet({
...walletOptions,
projectId: options?.projectId,
qrcode: false,
qrcode: options?.wcModal ? true : false,
qrModalOptions:
typeof options?.wcModal === "object"
? options?.wcModal?.qrModalOptions
: undefined,
});
handelWCSessionRequest(wallet, zerionWalletUris);
Binary file not shown.
+25
View File
@@ -1,5 +1,30 @@
# @thirdweb-dev/sdk
## 4.0.96
### Patch Changes
- Updated dependencies [[`c94bcd5`](https://github.com/thirdweb-dev/js/commit/c94bcd574aa4eaf2bd76ab8b6379302de4731ed4), [`1c533ef`](https://github.com/thirdweb-dev/js/commit/1c533efcd5fbc8a72fd03c98510fa601ee5f34b5), [`ffaff74`](https://github.com/thirdweb-dev/js/commit/ffaff744f72d2cb22896e7501677b48f76ea857a), [`8b74602`](https://github.com/thirdweb-dev/js/commit/8b74602e3b7fbe011bf886b9d5ee0e2ea62f7447), [`9cf3a1d`](https://github.com/thirdweb-dev/js/commit/9cf3a1d6636fcd56559e889ab2bfe3249d51162a)]:
- thirdweb@5.29.3
- @thirdweb-dev/chains@0.1.119
## 4.0.95
### Patch Changes
- [#2880](https://github.com/thirdweb-dev/js/pull/2880) [`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Modular contract publish and deploy setup
- Updated dependencies [[`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052), [`fb6a07d`](https://github.com/thirdweb-dev/js/commit/fb6a07d4b84ba8ea6389ca04c73625f670a0d9c4)]:
- thirdweb@5.29.2
## 4.0.94
### Patch Changes
- Updated dependencies [[`b248afc`](https://github.com/thirdweb-dev/js/commit/b248afc16062f8fe0967e42535ae119642897003), [`9f42e4d`](https://github.com/thirdweb-dev/js/commit/9f42e4d2412df536d1b5f03a4e2a8b516911facb), [`132b3cb`](https://github.com/thirdweb-dev/js/commit/132b3cb45ae1d56f8de240a361b31c76d5b9b4a7), [`e7ba698`](https://github.com/thirdweb-dev/js/commit/e7ba698f3e60e0749f8739ad1aec76a8ab2c2fb3)]:
- thirdweb@5.29.1
- @thirdweb-dev/chains@0.1.118
## 4.0.93
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/sdk",
"version": "4.0.93",
"version": "4.0.96",
"description": "The main thirdweb SDK.",
"repository": "https://github.com/thirdweb-dev/js/tree/main/legacy_packages/sdk",
"license": "Apache-2.0",
@@ -0,0 +1,158 @@
import { providers, utils } from "ethers";
import {
coreContractAbi,
extensionContractAbi,
} from "../../constants/thirdweb-features";
import { hasDuplicates } from "../utils";
import { getChainByChainIdAsync, getChainRPC } from "@thirdweb-dev/chains";
type CallbackFunction = {
selector: string;
};
type FallbackFunction = {
selector: string;
permissionBits: string;
};
type SupportedCallbackFunction = {
selector: string;
mode: number;
};
export async function compatibleExtensions(
coreBytecode: string,
extensionBytecodes: string[],
chainId: number,
): Promise<boolean> {
const chain = await getChainByChainIdAsync(chainId);
const rpcUrl = getChainRPC(chain);
const jsonRpcProvider = new providers.JsonRpcProvider(rpcUrl);
const addr = "0x0000000000000000000000000000000000000124"; // arbitrary address
/**
* Here we use state override with eth_call.
*
* This lets us call functions on a non-deployed contract, by using its deployed bytecode
* to override code of an arbitrary address in eth_call.
*
* Encode function calldata, and perform eth_call with bytecode override.
*/
const coreIface = new utils.Interface(coreContractAbi);
const coreCalldata = coreIface.encodeFunctionData(
"getSupportedCallbackFunctions",
[],
);
if (!coreBytecode.startsWith("0x6080604052")) {
const index = coreBytecode.indexOf("6080604052");
coreBytecode = `0x${coreBytecode.substring(index)}`;
} else if (coreBytecode.lastIndexOf("6080604052") > 0) {
const index = coreBytecode.lastIndexOf("6080604052");
coreBytecode = `0x${coreBytecode.substring(index)}`;
}
const core = await jsonRpcProvider.send("eth_call", [
{ to: addr, data: coreCalldata },
"latest",
{ [addr]: { code: coreBytecode } }, // eth_call with bytecode override
]);
const extensionIface = new utils.Interface(extensionContractAbi);
const extensionCalldata = extensionIface.encodeFunctionData(
"getExtensionConfig",
[],
);
const extensions = await Promise.all(
extensionBytecodes.map((b: string) => {
// TODO: Upload deployed bytecode on publish metadata
if (!b.startsWith("0x6080604052")) {
const index = b.indexOf("6080604052");
b = `0x${b.substring(index)}`;
} else if (b.lastIndexOf("6080604052") > 0) {
const index = b.lastIndexOf("6080604052");
b = `0x${b.substring(index)}`;
}
return jsonRpcProvider.send("eth_call", [
{ to: addr, data: extensionCalldata },
"latest",
{ [addr]: { code: b } }, // eth_call with bytecode override
]);
}),
);
const decodedCore = coreIface.decodeFunctionResult(
"getSupportedCallbackFunctions",
core,
);
const coreCallbackSelectors = decodedCore.flat().map(
(c: SupportedCallbackFunction) => c.selector,
);
// extract callback/fallback selectors and required interfaces from extension config
const requiredInterfaces: string[] = [];
const extensionFallbackSelectors: string[] = [];
const extensionCallbackSelectors: string[] = [];
const selectors: string[] = [];
extensions.forEach((e: string) => {
const decodedExtensionConfig = extensionIface.decodeFunctionResult(
"getExtensionConfig",
e,
);
requiredInterfaces.push(...decodedExtensionConfig[0].requiredInterfaces);
const fallbackSelectors =
decodedExtensionConfig[0].fallbackFunctions.map(
(a: FallbackFunction) => a.selector,
);
const callbackSelectors =
decodedExtensionConfig[0].callbackFunctions.map(
(a: CallbackFunction) => a.selector,
);
extensionFallbackSelectors.push(...fallbackSelectors);
extensionCallbackSelectors.push(...callbackSelectors);
});
// check if callback selectors are supported
for(const callback of extensionCallbackSelectors) {
if(!coreCallbackSelectors.includes(callback)) {
return false;
}
}
// check if the core contract supports required interfaces by extensions above
if(requiredInterfaces.length > 0) {
const supportsInterfaceResult = await Promise.all(
requiredInterfaces.map((r) => {
const supportsInterfaceCalldata = coreIface.encodeFunctionData(
"supportsInterface",
[r],
);
return jsonRpcProvider.send("eth_call", [
{ to: addr, data: supportsInterfaceCalldata },
"latest",
{ [addr]: { code: coreBytecode } },
]);
}),
);
const supportsInterfaceDecoded = supportsInterfaceResult.map(r => {
return coreIface.decodeFunctionResult(
"supportsInterface",
r,
);
})
if (supportsInterfaceDecoded.flat().some((element) => element === false)) {
return false;
}
}
// check duplicate callback/fallback signatures
selectors.push(...extensionFallbackSelectors, ...extensionCallbackSelectors);
return !hasDuplicates(
selectors.flat(),
(a: string, b: string): boolean => a === b,
);
}
@@ -1,4 +1,5 @@
import {
coreContractAbi,
getAllExtensionsAbi,
getAllPluginsAbi,
} from "../../constants/thirdweb-features";
@@ -38,6 +39,7 @@ export async function getCompositeABI(
"DynamicContract",
features,
);
const isModular: boolean = isExtensionEnabled(abi, "ModularCore", features);
// check if the contract has fallback function - we'll further check for diamond pattern if needed
const isFallback: boolean = isExtensionEnabled(abi, "Fallback", features);
@@ -59,6 +61,24 @@ export async function getCompositeABI(
// get ABIs of extension contracts --
pluginABIs = await getPluginABI(pluginAddresses, provider, storage);
} else if (isModular) {
const contract = new ContractWrapper(
provider,
address,
coreContractAbi,
options,
storage,
);
const extensions = await contract.call("getInstalledExtensions");
// get extension addresses
const extensionAddresses = extensions.map(
(item: any) => item.implementation,
);
// get ABIs of extension contracts --
pluginABIs = await getPluginABI(extensionAddresses, provider, storage);
} else if (isPluginRouter) {
const contract = new ContractWrapper(
provider,
@@ -30,6 +30,27 @@ export function unique<T>(a: T[], fn: (a: T, b: T) => boolean): T[] {
return a;
}
/**
* @internal
*/
export function hasDuplicates<T>(arr: T[], fn: (a: T, b: T) => boolean): boolean {
if (arr.length === 0 || arr.length === 1) {
return false;
}
if (!fn) {
throw new Error("Comparison function required");
}
for (let i = 0; i < arr.length; i++) {
for (let j = i + 1; j < arr.length; j++) {
if (fn(arr[i], arr[j])) {
return true;
}
}
}
return false;
}
/**
* @internal
*/
@@ -63,6 +63,8 @@ import {
FEATURE_GASLESS,
FEATURE_PACK_VRF,
FEATURE_PLUGIN_ROUTER,
FEATURE_MODULAR_CORE,
FEATURE_MODULAR_EXTENSION,
FEATURE_DIRECT_LISTINGS,
FEATURE_ENGLISH_AUCTIONS,
FEATURE_OFFERS,
@@ -139,6 +141,8 @@ export type Feature =
| typeof FEATURE_GASLESS
| typeof FEATURE_PACK_VRF
| typeof FEATURE_PLUGIN_ROUTER
| typeof FEATURE_MODULAR_CORE
| typeof FEATURE_MODULAR_EXTENSION
| typeof FEATURE_DYNAMIC_CONTRACT
| typeof FEATURE_DIRECT_LISTINGS
| typeof FEATURE_ENGLISH_AUCTIONS
@@ -189,6 +193,8 @@ export const SUPPORTED_FEATURES: Record<string, Feature> = /* @__PURE__ */ {
[FEATURE_PACK_VRF.name]: FEATURE_PACK_VRF,
[FEATURE_PLUGIN_ROUTER.name]: FEATURE_PLUGIN_ROUTER,
[FEATURE_DYNAMIC_CONTRACT.name]: FEATURE_DYNAMIC_CONTRACT,
[FEATURE_MODULAR_CORE.name]: FEATURE_MODULAR_CORE,
[FEATURE_MODULAR_EXTENSION.name]: FEATURE_MODULAR_EXTENSION,
[FEATURE_DIRECT_LISTINGS.name]: FEATURE_DIRECT_LISTINGS,
[FEATURE_ENGLISH_AUCTIONS.name]: FEATURE_ENGLISH_AUCTIONS,
[FEATURE_OFFERS.name]: FEATURE_OFFERS,
@@ -116,6 +116,450 @@ export const getAllExtensionsAbi = [
},
];
export const coreContractAbi = [
{ type: "fallback", stateMutability: "payable" },
{
type: "function",
name: "cancelOwnershipHandover",
inputs: [],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "completeOwnershipHandover",
inputs: [
{ name: "pendingOwner", type: "address", internalType: "address" },
],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "getInstalledExtensions",
inputs: [],
outputs: [
{
name: "_installedExtensions",
type: "tuple[]",
internalType: "struct IModularCore.InstalledExtension[]",
components: [
{
name: "implementation",
type: "address",
internalType: "address",
},
{
name: "config",
type: "tuple",
internalType: "struct IExtensionConfig.ExtensionConfig",
components: [
{
name: "registerInstallationCallback",
type: "bool",
internalType: "bool",
},
{
name: "requiredInterfaces",
type: "bytes4[]",
internalType: "bytes4[]",
},
{
name: "supportedInterfaces",
type: "bytes4[]",
internalType: "bytes4[]",
},
{
name: "callbackFunctions",
type: "tuple[]",
internalType: "struct IExtensionConfig.CallbackFunction[]",
components: [
{
name: "selector",
type: "bytes4",
internalType: "bytes4",
},
],
},
{
name: "fallbackFunctions",
type: "tuple[]",
internalType: "struct IExtensionConfig.FallbackFunction[]",
components: [
{
name: "selector",
type: "bytes4",
internalType: "bytes4",
},
{
name: "permissionBits",
type: "uint256",
internalType: "uint256",
},
],
},
],
},
],
},
],
stateMutability: "view",
},
{
type: "function",
name: "getSupportedCallbackFunctions",
inputs: [],
outputs: [
{
name: "",
type: "tuple[]",
internalType: "struct IModularCore.SupportedCallbackFunction[]",
components: [
{ name: "selector", type: "bytes4", internalType: "bytes4" },
{
name: "mode",
type: "uint8",
internalType: "enum IModularCore.CallbackMode",
},
],
},
],
stateMutability: "pure",
},
{
type: "function",
name: "grantRoles",
inputs: [
{ name: "user", type: "address", internalType: "address" },
{ name: "roles", type: "uint256", internalType: "uint256" },
],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "hasAllRoles",
inputs: [
{ name: "user", type: "address", internalType: "address" },
{ name: "roles", type: "uint256", internalType: "uint256" },
],
outputs: [{ name: "", type: "bool", internalType: "bool" }],
stateMutability: "view",
},
{
type: "function",
name: "hasAnyRole",
inputs: [
{ name: "user", type: "address", internalType: "address" },
{ name: "roles", type: "uint256", internalType: "uint256" },
],
outputs: [{ name: "", type: "bool", internalType: "bool" }],
stateMutability: "view",
},
{
type: "function",
name: "installExtension",
inputs: [
{ name: "_extension", type: "address", internalType: "address" },
{ name: "_data", type: "bytes", internalType: "bytes" },
],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "owner",
inputs: [],
outputs: [{ name: "result", type: "address", internalType: "address" }],
stateMutability: "view",
},
{
type: "function",
name: "ownershipHandoverExpiresAt",
inputs: [
{ name: "pendingOwner", type: "address", internalType: "address" },
],
outputs: [{ name: "result", type: "uint256", internalType: "uint256" }],
stateMutability: "view",
},
{
type: "function",
name: "renounceOwnership",
inputs: [],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "renounceRoles",
inputs: [{ name: "roles", type: "uint256", internalType: "uint256" }],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "requestOwnershipHandover",
inputs: [],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "revokeRoles",
inputs: [
{ name: "user", type: "address", internalType: "address" },
{ name: "roles", type: "uint256", internalType: "uint256" },
],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "rolesOf",
inputs: [{ name: "user", type: "address", internalType: "address" }],
outputs: [{ name: "roles", type: "uint256", internalType: "uint256" }],
stateMutability: "view",
},
{
type: "function",
name: "supportsInterface",
inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }],
outputs: [{ name: "", type: "bool", internalType: "bool" }],
stateMutability: "view",
},
{
type: "function",
name: "transferOwnership",
inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
outputs: [],
stateMutability: "payable",
},
{
type: "function",
name: "uninstallExtension",
inputs: [
{ name: "_extension", type: "address", internalType: "address" },
{ name: "_data", type: "bytes", internalType: "bytes" },
],
outputs: [],
stateMutability: "payable",
},
{
type: "event",
name: "ExtensionInstalled",
inputs: [
{
name: "caller",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "implementation",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "installedExtension",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "ExtensionUninstalled",
inputs: [
{
name: "caller",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "implementation",
type: "address",
indexed: false,
internalType: "address",
},
{
name: "installedExtension",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "OwnershipHandoverCanceled",
inputs: [
{
name: "pendingOwner",
type: "address",
indexed: true,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "OwnershipHandoverRequested",
inputs: [
{
name: "pendingOwner",
type: "address",
indexed: true,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "OwnershipTransferred",
inputs: [
{
name: "oldOwner",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "newOwner",
type: "address",
indexed: true,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "RolesUpdated",
inputs: [
{
name: "user",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "roles",
type: "uint256",
indexed: true,
internalType: "uint256",
},
],
anonymous: false,
},
{ type: "error", name: "AlreadyInitialized", inputs: [] },
{ type: "error", name: "CallbackExecutionReverted", inputs: [] },
{
type: "error",
name: "CallbackFunctionAlreadyInstalled",
inputs: [],
},
{ type: "error", name: "CallbackFunctionNotSupported", inputs: [] },
{ type: "error", name: "CallbackFunctionRequired", inputs: [] },
{
type: "error",
name: "CallbackFunctionUnauthorizedCall",
inputs: [],
},
{ type: "error", name: "ExtensionAlreadyInstalled", inputs: [] },
{
type: "error",
name: "ExtensionInterfaceNotCompatible",
inputs: [
{
name: "requiredInterfaceId",
type: "bytes4",
internalType: "bytes4",
},
],
},
{ type: "error", name: "ExtensionNotInstalled", inputs: [] },
{ type: "error", name: "ExtensionOutOfSync", inputs: [] },
{
type: "error",
name: "FallbackFunctionAlreadyInstalled",
inputs: [],
},
{ type: "error", name: "FallbackFunctionNotInstalled", inputs: [] },
{ type: "error", name: "IndexOutOfBounds", inputs: [] },
{ type: "error", name: "NewOwnerIsZeroAddress", inputs: [] },
{ type: "error", name: "NoHandoverRequest", inputs: [] },
{ type: "error", name: "Unauthorized", inputs: [] },
];
export const extensionContractAbi = [
{
type: "function",
name: "getExtensionConfig",
inputs: [],
outputs: [
{
name: "",
type: "tuple",
internalType: "struct IExtensionConfig.ExtensionConfig",
components: [
{
name: "registerInstallationCallback",
type: "bool",
internalType: "bool",
},
{
name: "requiredInterfaces",
type: "bytes4[]",
internalType: "bytes4[]",
},
{
name: "supportedInterfaces",
type: "bytes4[]",
internalType: "bytes4[]",
},
{
name: "callbackFunctions",
type: "tuple[]",
internalType: "struct IExtensionConfig.CallbackFunction[]",
components: [
{
name: "selector",
type: "bytes4",
internalType: "bytes4",
},
],
},
{
name: "fallbackFunctions",
type: "tuple[]",
internalType: "struct IExtensionConfig.FallbackFunction[]",
components: [
{
name: "selector",
type: "bytes4",
internalType: "bytes4",
},
{
name: "permissionBits",
type: "uint256",
internalType: "uint256",
},
],
},
],
},
],
stateMutability: "pure",
},
];
export const FEATURE_ROYALTY = {
name: "Royalty",
namespace: "royalty",
@@ -255,6 +699,30 @@ export const FEATURE_DYNAMIC_CONTRACT = {
features: {},
} as const;
export const FEATURE_MODULAR_CORE = {
name: "ModularCore",
namespace: "modular.core",
docLinks: {
sdk: "",
//TODO
contracts: "",
},
abis: [coreContractAbi],
features: {},
} as const;
export const FEATURE_MODULAR_EXTENSION = {
name: "ModularExtension",
namespace: "modular.extension",
docLinks: {
sdk: "",
//TODO
contracts: "",
},
abis: [extensionContractAbi],
features: {},
} as const;
export const FEATURE_DIRECT_LISTINGS = {
name: "DirectListings",
namespace: "direct.listings",
@@ -406,11 +406,18 @@ export class ContractPublisher extends RPCConnectionHandler {
"DynamicContract",
features,
);
const isModular = isFeatureEnabled(
compilerMetadata.abi,
"ModularCore",
features,
);
extraMetadataCleaned.routerType = isPlugin
? "plugin"
: isDynamic
? "dynamic"
: "none";
: isModular
? "modular"
: "none";
// For a dynamic contract Router, try to fetch plugin/extension metadata
if (isDynamic || isPlugin) {
@@ -78,7 +78,7 @@ export class ContractRoles<TContract extends IPermissions, TRole extends Role>
/**
* Get all members of a specific role
* @remarks See {@link ContractRoles.getAll} to get get a list of addresses for all supported roles on the contract.
* @param role - The Role to to get a memberlist for.
* @param role - The Role to get a memberlist for.
* @returns The list of addresses that are members of the specific role.
* @throws If you are requesting a role that does not exist on the contract this will throw an error.
*
+1 -1
View File
@@ -9,7 +9,7 @@ import type {
} from "ethers";
import { ChainInfo } from "../schema/shared/ChainInfo";
// --- utility types extracted from from ts-toolbelt --- //
// --- utility types extracted from ts-toolbelt --- //
// if
type TBoolean = 0 | 1;
+1
View File
@@ -102,6 +102,7 @@ export * from "./common/feature-detection/detectContractFeature";
export * from "./common/feature-detection/hasFunction";
export * from "./common/plugin/joinABIs";
export * from "./common/plugin/getCompositePluginABI";
export * from "./common/modular/compatibleExtensions";
export * from "./common/version-checker";
export * from "./common/fetchSourceFilesFromMetadata";
export { isNativeToken } from "./common/currency/isNativeToken";
@@ -166,6 +166,14 @@ export const CustomFactoryInput = /* @__PURE__ */ (() =>
customFactoryAddresses: ChainIdToAddressSchema,
}))();
/**
* @internal
*/
export const ModularFactoryInput = /* @__PURE__ */ (() =>
z.object({
hooksParamName: z.string(),
}))();
/**
* @internal
*/
@@ -174,6 +182,7 @@ export const FactoryDeploymentSchema = /* @__PURE__ */ (() =>
implementationAddresses: ChainIdToAddressSchema,
implementationInitializerFunction: z.string().default("initialize"),
customFactoryInput: CustomFactoryInput.optional(),
modularFactoryInput: ModularFactoryInput.optional(),
factoryAddresses: ChainIdToAddressSchema.optional(),
}))();
@@ -191,7 +200,12 @@ export const DeployTypeInput = /* @__PURE__ */ (() =>
* @internal
*/
export const RouterTypeInput = /* @__PURE__ */ (() =>
z.union([z.literal("none"), z.literal("plugin"), z.literal("dynamic")]))();
z.union([
z.literal("none"),
z.literal("plugin"),
z.literal("dynamic"),
z.literal("modular"),
]))();
/**
* @internal
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
export const mockExtensionWithInterfaceBytecode = "0x6080604052348015600f57600080fd5b506106f08061001f6000396000f3fe608060405234801561001057600080fd5b50600436106100de5760003560e01c80637c173ecc1161008c5780638dc5fd9e116100665780638dc5fd9e146100e3578063ae7c8cb7146100e3578063edf8bf0514610141578063f2c9ecd81461014957600080fd5b80637c173ecc1461012c57806389242efb146100e35780638a91b0e31461010057600080fd5b80633fb5c1cb116100bd5780633fb5c1cb146100ed5780636d61fe7014610100578063774237fc1461011157600080fd5b8062862ba3146100e35780630a340d43146100e357806313efddd6146100e5575b600080fd5b005b6100e3610151565b6100e36100fb366004610388565b600055565b6100e361010e3660046103d0565b50565b610119602081565b6040519081526020015b60405180910390f35b61013461017c565b604051610123919061055b565b6100e3610249565b600054610119565b6040517f6a94d761ae01a14a6739229452f57b368e87612171065a3d5019e116a9d396f290600090a1565b6101b06040518060a00160405280600015158152602001606081526020016060815260200160608152602001606081525090565b6101b8610274565b606082015260408051600180825281830190925290602080830190803683375050506020820181905280517f123456780000000000000000000000000000000000000000000000000000000091906000906102155761021561064b565b7fffffffff000000000000000000000000000000000000000000000000000000009092166020928302919091019091015290565b6040517f79201cdedb9b351e17bd1274b3465126723ac336d7a6b1546a2f0e97b8f0a73090600090a1565b6060610282600a600161067a565b67ffffffffffffffff81111561029a5761029a6103a1565b6040519080825280602002602001820160405280156102da57816020015b6040805160208101909152600081528152602001906001900390816102b85790505b50905060005b600a811015610338578060e01b8282815181106102ff576102ff61064b565b60209081029190910101517fffffffff0000000000000000000000000000000000000000000000000000000090911690526001016102e0565b5063edf8bf0560e01b81600a815181106103545761035461064b565b60209081029190910101517fffffffff00000000000000000000000000000000000000000000000000000000909116905290565b60006020828403121561039a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156103e257600080fd5b813567ffffffffffffffff808211156103fa57600080fd5b818401915084601f83011261040e57600080fd5b813581811115610420576104206103a1565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610466576104666103a1565b8160405282815287602084870101111561047f57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60008151808452602080850194506020840160005b838110156104f25781517fffffffff0000000000000000000000000000000000000000000000000000000016875295820195908201906001016104b4565b509495945050505050565b60008151808452602080850194506020840160005b838110156104f257815180517fffffffff000000000000000000000000000000000000000000000000000000001688528301518388015260409096019590820190600101610512565b6000602080835283511515818401528084015160a0604085015261058260c085018261049f565b905060408501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0808684030160608701526105be838361049f565b6060880151878203830160808901528051808352908601945060009350908501905b80841015610623578451517fffffffff000000000000000000000000000000000000000000000000000000001682529385019360019390930192908501906105e0565b5060808801519450818782030160a088015261063f81866104fd565b98975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b808201808211156106b4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea26469706673582212201665fc4a987397715b9892065ad27121276fc1052ea227a5f5cff3da42d5c25764736f6c63430008190033";
@@ -0,0 +1,144 @@
import {
extendedMetadataMock,
jsonProvider,
signers,
sdk,
} from "./before-setup";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { expect } from "chai";
import { mockUploadMetadataWithBytecode } from "./utils";
import {
mockCoreBytecode,
mockCoreCompilerMetadata,
mockCoreDeployedBytecode,
} from "./mock/mockCoreMetadata";
import {
mockExtensionWithFunctionsBytecode,
mockExtensionWithFunctionsCompilerMetadata,
} from "./mock/mockExtensionWithFunctionsMetadata";
import { compatibleExtensions } from "../../src/evm/common/modular/compatibleExtensions";
import { mockExtensionWithInterfaceBytecode } from "./mock/mockExtensionWithInterface";
describe("Modular contract deployment", async () => {
let adminWallet: SignerWithAddress;
async function mockPublishExtension() {
const mockPublisher = process.env.contractPublisherAddress;
process.env.contractPublisherAddress =
"0xf5b896Ddb5146D5dA77efF4efBb3Eae36E300808";
const publishUri = await mockUploadMetadataWithBytecode(
"DemoExtensionWithFunctions",
mockExtensionWithFunctionsCompilerMetadata.output.abi,
mockExtensionWithFunctionsBytecode,
"",
{
...extendedMetadataMock,
deployType: "standard",
networksForDeployment: {
allNetworks: true,
networksEnabled: [],
},
publisher: await adminWallet.getAddress(),
},
"ipfs://QmbAYkPwB2V8E8Phs62TFAoAa9fuP74DZFD2uCiSNAHpVb/0",
);
process.env.contractPublisherAddress = mockPublisher;
return publishUri;
}
async function mockPublishAndDeployMockCore() {
const mockPublisher = process.env.contractPublisherAddress;
process.env.contractPublisherAddress =
"0xf5b896Ddb5146D5dA77efF4efBb3Eae36E300808";
const publishUri = await mockUploadMetadataWithBytecode(
"DemoCore",
mockCoreCompilerMetadata.output.abi,
mockCoreBytecode,
mockCoreDeployedBytecode,
{
...extendedMetadataMock,
deployType: "autoFactory",
routerType: "modular",
defaultExtensions: [
{
extensionName: "DemoExtensionWithFunctions",
extensionVersion: "",
publisherAddress: await adminWallet.getAddress(),
},
],
factoryDeploymentData: {
implementationAddresses: {},
factoryAddresses: {},
implementationInitializerFunction: "initialize",
modularFactoryInput: { hooksParamName: "extensions" },
},
networksForDeployment: {
allNetworks: true,
networksEnabled: [],
},
publisher: await adminWallet.getAddress(),
},
"ipfs://QmbQLyXkhkF2tF6nSbB9TaXUShaLbEWMi11zuR5U5mfz2X/0",
);
const walletAddress = await sdk.wallet.getAddress();
const address = await sdk.deployer.deployContractFromUri(
publishUri,
[walletAddress, [], ["0x"]],
{
forceDirectDeploy: false,
},
);
const core = await sdk.getContract(address);
process.env.contractPublisherAddress = mockPublisher;
return core;
}
before(async () => {
[adminWallet] = signers;
});
beforeEach(async () => {
sdk.updateSignerOrProvider(adminWallet);
await jsonProvider.send("hardhat_reset", []);
});
it("should deploy core but not install hooks", async () => {
// await mockPublishModularFactory();
await mockPublishExtension();
const mockCore = await mockPublishAndDeployMockCore();
const extensions = await mockCore.call("getInstalledExtensions");
expect(extensions.length).to.equal(0);
});
it("should check extension compatibility", async () => {
// duplicate callback/fallback
let isCompatible = await compatibleExtensions(
mockCoreBytecode,
[mockExtensionWithFunctionsBytecode, mockExtensionWithFunctionsBytecode],
11155111,
);
expect(isCompatible).to.be.false;
// required interface not supported
isCompatible = await compatibleExtensions(
mockCoreBytecode,
[mockExtensionWithInterfaceBytecode],
11155111,
);
expect(isCompatible).to.be.false;
});
});
Binary file not shown.
@@ -1,5 +1,36 @@
# @thirdweb-dev/unity-js-bridge
## 0.6.45
### Patch Changes
- [#3317](https://github.com/thirdweb-dev/js/pull/3317) [`198f72c`](https://github.com/thirdweb-dev/js/commit/198f72c4933633d44185ff7b1d7e995e90c4d618) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - [Unity] fix tx builder type parsing
- Updated dependencies [[`8b74602`](https://github.com/thirdweb-dev/js/commit/8b74602e3b7fbe011bf886b9d5ee0e2ea62f7447)]:
- @thirdweb-dev/chains@0.1.119
- @thirdweb-dev/sdk@4.0.96
- @thirdweb-dev/wallets@2.5.36
- @thirdweb-dev/auth@4.1.94
## 0.6.44
### Patch Changes
- Updated dependencies [[`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052)]:
- @thirdweb-dev/sdk@4.0.95
- @thirdweb-dev/wallets@2.5.35
- @thirdweb-dev/auth@4.1.93
## 0.6.43
### Patch Changes
- Updated dependencies [[`9f42e4d`](https://github.com/thirdweb-dev/js/commit/9f42e4d2412df536d1b5f03a4e2a8b516911facb)]:
- @thirdweb-dev/chains@0.1.118
- @thirdweb-dev/sdk@4.0.94
- @thirdweb-dev/wallets@2.5.34
- @thirdweb-dev/auth@4.1.92
## 0.6.42
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/unity-js-bridge",
"version": "0.6.42",
"version": "0.6.45",
"main": "dist/thirdweb-unity-bridge.js",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
"license": "Apache-2.0",
@@ -173,7 +173,7 @@ class ThirdwebBridge implements TWBridge {
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix use of any
(globalThis as any).X_SDK_PLATFORM = "unity";
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix use of any
(globalThis as any).X_SDK_VERSION = "4.16.3";
(globalThis as any).X_SDK_VERSION = "4.16.4";
// biome-ignore lint/suspicious/noExplicitAny: TODO: fix use of any
(globalThis as any).X_SDK_OS = browser?.os ?? "unknown";
}
@@ -610,7 +610,9 @@ class ThirdwebBridge implements TWBridge {
maxFeePerGas: txInput?.maxFeePerGas,
maxPriorityFeePerGas: txInput?.maxPriorityFeePerGas,
nonce: txInput?.nonce,
type: txInput?.type?.toNumber(),
type: txInput?.type
? BigNumber.from(txInput.type).toNumber()
: undefined,
accessList: txInput?.accessList,
// customData: txInput.data,
// ccipReadEnabled: txInput.ccipReadEnabled,
+23
View File
@@ -1,5 +1,28 @@
# @thirdweb-dev/wallets
## 2.5.36
### Patch Changes
- Updated dependencies [[`8b74602`](https://github.com/thirdweb-dev/js/commit/8b74602e3b7fbe011bf886b9d5ee0e2ea62f7447)]:
- @thirdweb-dev/chains@0.1.119
- @thirdweb-dev/sdk@4.0.96
## 2.5.35
### Patch Changes
- Updated dependencies [[`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052)]:
- @thirdweb-dev/sdk@4.0.95
## 2.5.34
### Patch Changes
- Updated dependencies [[`9f42e4d`](https://github.com/thirdweb-dev/js/commit/9f42e4d2412df536d1b5f03a4e2a8b516911facb)]:
- @thirdweb-dev/chains@0.1.118
- @thirdweb-dev/sdk@4.0.94
## 2.5.33
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/wallets",
"version": "2.5.33",
"version": "2.5.36",
"main": "dist/thirdweb-dev-wallets.cjs.js",
"module": "dist/thirdweb-dev-wallets.esm.js",
"browser": {
+9 -6
View File
@@ -12,7 +12,7 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"test": "turbo run test --filter=./packages/*",
"test:legacy": "turbo run test --filter=./legacy_packages/* --filter=!sdk --filter=!auth",
"test:legacy": "turbo run test --filter=./legacy_packages/* --filter=!@thirdweb-dev/sdk --filter=!@thirdweb-dev/auth",
"e2e": "turbo run e2e --filter=./packages/*",
"e2e:legacy": "turbo run e2e --filter=./legacy_packages/*",
"build:packages": "turbo run build --filter=./packages/*",
@@ -44,7 +44,7 @@
"@manypkg/get-packages": "2.2.1",
"@playwright/test": "1.31.2",
"@types/node": "20.12.7",
"turbo": "1.13.3",
"turbo": "2.0.4",
"yalc": "1.0.0-pre.53"
},
"_______ALL_PACKAGE_DEV_DEPENDENCIES_GO_IN_HERE_SO_CONSUMERS_DONT_END_UP_INSTALLING_THEM______": "_______ALL_PACKAGE_DEV_DEPENDENCIES_GO_IN_HERE_SO_CONSUMERS_DONT_END_UP_INSTALLING_THEM______",
@@ -62,13 +62,13 @@
"@viem/anvil": "0.0.9",
"@vitest/coverage-v8": "1.5.0",
"dotenv-mono": "1.3.14",
"ethers5": "npm:[email protected]",
"ethers6": "npm:[email protected]",
"eslint-plugin-i18next": "^6.0.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-inclusive-language": "^2.2.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-tsdoc": "^0.2.17",
"ethers5": "npm:[email protected]",
"ethers6": "npm:[email protected]",
"knip": "5.9.4",
"mitata": "0.1.11",
"react": "18.2.0",
@@ -98,7 +98,10 @@
"protobufjs@>=6.10.0 <7.2.4": ">=7.2.4",
"tough-cookie@<4.1.3": ">=4.1.3",
"@ethereumjs/util@<9.0.0": ">=9.0.0",
"axios@<0.28.0": ">=0.28.0"
"axios@<0.28.0": ">=0.28.0",
"@grpc/grpc-js@<1.10.9": "1.10.9",
"braces@<3.0.3": "3.0.3"
}
}
},
"packageManager": "[email protected]"
}
+6
View File
@@ -1,5 +1,11 @@
# @thirdweb-dev/service-utils
## 0.4.32
### Patch Changes
- [#3286](https://github.com/thirdweb-dev/js/pull/3286) [`901427c`](https://github.com/thirdweb-dev/js/commit/901427c33c5daf330887b501ec8f9f42aa20ff85) Thanks [@ElasticBottle](https://github.com/ElasticBottle)! - add ecosystemId and ecosystemPartnerId to usage tracking schema for cf worker
## 0.4.31
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/service-utils",
"version": "0.4.31",
"version": "0.4.32",
"main": "dist/thirdweb-dev-service-utils.cjs.js",
"module": "dist/thirdweb-dev-service-utils.esm.js",
"exports": {
@@ -15,6 +15,7 @@ function getAws(options: ConstructorParameters<typeof AwsClient>[0]) {
*/
const usageEventSchema = z.object({
source: z.enum([
"ecosystemWallets",
"embeddedWallets",
"rpc",
"storage",
@@ -84,6 +85,9 @@ const usageEventSchema = z.object({
"TRACE",
])
.optional(),
// Used to identify the ecosystem that the an ecosystem wallet belongs too
ecosystemId: z.string().optional(),
ecosystemPartnerId: z.string().optional(),
});
export type UsageEvent = z.infer<typeof usageEventSchema>;
+30
View File
@@ -1,5 +1,35 @@
# thirdweb
## 5.29.3
### Patch Changes
- [#3329](https://github.com/thirdweb-dev/js/pull/3329) [`c94bcd5`](https://github.com/thirdweb-dev/js/commit/c94bcd574aa4eaf2bd76ab8b6379302de4731ed4) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Dynamically import coinbase sdk to avoid cloudflare bundler issues
- [#3341](https://github.com/thirdweb-dev/js/pull/3341) [`1c533ef`](https://github.com/thirdweb-dev/js/commit/1c533efcd5fbc8a72fd03c98510fa601ee5f34b5) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Fix transaction button not respecting theme prop
- [#3298](https://github.com/thirdweb-dev/js/pull/3298) [`ffaff74`](https://github.com/thirdweb-dev/js/commit/ffaff744f72d2cb22896e7501677b48f76ea857a) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - refactor exports to handle native vs non-native dependencies
- [#3330](https://github.com/thirdweb-dev/js/pull/3330) [`9cf3a1d`](https://github.com/thirdweb-dev/js/commit/9cf3a1d6636fcd56559e889ab2bfe3249d51162a) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Fix coinbase wallet popup sometimes not opening on safari + improve inAppWallet web performance
## 5.29.2
### Patch Changes
- [#2880](https://github.com/thirdweb-dev/js/pull/2880) [`7768067`](https://github.com/thirdweb-dev/js/commit/7768067bf4f571a8c8ee6b646a58e2fc5f6bd052) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Modular contract publish and deploy setup
- [#3318](https://github.com/thirdweb-dev/js/pull/3318) [`fb6a07d`](https://github.com/thirdweb-dev/js/commit/fb6a07d4b84ba8ea6389ca04c73625f670a0d9c4) Thanks [@jnsdls](https://github.com/jnsdls)! - add missing erc4337 extensions
## 5.29.1
### Patch Changes
- [#3290](https://github.com/thirdweb-dev/js/pull/3290) [`b248afc`](https://github.com/thirdweb-dev/js/commit/b248afc16062f8fe0967e42535ae119642897003) Thanks [@alecananian](https://github.com/alecananian)! - Fixed Connect modal title not using custom title and icon in compact mode
- [#3292](https://github.com/thirdweb-dev/js/pull/3292) [`132b3cb`](https://github.com/thirdweb-dev/js/commit/132b3cb45ae1d56f8de240a361b31c76d5b9b4a7) Thanks [@alecananian](https://github.com/alecananian)! - Updated the `ConnectButton` `label` prop to be of type `ReactNode`
- [#3305](https://github.com/thirdweb-dev/js/pull/3305) [`e7ba698`](https://github.com/thirdweb-dev/js/commit/e7ba698f3e60e0749f8739ad1aec76a8ab2c2fb3) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Fix default sale and royalty recipients for signature mints
## 5.29.0
### Minor Changes
+10 -3
View File
@@ -1,6 +1,6 @@
{
"name": "thirdweb",
"version": "5.29.0",
"version": "5.29.3",
"repository": {
"type": "git",
"url": "git+https://github.com/thirdweb-dev/js.git#main"
@@ -68,7 +68,7 @@
"./react": {
"types": "./dist/types/exports/react.d.ts",
"import": "./dist/esm/exports/react.js",
"react-native": "./dist/esm/exports/react-native.js",
"react-native": "./dist/esm/exports/react.native.js",
"default": "./dist/cjs/exports/react.js"
},
"./react-native": {
@@ -99,8 +99,15 @@
"./wallets": {
"types": "./dist/types/exports/wallets.d.ts",
"import": "./dist/esm/exports/wallets.js",
"react-native": "./dist/esm/exports/wallets.native.js",
"default": "./dist/cjs/exports/wallets.js"
},
"./wallets/in-app": {
"types": "./dist/types/exports/wallets/in-app.d.ts",
"import": "./dist/esm/exports/wallets/in-app.js",
"react-native": "./dist/esm/exports/wallets/in-app.native.js",
"default": "./dist/cjs/exports/wallets/in-app.js"
},
"./wallets/*": {
"types": "./dist/types/exports/wallets/*.d.ts",
"import": "./dist/esm/exports/wallets/*.js",
@@ -258,7 +265,7 @@
"scripts": {
"bench:compare": "bun run ./benchmarks/run.ts",
"bench": "vitest -c ./test/vitest.config.ts bench",
"format": "biome format 'src/**/*' --write",
"format": "biome format src/ --write",
"lint": "biome check src/",
"fix": "biome check src/ --apply",
"knip": "knip",
@@ -7,6 +7,9 @@
"function getAccountsOfSigner(address signer) view returns (address[] accounts)",
"function getAddress(address adminSigner, bytes data) view returns (address)",
"function getAllAccounts() view returns (address[])",
"function getAccounts(uint256 start, uint256 end) view returns (address[])",
"function onSignerAdded(address signer, address creatorAdmin, bytes data)",
"function onSignerRemoved(address signer, address creatorAdmin, bytes data)"
"function onSignerRemoved(address signer, address creatorAdmin, bytes data)",
"function totalAccounts() view returns (uint256)",
"function isRegistered(address account) view returns (bool)"
]
@@ -0,0 +1,131 @@
[
{
"type": "function",
"name": "getInstalledExtensions",
"inputs": [],
"outputs": [
{
"name": "",
"type": "tuple[]",
"internalType": "struct IModularCore.InstalledExtension[]",
"components": [
{
"name": "implementation",
"type": "address",
"internalType": "address"
},
{
"name": "config",
"type": "tuple",
"internalType": "struct IExtensionConfig.ExtensionConfig",
"components": [
{
"name": "registerInstallationCallback",
"type": "bool",
"internalType": "bool"
},
{
"name": "requiredInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "supportedInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "callbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.CallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
}
]
},
{
"name": "fallbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.FallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
},
{
"name": "permissionBits",
"type": "uint256",
"internalType": "uint256"
}
]
}
]
}
]
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getSupportedCallbackFunctions",
"inputs": [],
"outputs": [
{
"name": "",
"type": "tuple[]",
"internalType": "struct IModularCore.SupportedCallbackFunction[]",
"components": [
{ "name": "selector", "type": "bytes4", "internalType": "bytes4" },
{
"name": "mode",
"type": "uint8",
"internalType": "enum IModularCore.CallbackMode"
}
]
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "installExtension",
"inputs": [
{
"name": "extensionContract",
"type": "address",
"internalType": "address"
},
{ "name": "data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "supportsInterface",
"inputs": [
{ "name": "interfaceID", "type": "bytes4", "internalType": "bytes4" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "uninstallExtension",
"inputs": [
{
"name": "extensionContract",
"type": "address",
"internalType": "address"
},
{ "name": "data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "payable"
}
]
@@ -0,0 +1,61 @@
[
{
"type": "function",
"name": "getExtensionConfig",
"inputs": [],
"outputs": [
{
"name": "",
"type": "tuple",
"internalType": "struct IExtensionConfig.ExtensionConfig",
"components": [
{
"name": "registerInstallationCallback",
"type": "bool",
"internalType": "bool"
},
{
"name": "requiredInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "supportedInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "callbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.CallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
}
]
},
{
"name": "fallbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.FallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
},
{
"name": "permissionBits",
"type": "uint256",
"internalType": "uint256"
}
]
}
]
}
],
"stateMutability": "pure"
}
]
@@ -0,0 +1,395 @@
[
{ "type": "fallback", "stateMutability": "payable" },
{
"type": "function",
"name": "cancelOwnershipHandover",
"inputs": [],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "completeOwnershipHandover",
"inputs": [
{ "name": "pendingOwner", "type": "address", "internalType": "address" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "getInstalledExtensions",
"inputs": [],
"outputs": [
{
"name": "_installedExtensions",
"type": "tuple[]",
"internalType": "struct IModularCore.InstalledExtension[]",
"components": [
{
"name": "implementation",
"type": "address",
"internalType": "address"
},
{
"name": "config",
"type": "tuple",
"internalType": "struct IExtensionConfig.ExtensionConfig",
"components": [
{
"name": "registerInstallationCallback",
"type": "bool",
"internalType": "bool"
},
{
"name": "requiredInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "supportedInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "callbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.CallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
}
]
},
{
"name": "fallbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.FallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
},
{
"name": "permissionBits",
"type": "uint256",
"internalType": "uint256"
}
]
}
]
}
]
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getSupportedCallbackFunctions",
"inputs": [],
"outputs": [
{
"name": "",
"type": "tuple[]",
"internalType": "struct IModularCore.SupportedCallbackFunction[]",
"components": [
{ "name": "selector", "type": "bytes4", "internalType": "bytes4" },
{
"name": "mode",
"type": "uint8",
"internalType": "enum IModularCore.CallbackMode"
}
]
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "grantRoles",
"inputs": [
{ "name": "user", "type": "address", "internalType": "address" },
{ "name": "roles", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "hasAllRoles",
"inputs": [
{ "name": "user", "type": "address", "internalType": "address" },
{ "name": "roles", "type": "uint256", "internalType": "uint256" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "hasAnyRole",
"inputs": [
{ "name": "user", "type": "address", "internalType": "address" },
{ "name": "roles", "type": "uint256", "internalType": "uint256" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "installExtension",
"inputs": [
{ "name": "_extension", "type": "address", "internalType": "address" },
{ "name": "_data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "owner",
"inputs": [],
"outputs": [
{ "name": "result", "type": "address", "internalType": "address" }
],
"stateMutability": "view"
},
{
"type": "function",
"name": "ownershipHandoverExpiresAt",
"inputs": [
{ "name": "pendingOwner", "type": "address", "internalType": "address" }
],
"outputs": [
{ "name": "result", "type": "uint256", "internalType": "uint256" }
],
"stateMutability": "view"
},
{
"type": "function",
"name": "renounceOwnership",
"inputs": [],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "renounceRoles",
"inputs": [
{ "name": "roles", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "requestOwnershipHandover",
"inputs": [],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "revokeRoles",
"inputs": [
{ "name": "user", "type": "address", "internalType": "address" },
{ "name": "roles", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "rolesOf",
"inputs": [
{ "name": "user", "type": "address", "internalType": "address" }
],
"outputs": [
{ "name": "roles", "type": "uint256", "internalType": "uint256" }
],
"stateMutability": "view"
},
{
"type": "function",
"name": "supportsInterface",
"inputs": [
{ "name": "interfaceId", "type": "bytes4", "internalType": "bytes4" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "transferOwnership",
"inputs": [
{ "name": "newOwner", "type": "address", "internalType": "address" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "uninstallExtension",
"inputs": [
{ "name": "_extension", "type": "address", "internalType": "address" },
{ "name": "_data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "event",
"name": "ExtensionInstalled",
"inputs": [
{
"name": "caller",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "implementation",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "installedExtension",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "ExtensionUninstalled",
"inputs": [
{
"name": "caller",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "implementation",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "installedExtension",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipHandoverCanceled",
"inputs": [
{
"name": "pendingOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipHandoverRequested",
"inputs": [
{
"name": "pendingOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipTransferred",
"inputs": [
{
"name": "oldOwner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "RolesUpdated",
"inputs": [
{
"name": "user",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "roles",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
}
],
"anonymous": false
},
{ "type": "error", "name": "AlreadyInitialized", "inputs": [] },
{ "type": "error", "name": "CallbackExecutionReverted", "inputs": [] },
{
"type": "error",
"name": "CallbackFunctionAlreadyInstalled",
"inputs": []
},
{ "type": "error", "name": "CallbackFunctionNotSupported", "inputs": [] },
{ "type": "error", "name": "CallbackFunctionRequired", "inputs": [] },
{
"type": "error",
"name": "CallbackFunctionUnauthorizedCall",
"inputs": []
},
{ "type": "error", "name": "ExtensionAlreadyInstalled", "inputs": [] },
{
"type": "error",
"name": "ExtensionInterfaceNotCompatible",
"inputs": [
{
"name": "requiredInterfaceId",
"type": "bytes4",
"internalType": "bytes4"
}
]
},
{ "type": "error", "name": "ExtensionNotInstalled", "inputs": [] },
{ "type": "error", "name": "ExtensionOutOfSync", "inputs": [] },
{
"type": "error",
"name": "FallbackFunctionAlreadyInstalled",
"inputs": []
},
{ "type": "error", "name": "FallbackFunctionNotInstalled", "inputs": [] },
{ "type": "error", "name": "IndexOutOfBounds", "inputs": [] },
{ "type": "error", "name": "NewOwnerIsZeroAddress", "inputs": [] },
{ "type": "error", "name": "NoHandoverRequest", "inputs": [] },
{ "type": "error", "name": "Unauthorized", "inputs": [] }
]
@@ -0,0 +1,61 @@
[
{
"type": "function",
"name": "getExtensionConfig",
"inputs": [],
"outputs": [
{
"name": "",
"type": "tuple",
"internalType": "struct IExtensionConfig.ExtensionConfig",
"components": [
{
"name": "registerInstallationCallback",
"type": "bool",
"internalType": "bool"
},
{
"name": "requiredInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "supportedInterfaces",
"type": "bytes4[]",
"internalType": "bytes4[]"
},
{
"name": "callbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.CallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
}
]
},
{
"name": "fallbackFunctions",
"type": "tuple[]",
"internalType": "struct IExtensionConfig.FallbackFunction[]",
"components": [
{
"name": "selector",
"type": "bytes4",
"internalType": "bytes4"
},
{
"name": "permissionBits",
"type": "uint256",
"internalType": "uint256"
}
]
}
]
}
],
"stateMutability": "pure"
}
]
@@ -55,8 +55,9 @@ export async function generateFromAbi(
events.map(async (e) => {
await writeFile(
join(outFolder, extensionFileName, "./events", `${e.name}.ts`),
await format(generateEvent(e, extensionName), {
format(generateEvent(e, extensionName), {
parser: "babel-ts",
trailingComma: "all",
}),
"utf-8",
);
@@ -73,8 +74,9 @@ export async function generateFromAbi(
readFunctions.map(async (f) => {
await writeFile(
join(outFolder, extensionFileName, "./read", `${f.name}.ts`),
await format(generateReadFunction(f, extensionName), {
format(generateReadFunction(f, extensionName), {
parser: "babel-ts",
trailingComma: "all",
}),
"utf-8",
);
@@ -91,8 +93,9 @@ export async function generateFromAbi(
writeFunctions.map(async (f) => {
await writeFile(
join(outFolder, extensionFileName, "./write", `${f.name}.ts`),
await format(generateWriteFunction(f, extensionName), {
format(generateWriteFunction(f, extensionName), {
parser: "babel-ts",
trailingComma: "all",
}),
"utf-8",
);
+6
View File
@@ -17,9 +17,15 @@ const CUSTOM_CHAIN_MAP = new Map<number, Chain>();
* @param options The options for the chain.
* @returns The defined chain.
* @example
* Just pass the chain ID to connect to:
* ```ts
* const chain = defineChain(1);
* ```
* Or pass your own RPC or custom values:
* ```ts
* const chain = defineChain({
* id: 1,
* rpc: "https://my-rpc.com",
* nativeCurrency: {
* name: "Ether",
* symbol: "ETH",
+6 -1
View File
@@ -14,4 +14,9 @@ export function isNativeTokenAddress(address: string) {
/**
* The zero address in Ethereum, represented as a hexadecimal string.
*/
export const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
/**
* @deprecated Use {@link ZERO_ADDRESS}.
*/
export const ADDRESS_ZERO = ZERO_ADDRESS;
@@ -1,4 +1,5 @@
import { type Abi, formatAbi, parseAbi } from "abitype";
import { getInstalledExtensions } from "../../extensions/modular/__generated__/ModularCore/read/getInstalledExtensions.js";
import { download } from "../../storage/download.js";
import { extractIPFSUri } from "../../utils/bytecode/extractIPFS.js";
import { getClientFetch } from "../../utils/fetch.js";
@@ -284,12 +285,14 @@ export async function resolveCompositeAbi(
rootAbi_,
pluginPatternAddresses,
baseRouterAddresses,
modularExtensionAddresses,
diamondFacetAddresses,
] = await Promise.all([
rootAbi ? rootAbi : resolveAbiFromBytecode(contract),
// check these all at the same time
resolvePluginPatternAddresses(contract),
resolveBaseRouterAddresses(contract),
resolveModularExtensionAddresses(contract),
resolveDiamondFacetAddresses(contract),
]);
@@ -297,6 +300,7 @@ export async function resolveCompositeAbi(
...new Set([
...pluginPatternAddresses,
...baseRouterAddresses,
...modularExtensionAddresses,
...diamondFacetAddresses,
]),
];
@@ -358,6 +362,23 @@ async function resolveBaseRouterAddresses(
return [];
}
async function resolveModularExtensionAddresses(
contract: ThirdwebContract,
): Promise<string[]> {
try {
const extensions = await getInstalledExtensions({ contract });
// if there are no plugins, return the root ABI
if (!extensions.length) {
return [];
}
// get all the plugin addresses
return [...new Set(extensions.map((item) => item.implementation))];
} catch {
// no-op, expected because not everything supports this
}
return [];
}
async function resolveDiamondFacetAddresses(
contract: ThirdwebContract,
): Promise<string[]> {
@@ -21,6 +21,13 @@ export {
checkVerificationStatus,
} from "../contract/verification/index.js";
// publisher
export {
fetchPublishedContract,
fetchPublishedContractMetadata,
fetchDeployBytecodeFromPublishedContractMetadata,
} from "../contract/deployment/publisher.js";
// deployment - TODO: these end up looking more like extensions -> should they be?
export {
prepareDirectDeployTransaction,
@@ -36,6 +36,9 @@ export { signerPermissionsUpdatedEvent } from "../../extensions/erc4337/__genera
// FACTORY
export { getAllAccounts } from "../../extensions/erc4337/__generated__/IAccountFactory/read/getAllAccounts.js";
export { getAccounts } from "../../extensions/erc4337/__generated__/IAccountFactory/read/getAccounts.js";
export { totalAccounts } from "../../extensions/erc4337/__generated__/IAccountFactory/read/totalAccounts.js";
export { isRegistered } from "../../extensions/erc4337/__generated__/IAccountFactory/read/isRegistered.js";
export {
getAccountsOfSigner,
type GetAccountsOfSignerParams,
@@ -0,0 +1,78 @@
/**
* READ
*/
export {
getInstalledExtensions,
isGetInstalledExtensionsSupported,
} from "../../extensions/modular/__generated__/ModularCore/read/getInstalledExtensions.js";
export {
getSupportedCallbackFunctions,
isGetSupportedCallbackFunctionsSupported,
} from "../../extensions/modular/__generated__/ModularCore/read/getSupportedCallbackFunctions.js";
export {
hasAnyRole,
type HasAnyRoleParams,
} from "../../extensions/modular/__generated__/ModularCore/read/hasAnyRole.js";
export {
hasAllRoles,
type HasAllRolesParams,
} from "../../extensions/modular/__generated__/ModularCore/read/hasAllRoles.js";
export { owner } from "../../extensions/modular/__generated__/ModularCore/read/owner.js";
export {
ownershipHandoverExpiresAt,
type OwnershipHandoverExpiresAtParams,
} from "../../extensions/modular/__generated__/ModularCore/read/ownershipHandoverExpiresAt.js";
export {
rolesOf,
type RolesOfParams,
} from "../../extensions/modular/__generated__/ModularCore/read/rolesOf.js";
/**
* Write
*/
export { cancelOwnershipHandover } from "../../extensions/modular/__generated__/ModularCore/write/cancelOwnershipHandover.js";
export {
completeOwnershipHandover,
type CompleteOwnershipHandoverParams,
} from "../../extensions/modular/__generated__/ModularCore/write/completeOwnershipHandover.js";
export {
grantRoles,
type GrantRolesParams,
} from "../../extensions/modular/__generated__/ModularCore/write/grantRoles.js";
export {
installExtension,
isInstallExtensionSupported,
type InstallExtensionParams,
} from "../../extensions/modular/__generated__/ModularCore/write/installExtension.js";
export { renounceOwnership } from "../../extensions/modular/__generated__/ModularCore/write/renounceOwnership.js";
export { requestOwnershipHandover } from "../../extensions/modular/__generated__/ModularCore/write/requestOwnershipHandover.js";
export {
renounceRoles,
type RenounceRolesParams,
} from "../../extensions/modular/__generated__/ModularCore/write/renounceRoles.js";
export {
revokeRoles,
type RevokeRolesParams,
} from "../../extensions/modular/__generated__/ModularCore/write/revokeRoles.js";
export {
transferOwnership,
type TransferOwnershipParams,
} from "../../extensions/modular/__generated__/ModularCore/write/transferOwnership.js";
export {
uninstallExtension,
isUninstallExtensionSupported,
type UninstallExtensionParams,
} from "../../extensions/modular/__generated__/ModularCore/write/uninstallExtension.js";
export { getExtensionConfig } from "../../extensions/modular/__generated__/ModularExtension/read/getExtensionConfig.js";
export {
installPublishedExtension,
type InstallPublishedExtensionOptions,
} from "../../extensions/modular/ModularCore/write/installPublishedExtension.js";
export {
uninstallPublishedExtension,
type UninstallPublishedExtensionOptions,
} from "../../extensions/modular/ModularCore/write/uninstallPublishedExtension.js";
export {
uninstallExtensionByProxy,
type UninstallExtensionByProxyOptions,
} from "../../extensions/modular/ModularCore/write/uninstallExtensionByProxy.js";
@@ -1,98 +0,0 @@
export { ThirdwebProvider } from "../react/core/providers/thirdweb-provider.js";
// react/core
export {
useSetActiveWallet,
useActiveWalletChain,
useConnect,
useDisconnect,
useActiveAccount,
useActiveWallet,
useConnectedWallets,
useSwitchActiveWalletChain,
useActiveWalletConnectionStatus,
useSetActiveWalletConnectionStatus,
useIsAutoConnecting,
} from "../react/core/hooks/wallets/wallet-hooks.js";
export { useWalletBalance } from "../react/core/hooks/others/useWalletBalance.js";
// contract related
export { useReadContract } from "../react/core/hooks/contract/useReadContract.js";
export { useEstimateGas } from "../react/core/hooks/contract/useEstimateGas.js";
export { useWaitForReceipt } from "../react/core/hooks/contract/useWaitForReceipt.js";
export { useContractEvents } from "../react/core/hooks/contract/useContractEvents.js";
// rpc related
export {
useBlockNumber,
type UseBlockNumberOptions,
} from "../react/core/hooks/rpc/useBlockNumber.js";
// utils
export { createContractQuery } from "../react/core/utils/createQuery.js";
export { useInvalidateContractQuery } from "../react/core/hooks/others/useInvalidateQueries.js";
// pay
export {
useBuyWithCryptoQuote,
type BuyWithCryptoQuoteQueryOptions,
} from "../react/core/hooks/pay/useBuyWithCryptoQuote.js";
export { useBuyWithCryptoStatus } from "../react/core/hooks/pay/useBuyWithCryptoStatus.js";
export {
useBuyWithCryptoHistory,
type BuyWithCryptoHistoryQueryOptions,
} from "../react/core/hooks/pay/useBuyWithCryptoHistory.js";
export {
useBuyWithFiatQuote,
type BuyWithFiatQuoteQueryOptions,
} from "../react/core/hooks/pay/useBuyWithFiatQuote.js";
export { useBuyWithFiatStatus } from "../react/core/hooks/pay/useBuyWithFiatStatus.js";
export {
useBuyWithFiatHistory,
type BuyWithFiatHistoryQueryOptions,
} from "../react/core/hooks/pay/useBuyWithFiatHistory.js";
export {
useBuyHistory,
type BuyHistoryQueryOptions,
} from "../react/core/hooks/pay/useBuyHistory.js";
export {
usePostOnRampQuote,
type PostOnRampQuoteQueryOptions,
} from "../react/core/hooks/pay/usePostOnrampQuote.js";
import { useSendTransactionCore } from "../react/core/hooks/contract/useSendTransaction.js";
/**
* A hook to send a transaction.
* @returns A mutation object to send a transaction.
* @example
* ```jsx
* import { useSendTransaction } from "thirdweb/react-native";
* const { mutate: sendTx, data: transactionResult } = useSendTransaction();
*
* // later
* sendTx(tx);
* ```
* @transaction
*/
export const useSendTransaction = useSendTransactionCore;
export { useSendBatchTransaction } from "../react/core/hooks/contract/useSendBatchTransaction.js";
export { useSendAndConfirmTransaction } from "../react/core/hooks/contract/useSendAndConfirmTransaction.js";
export { useEstimateGasCost } from "../react/core/hooks/contract/useEstimateGasCost.js";
// Components
export {
AutoConnect,
type AutoConnectProps,
} from "../react/core/hooks/connection/AutoConnect.js";
export { useAutoConnect } from "../react/core/hooks/connection/useAutoConnect.js";
export { TransactionButton } from "../react/native/ui/TransactionButton/TrabsactionButton.js";
export type { TransactionButtonProps } from "../react/core/hooks/transaction/button-core.js";
// wallet info
export {
useWalletInfo,
useWalletImage,
} from "../react/web/ui/hooks/useWalletInfo.js";
@@ -0,0 +1,87 @@
export { ThirdwebProvider } from "../react/core/providers/thirdweb-provider.js";
// wallet hooks
export { useActiveWallet } from "../react/native/hooks/wallets/useActiveWallet.js";
export { useActiveWalletChain } from "../react/native/hooks/wallets/useActiveWalletChain.js";
export { useActiveWalletConnectionStatus } from "../react/native/hooks/wallets/useActiveWalletConnectionStatus.js";
export { useActiveAccount } from "../react/native/hooks/wallets/useActiveAccount.js";
export { useAutoConnect } from "../react/native/hooks/wallets/useAutoConnect.js";
export { useCapabilities } from "../react/native/hooks/wallets/useCapabilities.js";
export { useConnect } from "../react/native/hooks/wallets/useConnect.js";
export { useConnectedWallets } from "../react/native/hooks/wallets/useConnectedWallets.js";
export { useDisconnect } from "../react/native/hooks/wallets/useDisconnect.js";
export { useIsAutoConnecting } from "../react/native/hooks/wallets/useIsAutoConnecting.js";
export { useSetActiveWallet } from "../react/native/hooks/wallets/useSetActiveWallet.js";
export { useSetActiveWalletConnectionStatus } from "../react/native/hooks/wallets/useSetActiveWalletConnectionStatus.js";
export { useSendCalls } from "../react/native/hooks/wallets/useSendCalls.js";
export { useSwitchActiveWalletChain } from "../react/native/hooks/wallets/useSwitchActiveWalletChain.js";
export { useCallsStatus } from "../react/native/hooks/wallets/useCallsStatus.js";
export { useWalletBalance } from "../react/core/hooks/others/useWalletBalance.js";
// contract
export { useReadContract } from "../react/core/hooks/contract/useReadContract.js";
export { useWaitForReceipt } from "../react/core/hooks/contract/useWaitForReceipt.js";
export { useContractEvents } from "../react/core/hooks/contract/useContractEvents.js";
// transaction
export {
type SendTransactionConfig,
type SendTransactionPayModalConfig,
} from "../react/core/hooks/transaction/useSendTransaction.js";
export { useSimulateTransaction } from "../react/core/hooks/transaction/useSimulateTransaction.js";
export { useSendTransaction } from "../react/native/hooks/transaction/useSendTransaction.js";
export { useSendBatchTransaction } from "../react/native/hooks/transaction/useSendBatchTransaction.js";
export { useSendAndConfirmTransaction } from "../react/native/hooks/transaction/useSendAndConfirmTransaction.js";
export { useEstimateGas } from "../react/native/hooks/transaction/useEstimateGas.js";
export { useEstimateGasCost } from "../react/native/hooks/transaction/useEstimateGasCost.js";
// rpc related
export {
useBlockNumber,
type UseBlockNumberOptions,
} from "../react/core/hooks/rpc/useBlockNumber.js";
// utils
export { createContractQuery } from "../react/core/utils/createQuery.js";
export { useInvalidateContractQuery } from "../react/core/hooks/others/useInvalidateQueries.js";
// pay
export {
useBuyWithCryptoQuote,
type BuyWithCryptoQuoteQueryOptions,
} from "../react/core/hooks/pay/useBuyWithCryptoQuote.js";
export { useBuyWithCryptoStatus } from "../react/core/hooks/pay/useBuyWithCryptoStatus.js";
export {
useBuyWithCryptoHistory,
type BuyWithCryptoHistoryQueryOptions,
} from "../react/core/hooks/pay/useBuyWithCryptoHistory.js";
export {
useBuyWithFiatQuote,
type BuyWithFiatQuoteQueryOptions,
} from "../react/core/hooks/pay/useBuyWithFiatQuote.js";
export { useBuyWithFiatStatus } from "../react/core/hooks/pay/useBuyWithFiatStatus.js";
export {
useBuyWithFiatHistory,
type BuyWithFiatHistoryQueryOptions,
} from "../react/core/hooks/pay/useBuyWithFiatHistory.js";
export {
useBuyHistory,
type BuyHistoryQueryOptions,
} from "../react/core/hooks/pay/useBuyHistory.js";
export {
usePostOnRampQuote,
type PostOnRampQuoteQueryOptions,
} from "../react/core/hooks/pay/usePostOnrampQuote.js";
// Components
export { AutoConnect } from "../react/native/ui/AutoConnect/AutoConnect.js";
export type { AutoConnectProps } from "../react/core/hooks/connection/types.js";
export { TransactionButton } from "../react/native/ui/TransactionButton/TrabsactionButton.js";
export type { TransactionButtonProps } from "../react/core/hooks/transaction/transaction-button-utils.js";
// wallet info
export {
useWalletInfo,
useWalletImage,
} from "../react/web/ui/hooks/useWalletInfo.js";

Some files were not shown because too many files have changed in this diff Show More