Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4389083ca3 | ||
|
|
4961b597a0 | ||
|
|
7e044c664d | ||
|
|
498df5d69a | ||
|
|
b8d4930305 | ||
|
|
2c0bb07899 | ||
|
|
72ada47596 | ||
|
|
dc9eee735c | ||
|
|
b4aee9b591 | ||
|
|
b5c6eedb38 | ||
|
|
8672c8533c | ||
|
|
bb207473f8 | ||
|
|
10b3a717da | ||
|
|
aa81bedaf2 | ||
|
|
b4676e1b4e | ||
|
|
0135a7790c | ||
|
|
2d088d367c | ||
|
|
546353a479 | ||
|
|
9daf044926 | ||
|
|
7054f9f016 | ||
|
|
a3bb17cb33 | ||
|
|
d03645aefd | ||
|
|
53626f8100 | ||
|
|
8a389f1295 | ||
|
|
4e5eb13b82 | ||
|
|
2b11353909 | ||
|
|
5882091eab | ||
|
|
8fc5f204b0 | ||
|
|
c953571588 | ||
|
|
edcd22d612 | ||
|
|
0d5503aae9 | ||
|
|
998e521733 | ||
|
|
be606dd3c9 | ||
|
|
d794b8f9f4 | ||
|
|
21b29490d4 | ||
|
|
7b1d62b323 | ||
|
|
e78da6b36c | ||
|
|
ed711c8cb2 | ||
|
|
05a7495a13 | ||
|
|
11bb053246 | ||
|
|
efb3546ec8 |
+7
-7
@@ -34,19 +34,19 @@
|
|||||||
"packageManager": "[email protected]",
|
"packageManager": "[email protected]",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@changesets/changelog-github": "^0.4.8",
|
"@changesets/changelog-github": "^0.4.8",
|
||||||
"@changesets/cli": "^2.26.1",
|
"@changesets/cli": "^2.26.2",
|
||||||
"@changesets/get-dependents-graph": "^1.3.5",
|
"@changesets/get-dependents-graph": "^1.3.6",
|
||||||
"@changesets/get-release-plan": "^3.0.16",
|
"@changesets/get-release-plan": "^3.0.17",
|
||||||
"@changesets/parse": "^0.3.16",
|
"@changesets/parse": "^0.3.16",
|
||||||
"@manypkg/cli": "^0.20.0",
|
"@manypkg/cli": "^0.20.0",
|
||||||
"@manypkg/get-packages": "^1.1.3",
|
"@manypkg/get-packages": "^1.1.3",
|
||||||
"@playwright/test": "1.31.2",
|
"@playwright/test": "1.31.2",
|
||||||
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
||||||
"@types/node": "^18.15.11",
|
"@types/node": "^18.16.18",
|
||||||
"eslint": "^8.42.0",
|
"eslint": "^8.43.0",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.8",
|
||||||
"turbo": "^1.9.8",
|
"turbo": "^1.10.6",
|
||||||
"yalc": "1.0.0-pre.53"
|
"yalc": "1.0.0-pre.53"
|
||||||
},
|
},
|
||||||
"manypkg": {
|
"manypkg": {
|
||||||
|
|||||||
@@ -1,5 +1,42 @@
|
|||||||
# @thirdweb-dev/auth
|
# @thirdweb-dev/auth
|
||||||
|
|
||||||
|
## 3.2.9
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`10b3a717`](https://github.com/thirdweb-dev/js/commit/10b3a717da606632a05769ac821bdd21d6b63a03), [`b4aee9b5`](https://github.com/thirdweb-dev/js/commit/b4aee9b59121bab5f9b3d9b7ecdc4bcb4cd66f58)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.5
|
||||||
|
|
||||||
|
## 3.2.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
- Updated dependencies [[`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.4
|
||||||
|
|
||||||
|
## 3.2.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`2b113539`](https://github.com/thirdweb-dev/js/commit/2b113539098384f910b3c4d54e1fde9d35a6f053), [`be606dd3`](https://github.com/thirdweb-dev/js/commit/be606dd3c93c1514834c1d970e864d7f949a07ab), [`998e5217`](https://github.com/thirdweb-dev/js/commit/998e521733efd6a67e42f9bf0beab5fbdccf08ae)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.3
|
||||||
|
|
||||||
|
## 3.2.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`ed711c8c`](https://github.com/thirdweb-dev/js/commit/ed711c8cb2ed6a0deb1b2a5eeec06df1d4edc5e8), [`05a7495a`](https://github.com/thirdweb-dev/js/commit/05a7495a132aabab5f48abbdb80a468ff6f65df8), [`e78da6b3`](https://github.com/thirdweb-dev/js/commit/e78da6b36cfa6d954234820563201bf760186ed1)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.2
|
||||||
|
|
||||||
|
## 3.2.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`efb3546e`](https://github.com/thirdweb-dev/js/commit/efb3546ec8268156be00301af28b9d83ecd5ab08)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.1
|
||||||
|
|
||||||
## 3.2.4
|
## 3.2.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
+19
-19
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/auth",
|
"name": "@thirdweb-dev/auth",
|
||||||
"version": "3.2.4",
|
"version": "3.2.9",
|
||||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||||
"browser": {
|
"browser": {
|
||||||
@@ -80,29 +80,29 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.19.3",
|
"@babel/core": "^7.22.5",
|
||||||
"@babel/preset-env": "^7.18.10",
|
"@babel/preset-env": "^7.22.5",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.22.5",
|
||||||
"@microsoft/api-documenter": "^7.19.4",
|
"@microsoft/api-documenter": "^7.22.21",
|
||||||
"@microsoft/api-extractor": "^7.29.2",
|
"@microsoft/api-extractor": "^7.36.0",
|
||||||
"@microsoft/tsdoc": "^0.14.1",
|
"@microsoft/tsdoc": "^0.14.1",
|
||||||
"@preconstruct/cli": "^2.2.1",
|
"@preconstruct/cli": "^2.7.0",
|
||||||
"@solana/web3.js": "^1.62.0",
|
"@solana/web3.js": "^1.62.0",
|
||||||
"@swc-node/register": "^1.5.1",
|
"@swc-node/register": "^1.6.6",
|
||||||
"@swc/core": "^1.3.23",
|
"@swc/core": "^1.3.67",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"@types/chai": "^4.3.3",
|
"@types/chai": "^4.3.5",
|
||||||
"@types/cookie": "^0.5.1",
|
"@types/cookie": "^0.5.1",
|
||||||
"@types/cookie-parser": "^1.4.3",
|
"@types/cookie-parser": "^1.4.3",
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"@types/mocha": "^10.0.0",
|
"@types/mocha": "^10.0.0",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||||
"@typescript-eslint/parser": "^5.33.0",
|
"@typescript-eslint/parser": "^5.60.1",
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.6",
|
||||||
"cookie-parser": "^1.4.6",
|
"cookie-parser": "^1.4.6",
|
||||||
"eslint": "^8.42.0",
|
"eslint": "^8.43.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||||
@@ -111,10 +111,10 @@
|
|||||||
"ethers": "^5.7.2",
|
"ethers": "^5.7.2",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"next": "^12.2.0",
|
"next": "^12.3.4",
|
||||||
"next-auth": "^4.20.1",
|
"next-auth": "^4.22.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.8",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@solana/web3.js": "^1.73.0",
|
"@solana/web3.js": "^1.73.0",
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
# @thirdweb-dev/chains
|
# @thirdweb-dev/chains
|
||||||
|
|
||||||
|
## 0.1.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1299](https://github.com/thirdweb-dev/js/pull/1299) [`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5) Thanks [@nkrishang](https://github.com/nkrishang)! - Add ERC721LoyaltyCard and ERC721UpdatableMetadata
|
||||||
|
|
||||||
|
- [#1297](https://github.com/thirdweb-dev/js/pull/1297) [`b5c6eedb`](https://github.com/thirdweb-dev/js/commit/b5c6eedb38aa3c52eb97f3d25ad83e38c55afe61) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - add zksync as default chain
|
||||||
|
|
||||||
|
- [#1309](https://github.com/thirdweb-dev/js/pull/1309) [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352) Thanks [@jnsdls](https://github.com/jnsdls)! - unblock storage domains
|
||||||
|
|
||||||
|
## 0.1.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
- [#1281](https://github.com/thirdweb-dev/js/pull/1281) [`a3bb17cb`](https://github.com/thirdweb-dev/js/commit/a3bb17cb33f033846fb3b4c8a0a4809ba76cab96) Thanks [@nkrishang](https://github.com/nkrishang)! - Handle ERC4337Signer correctly for signTypedData
|
||||||
|
|
||||||
|
## 0.1.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1276](https://github.com/thirdweb-dev/js/pull/1276) [`5882091e`](https://github.com/thirdweb-dev/js/commit/5882091eab65978009a5a5305701f121851b10ad) Thanks [@MananTank](https://github.com/MananTank)! - Do not change order or RPCs in `getChainRPCs` to Fix RPC override issue
|
||||||
|
|
||||||
## 0.1.25
|
## 0.1.25
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ export default {
|
|||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://ethereum.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://ethereum.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
|
||||||
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
|
"https://mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||||
"wss://mainnet.infura.io/ws/v3/${INFURA_API_KEY}",
|
"wss://mainnet.infura.io/ws/v3/${INFURA_API_KEY}",
|
||||||
|
"https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://api.mycryptoapi.com/eth",
|
"https://api.mycryptoapi.com/eth",
|
||||||
"https://cloudflare-eth.com",
|
"https://cloudflare-eth.com",
|
||||||
"https://ethereum.publicnode.com"
|
"https://ethereum.publicnode.com"
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ export default {
|
|||||||
"chain": "ETH",
|
"chain": "ETH",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://optimism.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://optimism.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
|
||||||
"https://optimism-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
"https://optimism-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||||
|
"https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://mainnet.optimism.io/"
|
"https://mainnet.optimism.io/"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Mintara Testnet",
|
||||||
|
"title": "Mintara Testnet",
|
||||||
|
"chain": "Mintara",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafybeie7jzlzlpz7c3a3oh4x5joej23dj2qf3cexmchjyc72hv3fblcaja",
|
||||||
|
"width": 256,
|
||||||
|
"height": 256,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://mintara-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://subnets.avax.network/mintara/testnet/rpc"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "MINTARA",
|
||||||
|
"symbol": "MNTR",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://playthink.co.jp",
|
||||||
|
"shortName": "mintara-testnet",
|
||||||
|
"chainId": 1079,
|
||||||
|
"networkId": 1079,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "explorer",
|
||||||
|
"url": "https://subnets-test.avax.network/mintara",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "mintara-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Metachain One Mainnet",
|
||||||
|
"chain": "METAO",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmTmo2QAtX5PbhX96vewnvH4Vc5H83Ft2DJGi6tAqTcFij",
|
||||||
|
"width": 1000,
|
||||||
|
"height": 981,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://metachain-one.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.metachain.one",
|
||||||
|
"https://rpc2.metachain.one"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Metao",
|
||||||
|
"symbol": "METAO",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://metachain.one",
|
||||||
|
"shortName": "metao",
|
||||||
|
"chainId": 112358,
|
||||||
|
"networkId": 112358,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "blockscout",
|
||||||
|
"url": "https://explorer.metachain.one",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafybeifu5tpui7dk5cjoo54kde7pmuthvnl7sdykobuarsxgu7t2izurnq",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "metachain-one"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -10,8 +10,8 @@ export default {
|
|||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://polygon.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://polygon.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
|
||||||
"https://polygon-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
"https://polygon-mainnet.infura.io/v3/${INFURA_API_KEY}",
|
||||||
|
"https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://polygon-rpc.com/",
|
"https://polygon-rpc.com/",
|
||||||
"https://rpc-mainnet.matic.network",
|
"https://rpc-mainnet.matic.network",
|
||||||
"https://matic-mainnet.chainstacklabs.com",
|
"https://matic-mainnet.chainstacklabs.com",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { Chain } from "../src/types";
|
import type { Chain } from "../src/types";
|
||||||
export default {
|
export default {
|
||||||
"name": "Taro Testnet",
|
"name": "Bubs Testnet",
|
||||||
"chain": "gETH",
|
"chain": "gETH",
|
||||||
"shortName": "Taro",
|
"shortName": "Bubs",
|
||||||
"chainId": 1582,
|
"chainId": 1582,
|
||||||
"testnet": true,
|
"testnet": true,
|
||||||
"icon": {
|
"icon": {
|
||||||
@@ -12,8 +12,8 @@ export default {
|
|||||||
"height": 512
|
"height": 512
|
||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://taro-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://bubs-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://taro-testnet.calderachain.xyz/http"
|
"https://bubs.calderachain.xyz/http"
|
||||||
],
|
],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"decimals": 18,
|
"decimals": 18,
|
||||||
@@ -22,15 +22,15 @@ export default {
|
|||||||
},
|
},
|
||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"url": "https://explorer.tarotestnet.com",
|
"url": "https://explorer.bubstestnet.com",
|
||||||
"name": "Taro Testnet Explorer",
|
"name": "Bubs Testnet Explorer",
|
||||||
"standard": "EIP3091"
|
"standard": "EIP3091"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://tarotestnet.com"
|
"https://bubstestnet.com"
|
||||||
],
|
],
|
||||||
"infoURL": "https://tarotestnet.com",
|
"infoURL": "https://bubstestnet.com",
|
||||||
"networkId": 1582,
|
"networkId": 1582,
|
||||||
"slug": "taro-testnet"
|
"slug": "bubs-testnet"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Moonsama Network",
|
||||||
|
"chain": "MSN",
|
||||||
|
"rpc": [
|
||||||
|
"https://moonsama-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.moonsama.com",
|
||||||
|
"wss://rpc.moonsama.com/ws"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://multiverse.moonsama.com/faucet"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Sama Token",
|
||||||
|
"symbol": "SAMA",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://moonsama.com",
|
||||||
|
"shortName": "msn",
|
||||||
|
"chainId": 2199,
|
||||||
|
"networkId": 2199,
|
||||||
|
"slip44": 2199,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmaQxfwpXYTomUd24PMx5tKjosupXcm99z1jL1XLq9LWBS",
|
||||||
|
"width": 468,
|
||||||
|
"height": 468,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "blockscout",
|
||||||
|
"url": "https://explorer.moonsama.com",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafybeifu5tpui7dk5cjoo54kde7pmuthvnl7sdykobuarsxgu7t2izurnq",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "moonsama-network"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Plinga Mainnet",
|
||||||
|
"chain": "Plinga",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafybeibpvlod5nyev6wyuvp6pbestmgvru3ovbadsul32odpno26xwld6y",
|
||||||
|
"width": 1039,
|
||||||
|
"height": 1022,
|
||||||
|
"format": "svg"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://plinga.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpcurl.mainnet.plgchain.com",
|
||||||
|
"https://rpcurl.plgchain.blockchain.evmnode.online",
|
||||||
|
"https://rpcurl.mainnet.plgchain.plinga.technology"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Plinga",
|
||||||
|
"symbol": "PLINGA",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.plinga.technology/",
|
||||||
|
"shortName": "plgchain",
|
||||||
|
"chainId": 242,
|
||||||
|
"networkId": 242,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "plgscan",
|
||||||
|
"url": "https://www.plgscan.com",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "plinga"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Botanix Testnet",
|
||||||
|
"chain": "BTC",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://Qmf2iSjcrZwUDKhCVY9ZzfbSV2He2HSssbcG2yMz1mDerm",
|
||||||
|
"width": 32,
|
||||||
|
"height": 32,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://botanix-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://testnet-rpc.btxtestchain.com"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://faucet.btxtestchain.com"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Botanix",
|
||||||
|
"symbol": "BTC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://btxtestchain.com",
|
||||||
|
"shortName": "BTCt",
|
||||||
|
"chainId": 3636,
|
||||||
|
"networkId": 3636,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Botanix",
|
||||||
|
"url": "https://testnet.btxtestchain.com",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "botanix-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Botanix Mainnet",
|
||||||
|
"chain": "BTC",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://Qmf2iSjcrZwUDKhCVY9ZzfbSV2He2HSssbcG2yMz1mDerm",
|
||||||
|
"width": 32,
|
||||||
|
"height": 32,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://botanix.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.btxtestchain.com"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://faucet.btxtestchain.com"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Botanix",
|
||||||
|
"symbol": "BTC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://btxtestchain.com",
|
||||||
|
"shortName": "BTCm",
|
||||||
|
"chainId": 3637,
|
||||||
|
"networkId": 3637,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Botanix",
|
||||||
|
"url": "https://btxtestchain.com",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "botanix"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "AltLayer Zero Gas Network",
|
||||||
|
"chain": "ETH",
|
||||||
|
"rpc": [
|
||||||
|
"https://altlayer-zero-gas-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://zero.alt.technology"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "ZERO",
|
||||||
|
"symbol": "ZERO",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP155"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"infoURL": "https://altlayer.io",
|
||||||
|
"shortName": "alt-zerogas",
|
||||||
|
"chainId": 4000003,
|
||||||
|
"networkId": 4000003,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmcEfZJU7NMn9ycTAcEooQgGNfa2nYBToSUZHdFCFadcjb",
|
||||||
|
"width": 1080,
|
||||||
|
"height": 1025,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "blockscout",
|
||||||
|
"url": "https://zero-explorer.alt.technology",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafybeifu5tpui7dk5cjoo54kde7pmuthvnl7sdykobuarsxgu7t2izurnq",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "altlayer-zero-gas-network"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -4,8 +4,8 @@ export default {
|
|||||||
"chain": "ETH",
|
"chain": "ETH",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://optimism-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://optimism-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://opt-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
|
||||||
"https://optimism-goerli.infura.io/v3/${INFURA_API_KEY}",
|
"https://optimism-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
|
"https://opt-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://goerli.optimism.io/"
|
"https://goerli.optimism.io/"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ export default {
|
|||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://arbitrum-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://arbitrum-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
|
||||||
"https://arbitrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
"https://arbitrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
|
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://goerli-rollup.arbitrum.io/rpc/"
|
"https://goerli-rollup.arbitrum.io/rpc/"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "MEVerse Chain Testnet",
|
||||||
|
"chain": "MEVerse",
|
||||||
|
"rpc": [
|
||||||
|
"https://meverse-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.meversetestnet.io"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "MEVerse",
|
||||||
|
"symbol": "MEV",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.meverse.sg",
|
||||||
|
"shortName": "TESTMEV",
|
||||||
|
"chainId": 4759,
|
||||||
|
"networkId": 4759,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmPuQ6gaCfUtNdRuaEDbdhot2m2KCy2ZHCJUvZXJAtdeyJ",
|
||||||
|
"width": 800,
|
||||||
|
"height": 800,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "MEVerse Chain Testnet Explorer",
|
||||||
|
"url": "https://testnet.meversescan.io",
|
||||||
|
"standard": "none",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmPuQ6gaCfUtNdRuaEDbdhot2m2KCy2ZHCJUvZXJAtdeyJ",
|
||||||
|
"width": 800,
|
||||||
|
"height": 800,
|
||||||
|
"format": "png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "meverse-chain-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -5,9 +5,9 @@ export default {
|
|||||||
"chain": "ETH",
|
"chain": "ETH",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
|
||||||
"https://goerli.infura.io/v3/${INFURA_API_KEY}",
|
"https://goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
"wss://goerli.infura.io/v3/${INFURA_API_KEY}",
|
"wss://goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
|
"https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://rpc.goerli.mudit.blog/",
|
"https://rpc.goerli.mudit.blog/",
|
||||||
"https://ethereum-goerli.publicnode.com"
|
"https://ethereum-goerli.publicnode.com"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Shinarium Beta",
|
||||||
|
"chain": "Shinarium",
|
||||||
|
"rpc": [
|
||||||
|
"https://shinarium-beta.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.shinarium.org"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://faucet.shinarium.org"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Shina Inu",
|
||||||
|
"symbol": "SHI",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://shinarium.org",
|
||||||
|
"shortName": "shi",
|
||||||
|
"chainId": 534849,
|
||||||
|
"networkId": 534849,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "shinascan",
|
||||||
|
"url": "https://shinascan.shinarium.org",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "shinarium-beta"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -5,6 +5,7 @@ export default {
|
|||||||
"rpc": [
|
"rpc": [
|
||||||
"https://rollux.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://rollux.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://rpc.rollux.com",
|
"https://rpc.rollux.com",
|
||||||
|
"https://rollux.public-rpc.com",
|
||||||
"wss://rpc.rollux.com/wss",
|
"wss://rpc.rollux.com/wss",
|
||||||
"https://rpc.ankr.com/rollux/${ANKR_API_KEY}"
|
"https://rpc.ankr.com/rollux/${ANKR_API_KEY}"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ export default {
|
|||||||
"chain": "ETH",
|
"chain": "ETH",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://linea-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://linea-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://rpc.goerli.linea.build",
|
|
||||||
"wss://rpc.goerli.linea.build",
|
|
||||||
"https://linea-goerli.infura.io/v3/${INFURA_API_KEY}",
|
"https://linea-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
"wss://linea-goerli.infura.io/v3/${INFURA_API_KEY}"
|
"wss://linea-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
|
"https://rpc.goerli.linea.build",
|
||||||
|
"wss://rpc.goerli.linea.build"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://faucetlink.to/goerli"
|
"https://faucetlink.to/goerli"
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Cascadia Testnet",
|
||||||
|
"chain": "Cascadia",
|
||||||
|
"rpc": [
|
||||||
|
"https://cascadia-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://testnet.cascadia.foundation"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://www.cascadia.foundation/faucet"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "CC",
|
||||||
|
"symbol": "tCC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.cascadia.foundation",
|
||||||
|
"shortName": "cascadia",
|
||||||
|
"chainId": 6102,
|
||||||
|
"networkId": 6102,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmQtcwxNiJ9D1QDz4k6jZ7qacLcqMk6CeW85TTBWBvNp3z",
|
||||||
|
"width": 256,
|
||||||
|
"height": 256,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Cascadia EVM Explorer",
|
||||||
|
"url": "https://explorer.cascadia.foundation",
|
||||||
|
"standard": "none",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmQtcwxNiJ9D1QDz4k6jZ7qacLcqMk6CeW85TTBWBvNp3z",
|
||||||
|
"width": 256,
|
||||||
|
"height": 256,
|
||||||
|
"format": "png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Cascadia Cosmos Explorer",
|
||||||
|
"url": "https://validator.cascadia.foundation",
|
||||||
|
"standard": "none",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmQtcwxNiJ9D1QDz4k6jZ7qacLcqMk6CeW85TTBWBvNp3z",
|
||||||
|
"width": 256,
|
||||||
|
"height": 256,
|
||||||
|
"format": "png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "cascadia-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Avocado",
|
||||||
|
"chain": "Avocado",
|
||||||
|
"rpc": [
|
||||||
|
"https://avocado.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.avocado.instadapp.io"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "USDC",
|
||||||
|
"symbol": "USDC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://avocado.instadapp.io",
|
||||||
|
"shortName": "avocado",
|
||||||
|
"chainId": 634,
|
||||||
|
"networkId": 634,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://Qma9rJSgy32UL1iXtXKFZQJA6FjkcUcDU4HR6y13Wu1vjn",
|
||||||
|
"width": 600,
|
||||||
|
"height": 600,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "avoscan",
|
||||||
|
"url": "https://avoscan.co",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://Qma9rJSgy32UL1iXtXKFZQJA6FjkcUcDU4HR6y13Wu1vjn",
|
||||||
|
"width": 600,
|
||||||
|
"height": 600,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"standard": "none"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "avocado"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "ALL Mainnet",
|
||||||
|
"chain": "ALL",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafkreibqe2mgiqezi24sx272kunqt6pv7uzxhpkxuobvpbsptce3q6nn5i",
|
||||||
|
"width": 1000,
|
||||||
|
"height": 1000,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://all.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://mainnet-rpc.alltra.global"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "ALL",
|
||||||
|
"symbol": "ALL",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://alltra.world",
|
||||||
|
"shortName": "ALL",
|
||||||
|
"chainId": 651940,
|
||||||
|
"networkId": 651940,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Alltra SmartChain Explorer",
|
||||||
|
"url": "https://alltra.global",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "all"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -10,8 +10,7 @@ export default {
|
|||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://zetachain-athens-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://zetachain-athens-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://zetachain-athens-evm.blockpi.network/v1/rpc/public",
|
"https://api.athens2.zetachain.com/evm"
|
||||||
"wss://zetachain-athens.blockpi.network/rpc/v1/public/websocket"
|
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://labs.zetachain.com/get-zeta"
|
"https://labs.zetachain.com/get-zeta"
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "MEVerse Chain Mainnet",
|
||||||
|
"chain": "MEVerse",
|
||||||
|
"rpc": [
|
||||||
|
"https://meverse-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.meversemainnet.io"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "MEVerse",
|
||||||
|
"symbol": "MEV",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.meverse.sg",
|
||||||
|
"shortName": "MEV",
|
||||||
|
"chainId": 7518,
|
||||||
|
"networkId": 7518,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmPuQ6gaCfUtNdRuaEDbdhot2m2KCy2ZHCJUvZXJAtdeyJ",
|
||||||
|
"width": 800,
|
||||||
|
"height": 800,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "MEVerse Chain Explorer",
|
||||||
|
"url": "https://www.meversescan.io",
|
||||||
|
"standard": "none",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmPuQ6gaCfUtNdRuaEDbdhot2m2KCy2ZHCJUvZXJAtdeyJ",
|
||||||
|
"width": 800,
|
||||||
|
"height": 800,
|
||||||
|
"format": "png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "meverse-chain"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -11,8 +11,8 @@ export default {
|
|||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://mumbai.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://mumbai.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
|
||||||
"https://polygon-mumbai.infura.io/v3/${INFURA_API_KEY}",
|
"https://polygon-mumbai.infura.io/v3/${INFURA_API_KEY}",
|
||||||
|
"https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://matic-mumbai.chainstacklabs.com",
|
"https://matic-mumbai.chainstacklabs.com",
|
||||||
"https://rpc-mumbai.maticvigil.com",
|
"https://rpc-mumbai.maticvigil.com",
|
||||||
"https://matic-testnet-archive-rpc.bwarelabs.com",
|
"https://matic-testnet-archive-rpc.bwarelabs.com",
|
||||||
|
|||||||
@@ -26,19 +26,8 @@ export default {
|
|||||||
},
|
},
|
||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "Evmos EVM Explorer",
|
"name": "Evmos Explorer (Escan)",
|
||||||
"url": "https://evm.evmos.dev",
|
"url": "https://testnet.escan.live",
|
||||||
"standard": "EIP3091",
|
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://QmeZW6VKUFTbz7PPW8PmDR3ZHa6osYPLBFPnW8T5LSU49c",
|
|
||||||
"width": 400,
|
|
||||||
"height": 400,
|
|
||||||
"format": "png"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Evmos Cosmos Explorer",
|
|
||||||
"url": "https://explorer.evmos.dev",
|
|
||||||
"standard": "none",
|
"standard": "none",
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://QmeZW6VKUFTbz7PPW8PmDR3ZHa6osYPLBFPnW8T5LSU49c",
|
"url": "ipfs://QmeZW6VKUFTbz7PPW8PmDR3ZHa6osYPLBFPnW8T5LSU49c",
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ export default {
|
|||||||
"chain": "Evmos",
|
"chain": "Evmos",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://evmos.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://evmos.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://eth.bd.evmos.org:8545",
|
|
||||||
"https://evmos-evm.publicnode.com"
|
"https://evmos-evm.publicnode.com"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
@@ -25,7 +24,7 @@ export default {
|
|||||||
},
|
},
|
||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "Evmos EVM Explorer (Escan)",
|
"name": "Evmos Explorer (Escan)",
|
||||||
"url": "https://escan.live",
|
"url": "https://escan.live",
|
||||||
"standard": "none",
|
"standard": "none",
|
||||||
"icon": {
|
"icon": {
|
||||||
@@ -34,17 +33,6 @@ export default {
|
|||||||
"height": 400,
|
"height": 400,
|
||||||
"format": "png"
|
"format": "png"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Evmos Cosmos Explorer (Mintscan)",
|
|
||||||
"url": "https://www.mintscan.io/evmos",
|
|
||||||
"standard": "none",
|
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://QmeZW6VKUFTbz7PPW8PmDR3ZHa6osYPLBFPnW8T5LSU49c",
|
|
||||||
"width": 400,
|
|
||||||
"height": 400,
|
|
||||||
"format": "png"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"testnet": false,
|
"testnet": false,
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
/** @type {Omit<Chain, "slug">} */
|
/** @type {Omit<Chain, "slug">} */
|
||||||
export default {
|
export default {
|
||||||
name: "Taro Testnet",
|
name: "Bubs Testnet",
|
||||||
chain: "gETH",
|
chain: "gETH",
|
||||||
shortName: "Taro",
|
shortName: "Bubs",
|
||||||
chainId: 1582,
|
chainId: 1582,
|
||||||
testnet: true,
|
testnet: true,
|
||||||
icon: {
|
icon: {
|
||||||
@@ -14,7 +14,7 @@ export default {
|
|||||||
width: 512,
|
width: 512,
|
||||||
height: 512,
|
height: 512,
|
||||||
},
|
},
|
||||||
rpc: ["https://taro-testnet.calderachain.xyz/http"],
|
rpc: ["https://bubs.calderachain.xyz/http"],
|
||||||
nativeCurrency: {
|
nativeCurrency: {
|
||||||
decimals: 18,
|
decimals: 18,
|
||||||
name: "Ether",
|
name: "Ether",
|
||||||
@@ -22,12 +22,12 @@ export default {
|
|||||||
},
|
},
|
||||||
explorers: [
|
explorers: [
|
||||||
{
|
{
|
||||||
url: "https://explorer.tarotestnet.com",
|
url: "https://explorer.bubstestnet.com",
|
||||||
name: "Taro Testnet Explorer",
|
name: "Bubs Testnet Explorer",
|
||||||
standard: "EIP3091",
|
standard: "EIP3091",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
faucets: ["https://tarotestnet.com"],
|
faucets: ["https://bubstestnet.com"],
|
||||||
infoURL: "https://tarotestnet.com",
|
infoURL: "https://bubstestnet.com",
|
||||||
networkId: 1582,
|
networkId: 1582,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/chains",
|
"name": "@thirdweb-dev/chains",
|
||||||
"version": "0.1.25",
|
"version": "0.1.28",
|
||||||
"main": "dist/thirdweb-dev-chains.cjs.js",
|
"main": "dist/thirdweb-dev-chains.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-chains.esm.js",
|
"module": "dist/thirdweb-dev-chains.esm.js",
|
||||||
"browser": {
|
"browser": {
|
||||||
@@ -23,18 +23,18 @@
|
|||||||
},
|
},
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.19.3",
|
"@babel/core": "^7.22.5",
|
||||||
"@babel/preset-env": "^7.18.10",
|
"@babel/preset-env": "^7.22.5",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.22.5",
|
||||||
"@babel/runtime": "^7.19.0",
|
"@babel/runtime": "^7.22.5",
|
||||||
"@preconstruct/cli": "^2.2.1",
|
"@preconstruct/cli": "^2.7.0",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.4.0",
|
||||||
"deepmerge": "^4.3.0",
|
"deepmerge": "^4.3.1",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"jest": "^29.4.3",
|
"jest": "^29.4.3",
|
||||||
"plop": "^3.1.2",
|
"plop": "^3.1.2",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"preconstruct": {
|
"preconstruct": {
|
||||||
"entrypoints": [
|
"entrypoints": [
|
||||||
|
|||||||
@@ -80,6 +80,33 @@ chains = chains
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort RPCs in chain
|
||||||
|
* @param {Chain} chain
|
||||||
|
*/
|
||||||
|
function sortRPCs(chain) {
|
||||||
|
const thirdwebRPCs = [];
|
||||||
|
const alchemyRPCs = [];
|
||||||
|
const infuraRPCs = [];
|
||||||
|
const otherRPCs = [];
|
||||||
|
|
||||||
|
chain.rpc.forEach((rpc) => {
|
||||||
|
if (rpc.includes("${THIRDWEB_API_KEY}")) {
|
||||||
|
thirdwebRPCs.push(rpc);
|
||||||
|
} else if (rpc.includes("${ALCHEMY_API_KEY}")) {
|
||||||
|
alchemyRPCs.push(rpc);
|
||||||
|
} else if (rpc.includes("${INFURA_API_KEY}")) {
|
||||||
|
infuraRPCs.push(rpc);
|
||||||
|
} else {
|
||||||
|
otherRPCs.push(rpc);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
chain.rpc = [...thirdwebRPCs, ...infuraRPCs, ...alchemyRPCs, ...otherRPCs];
|
||||||
|
}
|
||||||
|
|
||||||
|
chains.forEach(sortRPCs);
|
||||||
|
|
||||||
const imports = [];
|
const imports = [];
|
||||||
const exports = [];
|
const exports = [];
|
||||||
const exportNames = [];
|
const exportNames = [];
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -28,59 +28,45 @@ export function getChainRPCs(
|
|||||||
...options,
|
...options,
|
||||||
};
|
};
|
||||||
|
|
||||||
const modeChains = chain.rpc.filter((rpc) => {
|
const processedRPCs: string[] = [];
|
||||||
if (rpc.startsWith("http") && mode === "http") {
|
|
||||||
return true;
|
chain.rpc.forEach((rpc) => {
|
||||||
}
|
// exclude RPC if mode mismatch
|
||||||
if (rpc.startsWith("ws") && mode === "ws") {
|
if (mode === "http" && !rpc.startsWith("http")) {
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
if (mode === "ws" && !rpc.startsWith("ws")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace API_KEY placeholder with value
|
||||||
|
if (thirdwebApiKey && rpc.includes("${THIRDWEB_API_KEY}")) {
|
||||||
|
processedRPCs.push(rpc.replace("${THIRDWEB_API_KEY}", thirdwebApiKey));
|
||||||
|
} else if (infuraApiKey && rpc.includes("${INFURA_API_KEY}")) {
|
||||||
|
processedRPCs.push(rpc.replace("${INFURA_API_KEY}", infuraApiKey));
|
||||||
|
} else if (alchemyApiKey && rpc.includes("${ALCHEMY_API_KEY}")) {
|
||||||
|
processedRPCs.push(rpc.replace("${ALCHEMY_API_KEY}", alchemyApiKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
// exclude RPCs with unknown placeholder
|
||||||
|
else if (rpc.includes("${")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add as is
|
||||||
|
else {
|
||||||
|
processedRPCs.push(rpc);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const thirdwebRPC = modeChains
|
if (processedRPCs.length === 0) {
|
||||||
.filter((rpc) => {
|
|
||||||
return rpc.includes("${THIRDWEB_API_KEY}") && thirdwebApiKey;
|
|
||||||
})
|
|
||||||
.map((rpc) =>
|
|
||||||
thirdwebApiKey ? rpc.replace("${THIRDWEB_API_KEY}", thirdwebApiKey) : rpc,
|
|
||||||
);
|
|
||||||
|
|
||||||
const alchemyRPC = modeChains
|
|
||||||
.filter((rpc) => {
|
|
||||||
return rpc.includes("${ALCHEMY_API_KEY}") && alchemyApiKey;
|
|
||||||
})
|
|
||||||
.map((rpc) =>
|
|
||||||
alchemyApiKey ? rpc.replace("${ALCHEMY_API_KEY}", alchemyApiKey) : rpc,
|
|
||||||
);
|
|
||||||
|
|
||||||
const infuraRPC = modeChains
|
|
||||||
.filter((rpc) => {
|
|
||||||
return rpc.includes("${INFURA_API_KEY}") && infuraApiKey;
|
|
||||||
})
|
|
||||||
.map((rpc) =>
|
|
||||||
infuraApiKey ? rpc.replace("${INFURA_API_KEY}", infuraApiKey) : rpc,
|
|
||||||
);
|
|
||||||
|
|
||||||
const allOtherRpcs = modeChains.filter((rpc) => {
|
|
||||||
return !rpc.includes("${");
|
|
||||||
});
|
|
||||||
|
|
||||||
const orderedRPCs = [
|
|
||||||
...thirdwebRPC,
|
|
||||||
...infuraRPC,
|
|
||||||
...alchemyRPC,
|
|
||||||
...allOtherRpcs,
|
|
||||||
];
|
|
||||||
|
|
||||||
if (orderedRPCs.length === 0) {
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`No RPC available for chainId "${chain.chainId}" with mode ${mode}`,
|
`No RPC available for chainId "${chain.chainId}" with mode ${mode}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return orderedRPCs;
|
return processedRPCs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,37 @@
|
|||||||
# thirdweb
|
# thirdweb
|
||||||
|
|
||||||
|
## 0.10.30
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5), [`72ada475`](https://github.com/thirdweb-dev/js/commit/72ada47596d5d5c08736c33215faeec636b7156a), [`2c0bb078`](https://github.com/thirdweb-dev/js/commit/2c0bb0789955f6cd397b6fdb8e990a505251c631), [`b5c6eedb`](https://github.com/thirdweb-dev/js/commit/b5c6eedb38aa3c52eb97f3d25ad83e38c55afe61), [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.28
|
||||||
|
- @thirdweb-dev/sdk@3.10.29
|
||||||
|
- @thirdweb-dev/storage@1.1.7
|
||||||
|
|
||||||
|
## 0.10.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1280](https://github.com/thirdweb-dev/js/pull/1280) [`53626f81`](https://github.com/thirdweb-dev/js/commit/53626f8100f400c46333617b14bd9fc144a7e801) Thanks [@Marfuen](https://github.com/Marfuen)! - Don't rely on package.json to export app
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
- Updated dependencies [[`2d088d36`](https://github.com/thirdweb-dev/js/commit/2d088d367ca54233836dc69712fd411ab7924205), [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2), [`9daf0449`](https://github.com/thirdweb-dev/js/commit/9daf044926bf995ac8998929dbeca548c5eb8561), [`546353a4`](https://github.com/thirdweb-dev/js/commit/546353a479c11533818ef917c0f6b4d6f8f69872), [`a3bb17cb`](https://github.com/thirdweb-dev/js/commit/a3bb17cb33f033846fb3b4c8a0a4809ba76cab96), [`0135a779`](https://github.com/thirdweb-dev/js/commit/0135a7790cf2acde6b701cb41ea10dd311da5ec3)]:
|
||||||
|
- @thirdweb-dev/storage@1.1.6
|
||||||
|
- @thirdweb-dev/chains@0.1.27
|
||||||
|
- @thirdweb-dev/sdk@3.10.28
|
||||||
|
|
||||||
|
## 0.10.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1274](https://github.com/thirdweb-dev/js/pull/1274) [`8fc5f204`](https://github.com/thirdweb-dev/js/commit/8fc5f204b00733089c02beee92c86b0f1fcac271) Thanks [@Marfuen](https://github.com/Marfuen)! - Added all detections for deploy command and some minor bug fixes
|
||||||
|
|
||||||
|
- Updated dependencies [[`2b113539`](https://github.com/thirdweb-dev/js/commit/2b113539098384f910b3c4d54e1fde9d35a6f053), [`c9535715`](https://github.com/thirdweb-dev/js/commit/c95357158819abd42d4b0900ecc2fa40fcb957f8), [`5882091e`](https://github.com/thirdweb-dev/js/commit/5882091eab65978009a5a5305701f121851b10ad)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.27
|
||||||
|
- @thirdweb-dev/chains@0.1.26
|
||||||
|
|
||||||
## 0.10.27
|
## 0.10.27
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { CREATE_MESSAGES } from "../constants/constants";
|
|||||||
import { prepareEnvironment } from "@gmrchk/cli-testing-library";
|
import { prepareEnvironment } from "@gmrchk/cli-testing-library";
|
||||||
|
|
||||||
// this creates an app, can take some time that's fine
|
// this creates an app, can take some time that's fine
|
||||||
jest.setTimeout(120_000);
|
jest.setTimeout(240_000);
|
||||||
|
|
||||||
describe("npx thirdweb detect", () => {
|
describe("npx thirdweb detect", () => {
|
||||||
it("should detect ERC721Base extensions", async () => {
|
it("should detect ERC721Base extensions", async () => {
|
||||||
|
|||||||
+15
-15
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "thirdweb",
|
"name": "thirdweb",
|
||||||
"main": "dist/cli/index.js",
|
"main": "dist/cli/index.js",
|
||||||
"version": "0.10.27",
|
"version": "0.10.30",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -14,25 +14,25 @@
|
|||||||
"@types/async-retry": "^1.3.0",
|
"@types/async-retry": "^1.3.0",
|
||||||
"@types/cross-spawn": "^6.0.2",
|
"@types/cross-spawn": "^6.0.2",
|
||||||
"@types/inquirer": "^8.2.1",
|
"@types/inquirer": "^8.2.1",
|
||||||
"@types/jest": "^29.2.1",
|
"@types/jest": "^29.5.2",
|
||||||
"@types/js-yaml": "^4.0.5",
|
"@types/js-yaml": "^4.0.5",
|
||||||
"@types/node": "^18.0.0",
|
"@types/node": "^18.16.18",
|
||||||
"@types/prompts": "^2.0.14",
|
"@types/prompts": "^2.4.4",
|
||||||
"@types/rimraf": "^3.0.0",
|
"@types/rimraf": "^3.0.0",
|
||||||
"@types/tar": "^6.1.2",
|
"@types/tar": "^6.1.5",
|
||||||
"@types/update-notifier": "^6.0.1",
|
"@types/update-notifier": "^6.0.4",
|
||||||
"@types/validate-npm-package-name": "^4.0.0",
|
"@types/validate-npm-package-name": "^4.0.0",
|
||||||
"chalk": "^5.2.0",
|
"chalk": "^5.3.0",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"hardhat": "^2.9.3",
|
"hardhat": "^2.16.1",
|
||||||
"jest": "^29.4.3",
|
"jest": "^29.4.3",
|
||||||
"ora": "^6.1.2",
|
"ora": "^6.3.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.8",
|
||||||
"ts-jest": "^29.0.3",
|
"ts-jest": "^29.1.0",
|
||||||
"ts-node": "^10.7.0",
|
"ts-node": "^10.7.0",
|
||||||
"tsup": "^6.2.3",
|
"tsup": "^6.7.0",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
@@ -53,10 +53,10 @@
|
|||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"solc": "0.8.17",
|
"solc": "0.8.17",
|
||||||
"sync-disk-cache": "^2.1.0",
|
"sync-disk-cache": "^2.1.0",
|
||||||
"tar": "^6.1.11",
|
"tar": "^6.1.15",
|
||||||
"update-notifier": "^6.0.2",
|
"update-notifier": "^6.0.2",
|
||||||
"validate-npm-package-name": "^4.0.0",
|
"validate-npm-package-name": "^4.0.0",
|
||||||
"yaml": "^2.1.1"
|
"yaml": "^2.3.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"thirdweb": "./dist/cli/index.js"
|
"thirdweb": "./dist/cli/index.js"
|
||||||
|
|||||||
@@ -1,27 +1,28 @@
|
|||||||
|
import inquirer from "inquirer";
|
||||||
import { info } from "../helpers/logger";
|
import { info } from "../helpers/logger";
|
||||||
import { FrameworkType, PackageManagerType } from "../types/ProjectType";
|
import { FrameworkType, PackageManagerType } from "../types/ProjectType";
|
||||||
import inquirer from "inquirer";
|
|
||||||
import NextDetector from "./frameworks/next";
|
|
||||||
import CRADetector from "./frameworks/cra";
|
|
||||||
import RemixDetector from "./frameworks/remix";
|
|
||||||
import GatsbyDetector from "./frameworks/gatsby";
|
|
||||||
import VueDetector from "./frameworks/vue";
|
|
||||||
import ReactNativeCLIDetector from "./frameworks/reactNativeCli";
|
|
||||||
import DjangoDetector from "./frameworks/django";
|
|
||||||
import ExpoDetector from "./frameworks/expo";
|
|
||||||
import FoundryDetector from "./frameworks/foundry";
|
|
||||||
import HardhatDetector from "./frameworks/hardhat";
|
|
||||||
import { FrameworkDetector } from "./detector";
|
import { FrameworkDetector } from "./detector";
|
||||||
import TruffleDetector from "./frameworks/truffle";
|
|
||||||
import BrownieDetector from "./frameworks/brownie";
|
import BrownieDetector from "./frameworks/brownie";
|
||||||
import FastAPIDetector from "./frameworks/fastAPI";
|
import CRADetector from "./frameworks/cra";
|
||||||
import FlaskDetector from "./frameworks/flask";
|
import DjangoDetector from "./frameworks/django";
|
||||||
import PopulusDetector from "./frameworks/populus";
|
|
||||||
import FastifyDetector from "./frameworks/fastify";
|
|
||||||
import EchoDetector from "./frameworks/echo";
|
import EchoDetector from "./frameworks/echo";
|
||||||
|
import ExpoDetector from "./frameworks/expo";
|
||||||
|
import FastAPIDetector from "./frameworks/fastAPI";
|
||||||
|
import FastifyDetector from "./frameworks/fastify";
|
||||||
import FiberDetector from "./frameworks/fiber";
|
import FiberDetector from "./frameworks/fiber";
|
||||||
|
import FlaskDetector from "./frameworks/flask";
|
||||||
|
import FoundryDetector from "./frameworks/foundry";
|
||||||
|
import GatsbyDetector from "./frameworks/gatsby";
|
||||||
import GinDetector from "./frameworks/gin";
|
import GinDetector from "./frameworks/gin";
|
||||||
|
import HardhatDetector from "./frameworks/hardhat";
|
||||||
|
import NextDetector from "./frameworks/next";
|
||||||
|
import PopulusDetector from "./frameworks/populus";
|
||||||
|
import ReactNativeCLIDetector from "./frameworks/reactNativeCli";
|
||||||
|
import RemixDetector from "./frameworks/remix";
|
||||||
import RevelDetector from "./frameworks/revel";
|
import RevelDetector from "./frameworks/revel";
|
||||||
|
import TruffleDetector from "./frameworks/truffle";
|
||||||
|
import ViteDetector from "./frameworks/vite";
|
||||||
|
import VueDetector from "./frameworks/vue";
|
||||||
import ZenjectDetector from "./frameworks/zenject";
|
import ZenjectDetector from "./frameworks/zenject";
|
||||||
|
|
||||||
export default async function detect(
|
export default async function detect(
|
||||||
@@ -50,6 +51,7 @@ export default async function detect(
|
|||||||
new RevelDetector(),
|
new RevelDetector(),
|
||||||
new TruffleDetector(),
|
new TruffleDetector(),
|
||||||
new VueDetector(),
|
new VueDetector(),
|
||||||
|
new ViteDetector(),
|
||||||
new ZenjectDetector(),
|
new ZenjectDetector(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
|
import inquirer from "inquirer";
|
||||||
import { info } from "../helpers/logger";
|
import { info } from "../helpers/logger";
|
||||||
import { LibraryType, PackageManagerType } from "../types/ProjectType";
|
import { LibraryType, PackageManagerType } from "../types/ProjectType";
|
||||||
import { LibraryDetector } from "./detector";
|
import { LibraryDetector } from "./detector";
|
||||||
import inquirer from "inquirer";
|
|
||||||
import ReactDetector from "./libraries/react";
|
|
||||||
import ExpressDetector from "./libraries/express";
|
import ExpressDetector from "./libraries/express";
|
||||||
import ReactNativeDetector from "./libraries/reactNative";
|
|
||||||
import ViteDetector from "./libraries/vite";
|
|
||||||
import Web3PyDetector from "./libraries/web3py";
|
|
||||||
import PlayMakerDetector from "./libraries/playmaker";
|
import PlayMakerDetector from "./libraries/playmaker";
|
||||||
|
import ReactDetector from "./libraries/react";
|
||||||
|
import ReactNativeDetector from "./libraries/reactNative";
|
||||||
|
import Web3PyDetector from "./libraries/web3py";
|
||||||
|
|
||||||
export default async function detect(
|
export default async function detect(
|
||||||
path: string,
|
path: string,
|
||||||
@@ -19,7 +18,6 @@ export default async function detect(
|
|||||||
new ExpressDetector(),
|
new ExpressDetector(),
|
||||||
new ReactDetector(),
|
new ReactDetector(),
|
||||||
new ReactNativeDetector(),
|
new ReactNativeDetector(),
|
||||||
new ViteDetector(),
|
|
||||||
new Web3PyDetector(),
|
new Web3PyDetector(),
|
||||||
new PlayMakerDetector(),
|
new PlayMakerDetector(),
|
||||||
];
|
];
|
||||||
|
|||||||
+5
-5
@@ -1,10 +1,10 @@
|
|||||||
import { LibraryDetector } from "../detector";
|
|
||||||
import { existsSync, readFileSync } from "fs";
|
import { existsSync, readFileSync } from "fs";
|
||||||
import { LibraryType } from "../../types/ProjectType";
|
|
||||||
import { parsePackageJson } from "../../../lib/utils";
|
import { parsePackageJson } from "../../../lib/utils";
|
||||||
|
import { FrameworkType } from "../../types/ProjectType";
|
||||||
|
import { FrameworkDetector } from "../detector";
|
||||||
|
|
||||||
export default class ViteDetector implements LibraryDetector {
|
export default class ViteDetector implements FrameworkDetector {
|
||||||
public libraryType: LibraryType = "vite";
|
public frameworkType: FrameworkType = "vite";
|
||||||
|
|
||||||
public matches(path: string): boolean {
|
public matches(path: string): boolean {
|
||||||
const packageJsonPath = path + "/package.json";
|
const packageJsonPath = path + "/package.json";
|
||||||
@@ -16,7 +16,7 @@ export default class ViteDetector implements LibraryDetector {
|
|||||||
const packageJson = readFileSync(packageJsonPath);
|
const packageJson = readFileSync(packageJsonPath);
|
||||||
const { dependencies, devDependencies } = parsePackageJson(packageJson);
|
const { dependencies, devDependencies } = parsePackageJson(packageJson);
|
||||||
const viteDependencyExists =
|
const viteDependencyExists =
|
||||||
dependencies["vite"] || devDependencies["vite"] || false;
|
!!dependencies["vite"] || !!devDependencies["vite"] || false;
|
||||||
|
|
||||||
return viteDependencyExists;
|
return viteDependencyExists;
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,7 @@ export type FrameworkType =
|
|||||||
| "revel"
|
| "revel"
|
||||||
| "fiber"
|
| "fiber"
|
||||||
| "zenject"
|
| "zenject"
|
||||||
|
| "vite"
|
||||||
| "none";
|
| "none";
|
||||||
export type LibraryType =
|
export type LibraryType =
|
||||||
| "react"
|
| "react"
|
||||||
|
|||||||
@@ -1,30 +1,57 @@
|
|||||||
import NPMDetector from "../core/detection/npm";
|
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||||
import ViteDetector from "../core/detection/vite";
|
import detectFramework from "../core/detection/detectFramework";
|
||||||
import YarnDetector from "../core/detection/yarn";
|
import detectPackageManager from "../core/detection/detectPackageManager";
|
||||||
|
import { logger } from "../core/helpers/logger";
|
||||||
import { runCommand } from "../create/helpers/run-command";
|
import { runCommand } from "../create/helpers/run-command";
|
||||||
import { upload } from "../storage/command";
|
import { upload } from "../storage/command";
|
||||||
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
|
||||||
|
|
||||||
export async function deployApp(distPath = "dist", projectPath = ".") {
|
export async function deployApp(distPath = "dist", projectPath = ".") {
|
||||||
const storage = new ThirdwebStorage();
|
const storage = new ThirdwebStorage();
|
||||||
const supportedFrameworks = [new ViteDetector()];
|
const detectedPackageManager = await detectPackageManager(projectPath, {});
|
||||||
|
const detectedFramework = await detectFramework(projectPath, {}, detectedPackageManager);
|
||||||
|
|
||||||
const possibleProjects = supportedFrameworks
|
if (detectedFramework === "none") {
|
||||||
.filter((detector) => detector.matches(projectPath))
|
|
||||||
.map((detector) => detector.projectType);
|
|
||||||
|
|
||||||
const hasYarn = new YarnDetector().matches(".");
|
|
||||||
const hasNPM = new NPMDetector().matches(".");
|
|
||||||
|
|
||||||
if (possibleProjects.length === 0) {
|
|
||||||
throw new Error("No supported project detected");
|
throw new Error("No supported project detected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (detectedFramework) {
|
||||||
|
case "next":
|
||||||
|
distPath = "out";
|
||||||
|
break;
|
||||||
|
case "cra":
|
||||||
|
distPath = "build";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info(`Detected project type: ${detectedFramework}`);
|
||||||
|
logger.info(`Detected package manager: ${detectedPackageManager}`);
|
||||||
|
logger.info(`distPath: ${distPath}`);
|
||||||
|
logger.info(`projectPath: ${projectPath}`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (hasYarn) {
|
switch (detectedPackageManager) {
|
||||||
await runCommand("yarn", ["build"]);
|
case "yarn":
|
||||||
} else if (hasNPM) {
|
await runCommand("yarn", ["build"], true);
|
||||||
await runCommand("npm", ["build"]);
|
if (detectedFramework === "next") {
|
||||||
|
await runCommand("yarn", ["next", "export"], true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "npm":
|
||||||
|
await runCommand("npm", ["run", "build"], true);
|
||||||
|
if (detectedFramework === "next") {
|
||||||
|
await runCommand("npx", ["next", "export"], true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "pnpm":
|
||||||
|
await runCommand("pnpm", ["build"], true);
|
||||||
|
if (detectedFramework === "next") {
|
||||||
|
await runCommand("pnpm", ["next", "export"], true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error("No supported package manager detected");
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Can't build project");
|
console.error("Can't build project");
|
||||||
@@ -33,9 +60,9 @@ export async function deployApp(distPath = "dist", projectPath = ".") {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const uri = await upload(storage, distPath);
|
const uri = await upload(storage, distPath);
|
||||||
return `https://thirdweb.com/app/deploy/${uri.replace("ipfs://", "")}`;
|
return `${uri.replace("ipfs://", "https://ipfs-public.thirdwebcdn.com/ipfs/")}`;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Can't upload project");
|
console.error("Can't upload project", err);
|
||||||
return Promise.reject("Can't upload project");
|
return Promise.reject("Can't upload project");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { spinner } from "../core/helpers/logger";
|
|
||||||
import { BufferOrStringWithName, ThirdwebStorage } from "@thirdweb-dev/storage";
|
import { BufferOrStringWithName, ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import { spinner } from "../core/helpers/logger";
|
||||||
|
|
||||||
function recurseFiles(
|
function recurseFiles(
|
||||||
uploadPath: string,
|
uploadPath: string,
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @thirdweb-dev/contracts-js
|
# @thirdweb-dev/contracts-js
|
||||||
|
|
||||||
|
## 1.3.9
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1299](https://github.com/thirdweb-dev/js/pull/1299) [`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5) Thanks [@nkrishang](https://github.com/nkrishang)! - Add ERC721LoyaltyCard and ERC721UpdatableMetadata
|
||||||
|
|
||||||
|
## 1.3.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
## 1.3.7
|
## 1.3.7
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/contracts-js",
|
"name": "@thirdweb-dev/contracts-js",
|
||||||
"version": "1.3.7",
|
"version": "1.3.9",
|
||||||
"main": "dist/thirdweb-dev-contracts-js.cjs.js",
|
"main": "dist/thirdweb-dev-contracts-js.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-contracts-js.esm.js",
|
"module": "dist/thirdweb-dev-contracts-js.esm.js",
|
||||||
"browser": {
|
"browser": {
|
||||||
@@ -10,20 +10,20 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/contracts-js",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/contracts-js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@thirdweb-dev/contracts": "3.5.9"
|
"@thirdweb-dev/contracts": "3.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.10",
|
"@babel/preset-env": "^7.22.5",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.22.5",
|
||||||
"@ethersproject/abi": "^5.7.0",
|
"@ethersproject/abi": "^5.7.0",
|
||||||
"@ethersproject/providers": "^5.7.2",
|
"@ethersproject/providers": "^5.7.2",
|
||||||
"@preconstruct/cli": "^2.2.1",
|
"@preconstruct/cli": "^2.7.0",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"@typechain/ethers-v5": "10.0.0",
|
"@typechain/ethers-v5": "10.0.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"ethers": "^5.7.2",
|
"ethers": "^5.7.2",
|
||||||
"typechain": "^8.1.0",
|
"typechain": "^8.2.0",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"ethers": "^5"
|
"ethers": "^5"
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# eslint-config-thirdweb
|
# eslint-config-thirdweb
|
||||||
|
|
||||||
|
## 0.1.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
## 0.1.4
|
## 0.1.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "eslint-config-thirdweb",
|
"name": "eslint-config-thirdweb",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||||
"@typescript-eslint/parser": "^5.33.0",
|
"@typescript-eslint/parser": "^5.60.1",
|
||||||
"eslint-config-next": "13.2.4",
|
"eslint-config-next": "13.2.4",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-config-turbo": "^0.0.8",
|
"eslint-config-turbo": "^0.0.8",
|
||||||
"eslint-plugin-react": "^7.28.0"
|
"eslint-plugin-react": "^7.28.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @thirdweb-dev/pay
|
# @thirdweb-dev/pay
|
||||||
|
|
||||||
|
## 0.1.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
## 0.1.1
|
## 0.1.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/pay",
|
"name": "@thirdweb-dev/pay",
|
||||||
"version": "0.1.1",
|
"version": "0.1.2",
|
||||||
"main": "dist/thirdweb-dev-pay.cjs.js",
|
"main": "dist/thirdweb-dev-pay.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-pay.esm.js",
|
"module": "dist/thirdweb-dev-pay.esm.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -33,13 +33,13 @@
|
|||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coinbase/cbpay-js": "^1.6.0"
|
"@coinbase/cbpay-js": "^1.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@preconstruct/cli": "^2.2.1",
|
"@preconstruct/cli": "^2.7.0",
|
||||||
"typescript": "^4.7.4",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "prettier --write 'src/**/*'",
|
"format": "prettier --write 'src/**/*'",
|
||||||
|
|||||||
@@ -1,5 +1,56 @@
|
|||||||
# @thirdweb-dev/react-core
|
# @thirdweb-dev/react-core
|
||||||
|
|
||||||
|
## 3.14.9
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1309](https://github.com/thirdweb-dev/js/pull/1309) [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352) Thanks [@jnsdls](https://github.com/jnsdls)! - unblock storage domains
|
||||||
|
|
||||||
|
- Updated dependencies [[`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5), [`72ada475`](https://github.com/thirdweb-dev/js/commit/72ada47596d5d5c08736c33215faeec636b7156a), [`2c0bb078`](https://github.com/thirdweb-dev/js/commit/2c0bb0789955f6cd397b6fdb8e990a505251c631), [`b5c6eedb`](https://github.com/thirdweb-dev/js/commit/b5c6eedb38aa3c52eb97f3d25ad83e38c55afe61), [`10b3a717`](https://github.com/thirdweb-dev/js/commit/10b3a717da606632a05769ac821bdd21d6b63a03), [`b4aee9b5`](https://github.com/thirdweb-dev/js/commit/b4aee9b59121bab5f9b3d9b7ecdc4bcb4cd66f58), [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.28
|
||||||
|
- @thirdweb-dev/sdk@3.10.29
|
||||||
|
- @thirdweb-dev/wallets@1.0.5
|
||||||
|
- @thirdweb-dev/storage@1.1.7
|
||||||
|
|
||||||
|
## 3.14.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
- Updated dependencies [[`2d088d36`](https://github.com/thirdweb-dev/js/commit/2d088d367ca54233836dc69712fd411ab7924205), [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2), [`9daf0449`](https://github.com/thirdweb-dev/js/commit/9daf044926bf995ac8998929dbeca548c5eb8561), [`546353a4`](https://github.com/thirdweb-dev/js/commit/546353a479c11533818ef917c0f6b4d6f8f69872), [`a3bb17cb`](https://github.com/thirdweb-dev/js/commit/a3bb17cb33f033846fb3b4c8a0a4809ba76cab96), [`0135a779`](https://github.com/thirdweb-dev/js/commit/0135a7790cf2acde6b701cb41ea10dd311da5ec3)]:
|
||||||
|
- @thirdweb-dev/storage@1.1.6
|
||||||
|
- @thirdweb-dev/wallets@1.0.4
|
||||||
|
- @thirdweb-dev/chains@0.1.27
|
||||||
|
- @thirdweb-dev/sdk@3.10.28
|
||||||
|
|
||||||
|
## 3.14.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1271](https://github.com/thirdweb-dev/js/pull/1271) [`c9535715`](https://github.com/thirdweb-dev/js/commit/c95357158819abd42d4b0900ecc2fa40fcb957f8) Thanks [@nkrishang](https://github.com/nkrishang)! - Rename smart wallets to account
|
||||||
|
|
||||||
|
- [#1273](https://github.com/thirdweb-dev/js/pull/1273) [`edcd22d6`](https://github.com/thirdweb-dev/js/commit/edcd22d61236edb2832f9b2f9796e891d58cb145) Thanks [@MananTank](https://github.com/MananTank)! - Add `autoConnectTimeout` to `ThirdwebProvider` to timeout wallet autoconnect
|
||||||
|
|
||||||
|
- Updated dependencies [[`2b113539`](https://github.com/thirdweb-dev/js/commit/2b113539098384f910b3c4d54e1fde9d35a6f053), [`c9535715`](https://github.com/thirdweb-dev/js/commit/c95357158819abd42d4b0900ecc2fa40fcb957f8), [`be606dd3`](https://github.com/thirdweb-dev/js/commit/be606dd3c93c1514834c1d970e864d7f949a07ab), [`5882091e`](https://github.com/thirdweb-dev/js/commit/5882091eab65978009a5a5305701f121851b10ad), [`998e5217`](https://github.com/thirdweb-dev/js/commit/998e521733efd6a67e42f9bf0beab5fbdccf08ae)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.3
|
||||||
|
- @thirdweb-dev/sdk@3.10.27
|
||||||
|
- @thirdweb-dev/chains@0.1.26
|
||||||
|
|
||||||
|
## 3.14.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`ed711c8c`](https://github.com/thirdweb-dev/js/commit/ed711c8cb2ed6a0deb1b2a5eeec06df1d4edc5e8), [`05a7495a`](https://github.com/thirdweb-dev/js/commit/05a7495a132aabab5f48abbdb80a468ff6f65df8), [`e78da6b3`](https://github.com/thirdweb-dev/js/commit/e78da6b36cfa6d954234820563201bf760186ed1)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.2
|
||||||
|
|
||||||
|
## 3.14.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`efb3546e`](https://github.com/thirdweb-dev/js/commit/efb3546ec8268156be00301af28b9d83ecd5ab08)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.1
|
||||||
|
|
||||||
## 3.14.4
|
## 3.14.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-core",
|
"name": "@thirdweb-dev/react-core",
|
||||||
"version": "3.14.4",
|
"version": "3.14.9",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -66,26 +66,26 @@
|
|||||||
},
|
},
|
||||||
"sideEffects:": false,
|
"sideEffects:": false,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.19.3",
|
"@babel/core": "^7.22.5",
|
||||||
"@babel/preset-env": "^7.18.10",
|
"@babel/preset-env": "^7.22.5",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.22.5",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.22.5",
|
||||||
"@babel/runtime": "^7.19.0",
|
"@babel/runtime": "^7.22.5",
|
||||||
"@microsoft/api-documenter": "^7.19.4",
|
"@microsoft/api-documenter": "^7.22.21",
|
||||||
"@microsoft/api-extractor": "^7.29.2",
|
"@microsoft/api-extractor": "^7.36.0",
|
||||||
"@microsoft/tsdoc": "^0.14.1",
|
"@microsoft/tsdoc": "^0.14.1",
|
||||||
"@preconstruct/cli": "^2.2.1",
|
"@preconstruct/cli": "^2.7.0",
|
||||||
"@solana/wallet-adapter-react": "^0.15.19",
|
"@solana/wallet-adapter-react": "^0.15.19",
|
||||||
"@solana/web3.js": "^1.62.0",
|
"@solana/web3.js": "^1.62.0",
|
||||||
"@thirdweb-dev/auth": "workspace:*",
|
"@thirdweb-dev/auth": "workspace:*",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"@types/js-cookie": "^3.0.3",
|
"@types/js-cookie": "^3.0.3",
|
||||||
"@types/mime": "3.0.0",
|
"@types/mime": "3.0.0",
|
||||||
"@types/react": "^18.0.5",
|
"@types/react": "^18.2.14",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||||
"@typescript-eslint/parser": "^5.33.0",
|
"@typescript-eslint/parser": "^5.60.1",
|
||||||
"eslint": "^8.42.0",
|
"eslint": "^8.43.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"eslint-plugin-better-tree-shaking": "0.0.3",
|
"eslint-plugin-better-tree-shaking": "0.0.3",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
@@ -93,12 +93,12 @@
|
|||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"eslint-plugin-tsdoc": "^0.2.16",
|
"eslint-plugin-tsdoc": "^0.2.16",
|
||||||
"ethers": "^5.7.2",
|
"ethers": "^5.7.2",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.8",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tanstack/react-query": "^4.0.10",
|
"@tanstack/react-query": "^4.29.19",
|
||||||
"@thirdweb-dev/chains": "workspace:*",
|
"@thirdweb-dev/chains": "workspace:*",
|
||||||
"@thirdweb-dev/generated-abis": "workspace:^",
|
"@thirdweb-dev/generated-abis": "workspace:^",
|
||||||
"@thirdweb-dev/sdk": "workspace:*",
|
"@thirdweb-dev/sdk": "workspace:*",
|
||||||
|
|||||||
@@ -61,6 +61,15 @@ export interface ThirdwebProviderCoreProps<TChains extends Chain[]>
|
|||||||
* Whether or not to automatically switch to wallet's network to active chain
|
* Whether or not to automatically switch to wallet's network to active chain
|
||||||
*/
|
*/
|
||||||
autoSwitch?: boolean;
|
autoSwitch?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Timeout for auto-connecting wallet in milliseconds
|
||||||
|
*
|
||||||
|
* If wallet fails to connect in this time, it will stop trying to connect and user will have to manually connect
|
||||||
|
*
|
||||||
|
* @defaultValue 15000
|
||||||
|
*/
|
||||||
|
autoConnectTimeout?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ThirdwebProviderCore = <TChains extends Chain[]>({
|
export const ThirdwebProviderCore = <TChains extends Chain[]>({
|
||||||
@@ -145,6 +154,7 @@ export const ThirdwebProviderCore = <TChains extends Chain[]>({
|
|||||||
dAppMeta={dAppMeta}
|
dAppMeta={dAppMeta}
|
||||||
activeChain={activeChainWithKey}
|
activeChain={activeChainWithKey}
|
||||||
autoSwitch={props.autoSwitch}
|
autoSwitch={props.autoSwitch}
|
||||||
|
autoConnectTimeout={props.autoConnectTimeout}
|
||||||
>
|
>
|
||||||
<ThirdwebSDKProviderWrapper
|
<ThirdwebSDKProviderWrapper
|
||||||
queryClient={props.queryClient}
|
queryClient={props.queryClient}
|
||||||
|
|||||||
@@ -101,12 +101,15 @@ export function ThirdwebWalletProvider(
|
|||||||
dAppMeta?: DAppMetaData;
|
dAppMeta?: DAppMetaData;
|
||||||
chains: Chain[];
|
chains: Chain[];
|
||||||
autoSwitch?: boolean;
|
autoSwitch?: boolean;
|
||||||
|
autoConnectTimeout?: number;
|
||||||
}>,
|
}>,
|
||||||
) {
|
) {
|
||||||
const [signer, setSigner] = useState<Signer | undefined>(undefined);
|
const [signer, setSigner] = useState<Signer | undefined>(undefined);
|
||||||
const [connectionStatus, setConnectionStatus] =
|
const [connectionStatus, setConnectionStatus] =
|
||||||
useState<ConnectionStatus>("unknown");
|
useState<ConnectionStatus>("unknown");
|
||||||
|
|
||||||
|
const autoConnectTimeout = props.autoConnectTimeout || 15000;
|
||||||
|
|
||||||
const [activeWallet, setActiveWallet] = useState<
|
const [activeWallet, setActiveWallet] = useState<
|
||||||
WalletInstance | undefined
|
WalletInstance | undefined
|
||||||
>();
|
>();
|
||||||
@@ -311,8 +314,14 @@ export function ThirdwebWalletProvider(
|
|||||||
const personalWalletInstance = createWalletInstance(personalWalleObj);
|
const personalWalletInstance = createWalletInstance(personalWalleObj);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await personalWalletInstance.autoConnect(
|
await timeoutPromise(
|
||||||
personalWalletInfo.connectParams,
|
personalWalletInstance.autoConnect(
|
||||||
|
personalWalletInfo.connectParams,
|
||||||
|
),
|
||||||
|
{
|
||||||
|
ms: autoConnectTimeout,
|
||||||
|
message: "Failed to Auto connect. Auto connect timed out.",
|
||||||
|
},
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
@@ -337,7 +346,10 @@ export function ThirdwebWalletProvider(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
setConnectionStatus("connecting");
|
setConnectionStatus("connecting");
|
||||||
await wallet.autoConnect(walletInfo.connectParams);
|
await timeoutPromise(wallet.autoConnect(walletInfo.connectParams), {
|
||||||
|
ms: autoConnectTimeout,
|
||||||
|
message: "Failed to Auto connect. Auto connect timed out.",
|
||||||
|
});
|
||||||
setConnectedWallet(wallet, walletInfo.connectParams, true);
|
setConnectedWallet(wallet, walletInfo.connectParams, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
@@ -356,6 +368,7 @@ export function ThirdwebWalletProvider(
|
|||||||
props.shouldAutoConnect,
|
props.shouldAutoConnect,
|
||||||
activeWallet,
|
activeWallet,
|
||||||
connectionStatus,
|
connectionStatus,
|
||||||
|
autoConnectTimeout,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const connectWallet = useCallback(
|
const connectWallet = useCallback(
|
||||||
@@ -496,3 +509,32 @@ async function saveLastConnectedWalletInfo(
|
|||||||
console.error("Error saving the last connected wallet info", e);
|
console.error("Error saving the last connected wallet info", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Timeout a promise with a given Error message if the promise does not resolve in given time
|
||||||
|
*
|
||||||
|
* @param promise - Promise to track for timeout
|
||||||
|
* @param option - timeout options
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function timeoutPromise<T>(
|
||||||
|
promise: Promise<T>,
|
||||||
|
option: { ms: number; message: string },
|
||||||
|
) {
|
||||||
|
return new Promise<T>((resolve, reject) => {
|
||||||
|
const timeoutId = setTimeout(() => {
|
||||||
|
reject(new Error(option.message));
|
||||||
|
}, option.ms);
|
||||||
|
|
||||||
|
promise.then(
|
||||||
|
(res) => {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
resolve(res);
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
reject(err);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,25 +1,10 @@
|
|||||||
import mime from "mime/lite.js";
|
import mime from "mime/lite.js";
|
||||||
import {
|
|
||||||
parseGatewayUrls,
|
|
||||||
prepareGatewayUrls,
|
|
||||||
replaceSchemeWithGatewayUrl,
|
|
||||||
} from "@thirdweb-dev/storage";
|
|
||||||
|
|
||||||
// TODO legacy remove this when possible
|
// TODO legacy remove this when possible
|
||||||
export interface IPFSResolverOptions {
|
export interface IPFSResolverOptions {
|
||||||
gatewayUrl: string;
|
gatewayUrl: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resolveIpfsUri(uri?: string, options?: IPFSResolverOptions) {
|
|
||||||
if (!uri) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
const gatewayUrls = prepareGatewayUrls(
|
|
||||||
parseGatewayUrls(options?.gatewayUrl ? [options?.gatewayUrl] : undefined),
|
|
||||||
);
|
|
||||||
return replaceSchemeWithGatewayUrl(uri, gatewayUrls);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function resolveMimeType(url?: string) {
|
export async function resolveMimeType(url?: string) {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
@@ -0,0 +1,185 @@
|
|||||||
|
import {
|
||||||
|
RequiredParam,
|
||||||
|
requiredParamInvariant,
|
||||||
|
} from "../../../core/query-utils/required-param";
|
||||||
|
import { useSDKChainId } from "../../providers/thirdweb-sdk-provider";
|
||||||
|
import { WalletAddress } from "../../types";
|
||||||
|
import {
|
||||||
|
cacheKeys,
|
||||||
|
invalidateContractAndBalances,
|
||||||
|
} from "../../utils/cache-keys";
|
||||||
|
import { useQueryWithNetwork } from "../query-utils/useQueryWithNetwork";
|
||||||
|
import {
|
||||||
|
useMutation,
|
||||||
|
useQueryClient,
|
||||||
|
UseQueryResult,
|
||||||
|
} from "@tanstack/react-query";
|
||||||
|
import type { AccountEvent, SmartContract } from "@thirdweb-dev/sdk";
|
||||||
|
import type { BytesLike } from "ethers";
|
||||||
|
import invariant from "tiny-invariant";
|
||||||
|
|
||||||
|
/** **********************/
|
||||||
|
/** READ HOOKS **/
|
||||||
|
/** **********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all accounts
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```javascript
|
||||||
|
* const { data: accounts, isLoading, error } = useAccounts(contract);
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @param contract - an instance of a account factory contract
|
||||||
|
* @returns a response object that includes an array of all accounts with their associated admin
|
||||||
|
* @twfeature AccountFactory
|
||||||
|
* @see {@link https://portal.thirdweb.com/react/react.useaccounts?utm_source=sdk | Documentation}
|
||||||
|
* @beta
|
||||||
|
*/
|
||||||
|
export function useAccounts(
|
||||||
|
contract: RequiredParam<SmartContract>,
|
||||||
|
): UseQueryResult<AccountEvent[]> {
|
||||||
|
const contractAddress = contract?.getAddress();
|
||||||
|
return useQueryWithNetwork(
|
||||||
|
cacheKeys.contract.accountFactory.getAll(contractAddress),
|
||||||
|
() => {
|
||||||
|
requiredParamInvariant(contract, "No Contract instance provided");
|
||||||
|
invariant(
|
||||||
|
contract.accountFactory.getAllAccounts,
|
||||||
|
"Contract instance does not support contract.accountFactory.getAllAccounts",
|
||||||
|
);
|
||||||
|
return contract.accountFactory.getAllAccounts();
|
||||||
|
},
|
||||||
|
{ enabled: !!contract },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all accounts associated with the provided address
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```javascript
|
||||||
|
* const { data: accountsForAddress, isLoading, error } = useAccountsForAddress(contract, "{{account_address}}");
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @param contract - an instance of a account factory contract
|
||||||
|
* @returns a response object that includes an array of all accounts associated with the adress
|
||||||
|
* @twfeature AccountFactory
|
||||||
|
* @see {@link https://portal.thirdweb.com/react/react.useaccountsforaddress?utm_source=sdk | Documentation}
|
||||||
|
* @beta
|
||||||
|
*/
|
||||||
|
export function useAccountsForAddress(
|
||||||
|
contract: RequiredParam<SmartContract>,
|
||||||
|
address: RequiredParam<WalletAddress>,
|
||||||
|
): UseQueryResult<string[]> {
|
||||||
|
const contractAddress = contract?.getAddress();
|
||||||
|
return useQueryWithNetwork(
|
||||||
|
cacheKeys.contract.accountFactory.getAllForAddress(
|
||||||
|
contractAddress,
|
||||||
|
address,
|
||||||
|
),
|
||||||
|
() => {
|
||||||
|
requiredParamInvariant(contract, "No Contract instance provided");
|
||||||
|
invariant(
|
||||||
|
contract.accountFactory.getAssociatedAccounts,
|
||||||
|
"Contract instance does not support contract.accountFactory.getAssociatedAccounts",
|
||||||
|
);
|
||||||
|
return contract.accountFactory.getAssociatedAccounts(address || "");
|
||||||
|
},
|
||||||
|
{ enabled: !!contract },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a account has been deployed for the given admin
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```javascript
|
||||||
|
* const { data: isAccountDeployed, isLoading, error } = useIsAccountDeployed(contract);
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @param contract - an instance of a account factory contract
|
||||||
|
* @returns a boolean indicating if a account has been deployed for the given admin
|
||||||
|
* @twfeature AccountFactory
|
||||||
|
* @see {@link https://portal.thirdweb.com/react/react.useisaccountdeployed?utm_source=sdk | Documentation}
|
||||||
|
* @beta
|
||||||
|
*/
|
||||||
|
export function useIsAccountDeployed(
|
||||||
|
contract: RequiredParam<SmartContract>,
|
||||||
|
admin: RequiredParam<WalletAddress>,
|
||||||
|
extraData?: BytesLike,
|
||||||
|
): UseQueryResult<boolean> {
|
||||||
|
const contractAddress = contract?.getAddress();
|
||||||
|
return useQueryWithNetwork(
|
||||||
|
cacheKeys.contract.accountFactory.isAccountDeployed(contractAddress, admin),
|
||||||
|
() => {
|
||||||
|
requiredParamInvariant(contract, "No Contract instance provided");
|
||||||
|
invariant(
|
||||||
|
contract.accountFactory.isAccountDeployed,
|
||||||
|
"Contract instance does not support contract.accountFactory.getAllAccounts",
|
||||||
|
);
|
||||||
|
invariant(admin, "No account address provided");
|
||||||
|
return contract.accountFactory.isAccountDeployed(admin, extraData);
|
||||||
|
},
|
||||||
|
{ enabled: !!contract },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** **********************/
|
||||||
|
/** WRITE HOOKS **/
|
||||||
|
/** **********************/
|
||||||
|
/**
|
||||||
|
* Create a account
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```jsx
|
||||||
|
* const Component = () => {
|
||||||
|
* const { contract } = useContract("{{contract_address}}");
|
||||||
|
* const {
|
||||||
|
* mutate: createAccount,
|
||||||
|
* isLoading,
|
||||||
|
* error,
|
||||||
|
* } = useCreateAccount(contract);
|
||||||
|
*
|
||||||
|
* if (error) {
|
||||||
|
* console.error("failed to create account", error);
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* return (
|
||||||
|
* <button
|
||||||
|
* disabled={isLoading}
|
||||||
|
* onClick={() => createAccount("0x...")}
|
||||||
|
* >
|
||||||
|
* Create Account
|
||||||
|
* </button>
|
||||||
|
* );
|
||||||
|
* };
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @param contract - an instance of a account factory contract
|
||||||
|
* @returns a mutation object that can be used to create a account
|
||||||
|
* @twfeature AccountFactory
|
||||||
|
* @see {@link https://portal.thirdweb.com/react/react.usecreateaccount?utm_source=sdk | Documentation}
|
||||||
|
* @beta
|
||||||
|
*/
|
||||||
|
export function useCreateAccount(contract: RequiredParam<SmartContract>) {
|
||||||
|
const activeChainId = useSDKChainId();
|
||||||
|
const contractAddress = contract?.getAddress();
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
|
return useMutation(
|
||||||
|
async (admin: string, extraData?: BytesLike) => {
|
||||||
|
requiredParamInvariant(contract, "contract is undefined");
|
||||||
|
|
||||||
|
return contract.accountFactory.createAccount(admin, extraData);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
onSettled: () =>
|
||||||
|
invalidateContractAndBalances(
|
||||||
|
queryClient,
|
||||||
|
contractAddress,
|
||||||
|
activeChainId,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
+23
-23
@@ -27,32 +27,32 @@ import invariant from "tiny-invariant";
|
|||||||
/** **********************/
|
/** **********************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all wallets
|
* Get all accounts
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```javascript
|
* ```javascript
|
||||||
* const { data: smartWallets, isLoading, error } = useSmartWalletSigners(contract);
|
* const { data: accounts, isLoading, error } = useAccountSigners(contract);
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param contract - an instance of a smart wallet
|
* @param contract - an instance of a account
|
||||||
* @returns a response object that includes an array of all signers of the provided smart wallet
|
* @returns a response object that includes an array of all signers of the provided account
|
||||||
* @twfeature SmartWallet
|
* @twfeature Account
|
||||||
* @see {@link https://portal.thirdweb.com/react/react.usesmartwalletsigners?utm_source=sdk | Documentation}
|
* @see {@link https://portal.thirdweb.com/react/react.useaccountsigners?utm_source=sdk | Documentation}
|
||||||
* @beta
|
* @beta
|
||||||
*/
|
*/
|
||||||
export function useSmartWalletSigners(
|
export function useAccountSigners(
|
||||||
contract: RequiredParam<SmartContract>,
|
contract: RequiredParam<SmartContract>,
|
||||||
): UseQueryResult<SignerWithRestrictions[]> {
|
): UseQueryResult<SignerWithRestrictions[]> {
|
||||||
const contractAddress = contract?.getAddress();
|
const contractAddress = contract?.getAddress();
|
||||||
return useQueryWithNetwork(
|
return useQueryWithNetwork(
|
||||||
cacheKeys.contract.smartWallet.signers(contractAddress),
|
cacheKeys.contract.account.signers(contractAddress),
|
||||||
() => {
|
() => {
|
||||||
requiredParamInvariant(contract, "No Contract instance provided");
|
requiredParamInvariant(contract, "No Contract instance provided");
|
||||||
invariant(
|
invariant(
|
||||||
contract.smartWallet.getSignersWithRestrictions,
|
contract.account.getSignersWithRestrictions,
|
||||||
"Contract instance does not support contract.smartWallet.getSignersWithRestrictions",
|
"Contract instance does not support contract.account.getSignersWithRestrictions",
|
||||||
);
|
);
|
||||||
return contract.smartWallet.getSignersWithRestrictions();
|
return contract.account.getSignersWithRestrictions();
|
||||||
},
|
},
|
||||||
{ enabled: !!contract },
|
{ enabled: !!contract },
|
||||||
);
|
);
|
||||||
@@ -62,40 +62,40 @@ export function useSmartWalletSigners(
|
|||||||
/** WRITE HOOKS **/
|
/** WRITE HOOKS **/
|
||||||
/** **********************/
|
/** **********************/
|
||||||
/**
|
/**
|
||||||
* Set the wallet's entire snapshot of permissions
|
* Set the account's entire snapshot of permissions
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```jsx
|
* ```jsx
|
||||||
* const Component = () => {
|
* const Component = () => {
|
||||||
* const { contract } = useContract("{{contract_address}}");
|
* const { contract } = useContract("{{contract_address}}");
|
||||||
* const {
|
* const {
|
||||||
* mutate: setSmartWalletSigners,
|
* mutate: setAccountSigners,
|
||||||
* isLoading,
|
* isLoading,
|
||||||
* error,
|
* error,
|
||||||
* } = useSetSmartWalletSigners(contract);
|
* } = useSetAccountSigners(contract);
|
||||||
*
|
*
|
||||||
* if (error) {
|
* if (error) {
|
||||||
* console.error("failed to set smart wallet signers", error);
|
* console.error("failed to set account signers", error);
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* return (
|
* return (
|
||||||
* <button
|
* <button
|
||||||
* disabled={isLoading}
|
* disabled={isLoading}
|
||||||
* onClick={() => setSmartWalletSigners("0x...")}
|
* onClick={() => setAccountSigners("0x...")}
|
||||||
* >
|
* >
|
||||||
* Set Smart Wallet Signers
|
* Set Account Signers
|
||||||
* </button>
|
* </button>
|
||||||
* );
|
* );
|
||||||
* };
|
* };
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param contract - an instance of a smart wallet contract
|
* @param contract - an instance of a account contract
|
||||||
* @returns a mutation object that can be used to set the smart wallet signers
|
* @returns a mutation object that can be used to set the account signers
|
||||||
* @twfeature SmartWallet
|
* @twfeature Account
|
||||||
* @see {@link https://portal.thirdweb.com/react/react.usesetsmartwalletsigners?utm_source=sdk | Documentation}
|
* @see {@link https://portal.thirdweb.com/react/react.usesetaccountsigners?utm_source=sdk | Documentation}
|
||||||
* @beta
|
* @beta
|
||||||
*/
|
*/
|
||||||
export function useSetSmartWalletSigners(
|
export function useSetAccountSigners(
|
||||||
contract: RequiredParam<SmartContract>,
|
contract: RequiredParam<SmartContract>,
|
||||||
): UseMutationResult<
|
): UseMutationResult<
|
||||||
{ receipt: providers.TransactionReceipt },
|
{ receipt: providers.TransactionReceipt },
|
||||||
@@ -111,7 +111,7 @@ export function useSetSmartWalletSigners(
|
|||||||
async (permissionsSnapshot: SignerWithRestrictionsBatchInput) => {
|
async (permissionsSnapshot: SignerWithRestrictionsBatchInput) => {
|
||||||
requiredParamInvariant(contract, "contract is undefined");
|
requiredParamInvariant(contract, "contract is undefined");
|
||||||
|
|
||||||
return contract.smartWallet.setAccess(permissionsSnapshot);
|
return contract.account.setAccess(permissionsSnapshot);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onSettled: () =>
|
onSettled: () =>
|
||||||
@@ -328,7 +328,7 @@ export function useContractMetadata<TContract extends ValidContractInstance>(
|
|||||||
cacheKeys.contract.metadata(contract?.getAddress()),
|
cacheKeys.contract.metadata(contract?.getAddress()),
|
||||||
async () => {
|
async () => {
|
||||||
requiredParamInvariant(contract, "contract is required");
|
requiredParamInvariant(contract, "contract is required");
|
||||||
return await contract.metadata.get();
|
return (await contract.metadata.get()) as any; // FIXME types
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enabled: !!contract,
|
enabled: !!contract,
|
||||||
|
|||||||
@@ -1,188 +0,0 @@
|
|||||||
import {
|
|
||||||
RequiredParam,
|
|
||||||
requiredParamInvariant,
|
|
||||||
} from "../../../core/query-utils/required-param";
|
|
||||||
import { useSDKChainId } from "../../providers/thirdweb-sdk-provider";
|
|
||||||
import { WalletAddress } from "../../types";
|
|
||||||
import {
|
|
||||||
cacheKeys,
|
|
||||||
invalidateContractAndBalances,
|
|
||||||
} from "../../utils/cache-keys";
|
|
||||||
import { useQueryWithNetwork } from "../query-utils/useQueryWithNetwork";
|
|
||||||
import {
|
|
||||||
useMutation,
|
|
||||||
useQueryClient,
|
|
||||||
UseQueryResult,
|
|
||||||
} from "@tanstack/react-query";
|
|
||||||
import type { AccountEvent, SmartContract } from "@thirdweb-dev/sdk";
|
|
||||||
import type { BytesLike } from "ethers";
|
|
||||||
import invariant from "tiny-invariant";
|
|
||||||
|
|
||||||
/** **********************/
|
|
||||||
/** READ HOOKS **/
|
|
||||||
/** **********************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all wallets
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```javascript
|
|
||||||
* const { data: smartWallets, isLoading, error } = useSmartWallets(contract);
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param contract - an instance of a smart wallet factory contract
|
|
||||||
* @returns a response object that includes an array of all smart wallets with their associated admin
|
|
||||||
* @twfeature SmartWalletFactory
|
|
||||||
* @see {@link https://portal.thirdweb.com/react/react.usesmartwallets?utm_source=sdk | Documentation}
|
|
||||||
* @beta
|
|
||||||
*/
|
|
||||||
export function useSmartWallets(
|
|
||||||
contract: RequiredParam<SmartContract>,
|
|
||||||
): UseQueryResult<AccountEvent[]> {
|
|
||||||
const contractAddress = contract?.getAddress();
|
|
||||||
return useQueryWithNetwork(
|
|
||||||
cacheKeys.contract.smartWalletFactory.getAll(contractAddress),
|
|
||||||
() => {
|
|
||||||
requiredParamInvariant(contract, "No Contract instance provided");
|
|
||||||
invariant(
|
|
||||||
contract.smartWalletFactory.getAllAccounts,
|
|
||||||
"Contract instance does not support contract.smartWalletFactory.getAllAccounts",
|
|
||||||
);
|
|
||||||
return contract.smartWalletFactory.getAllAccounts();
|
|
||||||
},
|
|
||||||
{ enabled: !!contract },
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all wallets associated with the provided address
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```javascript
|
|
||||||
* const { data: smartWalletsForAddress, isLoading, error } = useSmartWalletsForAddress(contract, "{{wallet_address}}");
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param contract - an instance of a smart wallet factory contract
|
|
||||||
* @returns a response object that includes an array of all smart wallets associated with the adress
|
|
||||||
* @twfeature SmartWalletFactory
|
|
||||||
* @see {@link https://portal.thirdweb.com/react/react.usesmartwalletsforaddress?utm_source=sdk | Documentation}
|
|
||||||
* @beta
|
|
||||||
*/
|
|
||||||
export function useSmartWalletsForAddress(
|
|
||||||
contract: RequiredParam<SmartContract>,
|
|
||||||
address: RequiredParam<WalletAddress>,
|
|
||||||
): UseQueryResult<string[]> {
|
|
||||||
const contractAddress = contract?.getAddress();
|
|
||||||
return useQueryWithNetwork(
|
|
||||||
cacheKeys.contract.smartWalletFactory.getAllForAddress(
|
|
||||||
contractAddress,
|
|
||||||
address,
|
|
||||||
),
|
|
||||||
() => {
|
|
||||||
requiredParamInvariant(contract, "No Contract instance provided");
|
|
||||||
invariant(
|
|
||||||
contract.smartWalletFactory.getAssociatedWallets,
|
|
||||||
"Contract instance does not support contract.smartWalletFactory.getAssociatedWallets",
|
|
||||||
);
|
|
||||||
return contract.smartWalletFactory.getAssociatedWallets(address || "");
|
|
||||||
},
|
|
||||||
{ enabled: !!contract },
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if a smart wallet has been deployed for the given admin
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```javascript
|
|
||||||
* const { data: isSmartWalletDeployed, isLoading, error } = useIsSmartWalletDeployed(contract);
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param contract - an instance of a smart wallet factory contract
|
|
||||||
* @returns a boolean indicating if a smart wallet has been deployed for the given admin
|
|
||||||
* @twfeature SmartWalletFactory
|
|
||||||
* @see {@link https://portal.thirdweb.com/react/react.useissmartwalletdeployed?utm_source=sdk | Documentation}
|
|
||||||
* @beta
|
|
||||||
*/
|
|
||||||
export function useIsSmartWalletDeployed(
|
|
||||||
contract: RequiredParam<SmartContract>,
|
|
||||||
admin: RequiredParam<WalletAddress>,
|
|
||||||
extraData?: BytesLike,
|
|
||||||
): UseQueryResult<boolean> {
|
|
||||||
const contractAddress = contract?.getAddress();
|
|
||||||
return useQueryWithNetwork(
|
|
||||||
cacheKeys.contract.smartWalletFactory.isSmartWalletDeployed(
|
|
||||||
contractAddress,
|
|
||||||
admin,
|
|
||||||
),
|
|
||||||
() => {
|
|
||||||
requiredParamInvariant(contract, "No Contract instance provided");
|
|
||||||
invariant(
|
|
||||||
contract.smartWalletFactory.isWalletDeployed,
|
|
||||||
"Contract instance does not support contract.smartWalletFactory.getAllWallets",
|
|
||||||
);
|
|
||||||
invariant(admin, "No wallet address provided");
|
|
||||||
return contract.smartWalletFactory.isWalletDeployed(admin, extraData);
|
|
||||||
},
|
|
||||||
{ enabled: !!contract },
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** **********************/
|
|
||||||
/** WRITE HOOKS **/
|
|
||||||
/** **********************/
|
|
||||||
/**
|
|
||||||
* Create a smart wallet
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```jsx
|
|
||||||
* const Component = () => {
|
|
||||||
* const { contract } = useContract("{{contract_address}}");
|
|
||||||
* const {
|
|
||||||
* mutate: createSmartWallet,
|
|
||||||
* isLoading,
|
|
||||||
* error,
|
|
||||||
* } = useCreateSmartWallet(contract);
|
|
||||||
*
|
|
||||||
* if (error) {
|
|
||||||
* console.error("failed to create smart wallet", error);
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* return (
|
|
||||||
* <button
|
|
||||||
* disabled={isLoading}
|
|
||||||
* onClick={() => createSmartWallet("0x...")}
|
|
||||||
* >
|
|
||||||
* Create Smart Wallet
|
|
||||||
* </button>
|
|
||||||
* );
|
|
||||||
* };
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param contract - an instance of a smart wallet factory contract
|
|
||||||
* @returns a mutation object that can be used to create a smart wallet
|
|
||||||
* @twfeature SmartWalletFactory
|
|
||||||
* @see {@link https://portal.thirdweb.com/react/react.usecreatesmartwallet?utm_source=sdk | Documentation}
|
|
||||||
* @beta
|
|
||||||
*/
|
|
||||||
export function useCreateSmartWallet(contract: RequiredParam<SmartContract>) {
|
|
||||||
const activeChainId = useSDKChainId();
|
|
||||||
const contractAddress = contract?.getAddress();
|
|
||||||
const queryClient = useQueryClient();
|
|
||||||
|
|
||||||
return useMutation(
|
|
||||||
async (admin: string, extraData?: BytesLike) => {
|
|
||||||
requiredParamInvariant(contract, "contract is undefined");
|
|
||||||
|
|
||||||
return contract.smartWalletFactory.createWallet(admin, extraData);
|
|
||||||
},
|
|
||||||
{
|
|
||||||
onSettled: () =>
|
|
||||||
invalidateContractAndBalances(
|
|
||||||
queryClient,
|
|
||||||
contractAddress,
|
|
||||||
activeChainId,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export { resolveIpfsUri, resolveMimeType } from "../core/utils/ipfs";
|
export { resolveMimeType } from "../core/utils/ipfs";
|
||||||
|
|
||||||
export { ThirdwebThemeContext } from "../core/providers/theme-context";
|
export { ThirdwebThemeContext } from "../core/providers/theme-context";
|
||||||
export { ThirdwebProviderCore } from "../core/providers/thirdweb-provider";
|
export { ThirdwebProviderCore } from "../core/providers/thirdweb-provider";
|
||||||
@@ -194,19 +194,16 @@ export {
|
|||||||
useBurnToken,
|
useBurnToken,
|
||||||
} from "./hooks/async/token";
|
} from "./hooks/async/token";
|
||||||
|
|
||||||
// smart wallet factory
|
// account factory
|
||||||
export {
|
export {
|
||||||
useIsSmartWalletDeployed,
|
useIsAccountDeployed,
|
||||||
useSmartWallets,
|
useAccounts,
|
||||||
useCreateSmartWallet,
|
useCreateAccount,
|
||||||
useSmartWalletsForAddress,
|
useAccountsForAddress,
|
||||||
} from "./hooks/async/smart-wallet-factory";
|
} from "./hooks/async/account-factory";
|
||||||
|
|
||||||
// smart wallet
|
// account
|
||||||
export {
|
export { useAccountSigners, useSetAccountSigners } from "./hooks/async/account";
|
||||||
useSmartWalletSigners,
|
|
||||||
useSetSmartWalletSigners,
|
|
||||||
} from "./hooks/async/smart-wallet";
|
|
||||||
|
|
||||||
// thirdweb hooks (work as long as at least `<ThirdwebSdkProvider>` is used)
|
// thirdweb hooks (work as long as at least `<ThirdwebSdkProvider>` is used)
|
||||||
|
|
||||||
|
|||||||
@@ -118,18 +118,23 @@ export const cacheKeys = {
|
|||||||
overrides,
|
overrides,
|
||||||
]),
|
]),
|
||||||
|
|
||||||
smartWalletFactory: {
|
accountFactory: {
|
||||||
getAll: (contractAddress: RequiredParam<ContractAddress>) =>
|
getAll: (contractAddress: RequiredParam<ContractAddress>) =>
|
||||||
createContractCacheKey(contractAddress, ["smartWalletFactory"]),
|
createContractCacheKey(contractAddress, ["accountFactory"]),
|
||||||
isSmartWalletDeployed: (contractAdress: RequiredParam<ContractAddress>, admin: RequiredParam<string>) =>
|
isAccountDeployed: (
|
||||||
createContractCacheKey(contractAdress, ["isSmartWalletDeployed", admin]),
|
contractAdress: RequiredParam<ContractAddress>,
|
||||||
getAllForAddress: (contractAdress: RequiredParam<ContractAddress>, address: RequiredParam<string>) =>
|
admin: RequiredParam<string>,
|
||||||
|
) => createContractCacheKey(contractAdress, ["isAccountDeployed", admin]),
|
||||||
|
getAllForAddress: (
|
||||||
|
contractAdress: RequiredParam<ContractAddress>,
|
||||||
|
address: RequiredParam<string>,
|
||||||
|
) =>
|
||||||
createContractCacheKey(contractAdress, ["getAllForAddress", address]),
|
createContractCacheKey(contractAdress, ["getAllForAddress", address]),
|
||||||
},
|
},
|
||||||
|
|
||||||
smartWallet: {
|
account: {
|
||||||
signers: (contractAddress: RequiredParam<ContractAddress>) =>
|
signers: (contractAddress: RequiredParam<ContractAddress>) =>
|
||||||
createContractCacheKey(contractAddress, ["smartWallet", "signers"]),
|
createContractCacheKey(contractAddress, ["account", "signers"]),
|
||||||
},
|
},
|
||||||
|
|
||||||
app: {
|
app: {
|
||||||
@@ -198,12 +203,8 @@ export const cacheKeys = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
sharedMetadata: {
|
sharedMetadata: {
|
||||||
get: (
|
get: (contractAddress: RequiredParam<ContractAddress>) =>
|
||||||
contractAddress: RequiredParam<ContractAddress>,
|
createContractCacheKey(contractAddress),
|
||||||
) =>
|
|
||||||
createContractCacheKey(
|
|
||||||
contractAddress
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
drop: {
|
drop: {
|
||||||
getAllUnclaimed: (
|
getAllUnclaimed: (
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
# @thirdweb-dev/react-native-compat
|
# @thirdweb-dev/react-native-compat
|
||||||
|
|
||||||
|
## 0.2.28
|
||||||
|
|
||||||
|
## 0.2.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
## 0.2.26
|
||||||
|
|
||||||
|
## 0.2.25
|
||||||
|
|
||||||
|
## 0.2.24
|
||||||
|
|
||||||
## 0.2.23
|
## 0.2.23
|
||||||
|
|
||||||
## 0.2.22
|
## 0.2.22
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native-compat",
|
"name": "@thirdweb-dev/react-native-compat",
|
||||||
"description": "Shims for Thirdweb in React Native Projects",
|
"description": "Shims for Thirdweb in React Native Projects",
|
||||||
"version": "0.2.23",
|
"version": "0.2.28",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -22,10 +22,10 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethersproject/shims": "^5.7.0",
|
"@ethersproject/shims": "^5.7.0",
|
||||||
"@walletconnect/react-native-compat": "^2.3.3",
|
"@walletconnect/react-native-compat": "^2.8.6",
|
||||||
"base-64": "^1.0.0",
|
"base-64": "^1.0.0",
|
||||||
"big-integer": "^1.6.51",
|
"big-integer": "^1.6.51",
|
||||||
"react-native-get-random-values": "^1.8.0"
|
"react-native-get-random-values": "^1.9.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"ethers": "^5.5.1",
|
"ethers": "^5.5.1",
|
||||||
@@ -34,12 +34,12 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"@types/node": "^18.0.0",
|
"@types/node": "^18.16.18",
|
||||||
"babel-plugin-module-resolver": "^5.0.0",
|
"babel-plugin-module-resolver": "^5.0.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"ethers": "^5.7.2",
|
"ethers": "^5.7.2",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-native": "^0.71.0",
|
"react-native": "^0.71.11",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,90 @@
|
|||||||
# @thirdweb-dev/react-native
|
# @thirdweb-dev/react-native
|
||||||
|
|
||||||
|
## 0.2.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1283](https://github.com/thirdweb-dev/js/pull/1283) [`8672c853`](https://github.com/thirdweb-dev/js/commit/8672c8533c694cad46242672ec23b883049bd526) Thanks [@iketw](https://github.com/iketw)! - SDK improvements:
|
||||||
|
|
||||||
|
1. You can now pass an `extraRows` prop to the ConnectWallet button. This will render the `extraRows` at the bottom of the connected wallet details modal.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import {
|
||||||
|
BaseButton,
|
||||||
|
Box,
|
||||||
|
ConnectWallet,
|
||||||
|
Text,
|
||||||
|
} from "@thirdweb-dev/react-native";
|
||||||
|
|
||||||
|
const extraRows = () => {
|
||||||
|
return (
|
||||||
|
<Box>
|
||||||
|
<Text variant="bodySmallSecondary" textAlign="center" mt="sm">
|
||||||
|
Extra option
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
<ConnectWallet theme={"dark"} extraRows={extraRows} />;
|
||||||
|
```
|
||||||
|
|
||||||
|
2. You can now import a local wallet by a mnemoic as well.
|
||||||
|
|
||||||
|
When creating a Local/Guest Wallet the import wallet modal accepts both a privateKey or a mnemonic. This makes it easier for users to import their wallets into your app
|
||||||
|
|
||||||
|
- [#1309](https://github.com/thirdweb-dev/js/pull/1309) [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352) Thanks [@jnsdls](https://github.com/jnsdls)! - unblock storage domains
|
||||||
|
|
||||||
|
- Updated dependencies [[`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5), [`72ada475`](https://github.com/thirdweb-dev/js/commit/72ada47596d5d5c08736c33215faeec636b7156a), [`2c0bb078`](https://github.com/thirdweb-dev/js/commit/2c0bb0789955f6cd397b6fdb8e990a505251c631), [`b5c6eedb`](https://github.com/thirdweb-dev/js/commit/b5c6eedb38aa3c52eb97f3d25ad83e38c55afe61), [`10b3a717`](https://github.com/thirdweb-dev/js/commit/10b3a717da606632a05769ac821bdd21d6b63a03), [`b4aee9b5`](https://github.com/thirdweb-dev/js/commit/b4aee9b59121bab5f9b3d9b7ecdc4bcb4cd66f58), [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.2.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
- Updated dependencies [[`2d088d36`](https://github.com/thirdweb-dev/js/commit/2d088d367ca54233836dc69712fd411ab7924205), [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2), [`9daf0449`](https://github.com/thirdweb-dev/js/commit/9daf044926bf995ac8998929dbeca548c5eb8561), [`546353a4`](https://github.com/thirdweb-dev/js/commit/546353a479c11533818ef917c0f6b4d6f8f69872), [`a3bb17cb`](https://github.com/thirdweb-dev/js/commit/a3bb17cb33f033846fb3b4c8a0a4809ba76cab96), [`0135a779`](https://github.com/thirdweb-dev/js/commit/0135a7790cf2acde6b701cb41ea10dd311da5ec3)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.2.26
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1270](https://github.com/thirdweb-dev/js/pull/1270) [`0d5503aa`](https://github.com/thirdweb-dev/js/commit/0d5503aae90d9cd7a7adcabad19f7f45d9a37063) Thanks [@iketw](https://github.com/iketw)! - Only handle Coinbase callback URL if Coinbase is added as a supportedWallet
|
||||||
|
|
||||||
|
- [#1277](https://github.com/thirdweb-dev/js/pull/1277) [`2b113539`](https://github.com/thirdweb-dev/js/commit/2b113539098384f910b3c4d54e1fde9d35a6f053) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - remove ethers/lib/utils dependency
|
||||||
|
|
||||||
|
- Updated dependencies [[`2b113539`](https://github.com/thirdweb-dev/js/commit/2b113539098384f910b3c4d54e1fde9d35a6f053), [`c9535715`](https://github.com/thirdweb-dev/js/commit/c95357158819abd42d4b0900ecc2fa40fcb957f8), [`be606dd3`](https://github.com/thirdweb-dev/js/commit/be606dd3c93c1514834c1d970e864d7f949a07ab), [`edcd22d6`](https://github.com/thirdweb-dev/js/commit/edcd22d61236edb2832f9b2f9796e891d58cb145), [`5882091e`](https://github.com/thirdweb-dev/js/commit/5882091eab65978009a5a5305701f121851b10ad), [`998e5217`](https://github.com/thirdweb-dev/js/commit/998e521733efd6a67e42f9bf0beab5fbdccf08ae)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.2.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`ed711c8c`](https://github.com/thirdweb-dev/js/commit/ed711c8cb2ed6a0deb1b2a5eeec06df1d4edc5e8), [`05a7495a`](https://github.com/thirdweb-dev/js/commit/05a7495a132aabab5f48abbdb80a468ff6f65df8), [`e78da6b3`](https://github.com/thirdweb-dev/js/commit/e78da6b36cfa6d954234820563201bf760186ed1)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.2.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`efb3546e`](https://github.com/thirdweb-dev/js/commit/efb3546ec8268156be00301af28b9d83ecd5ab08)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
## 0.2.23
|
## 0.2.23
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native",
|
"name": "@thirdweb-dev/react-native",
|
||||||
"version": "0.2.23",
|
"version": "0.2.28",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coinbase/wallet-mobile-sdk": "1.0.6",
|
"@coinbase/wallet-mobile-sdk": "1.0.6",
|
||||||
"@magic-sdk/provider": "17.2.0",
|
"@magic-sdk/provider": "17.2.0",
|
||||||
"@magic-sdk/react-native-bare": "^18.3.0",
|
"@magic-sdk/react-native-bare": "^18.5.0",
|
||||||
"@shopify/restyle": "^2.4.1",
|
"@shopify/restyle": "^2.4.2",
|
||||||
"@tanstack/react-query": "^4.0.10",
|
"@tanstack/react-query": "^4.29.19",
|
||||||
"@thirdweb-dev/chains": "workspace:*",
|
"@thirdweb-dev/chains": "workspace:*",
|
||||||
"@thirdweb-dev/react-core": "workspace:*",
|
"@thirdweb-dev/react-core": "workspace:*",
|
||||||
"@thirdweb-dev/sdk": "workspace:*",
|
"@thirdweb-dev/sdk": "workspace:*",
|
||||||
@@ -41,38 +41,38 @@
|
|||||||
"expo-secure-store": "^12.1.1",
|
"expo-secure-store": "^12.1.1",
|
||||||
"react-native-mmkv": "2.5.1",
|
"react-native-mmkv": "2.5.1",
|
||||||
"react-native-modal": "^13.0.1",
|
"react-native-modal": "^13.0.1",
|
||||||
"react-native-svg": "^13.8.0",
|
"react-native-svg": "^13.9.0",
|
||||||
"tiny-invariant": "^1.2.0"
|
"tiny-invariant": "^1.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.19.3",
|
"@babel/core": "^7.22.5",
|
||||||
"@babel/preset-env": "^7.1.6",
|
"@babel/preset-env": "^7.22.5",
|
||||||
"@react-native-async-storage/async-storage": "*",
|
"@react-native-async-storage/async-storage": "^1.18.2",
|
||||||
"@react-native-community/eslint-config": "^3.0.2",
|
"@react-native-community/eslint-config": "^3.0.2",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"@types/jest": "^29.2.1",
|
"@types/jest": "^29.5.2",
|
||||||
"@types/react": "^18.0.5",
|
"@types/react": "^18.2.14",
|
||||||
"@types/react-native": "^0.71.0",
|
"@types/react-native": "^0.71.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||||
"@typescript-eslint/parser": "^5.56.0",
|
"@typescript-eslint/parser": "^5.60.1",
|
||||||
"babel-jest": "^29.2.1",
|
"babel-jest": "^29.2.1",
|
||||||
"eslint": "^8.42.0",
|
"eslint": "^8.43.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"ethers": "^5.7.2",
|
"ethers": "^5.7.2",
|
||||||
"expo": "^47.0.0",
|
"expo": "^47.0.14",
|
||||||
"jest": "^29.4.3",
|
"jest": "^29.4.3",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.8",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-native": "^0.71.0",
|
"react-native": "^0.71.11",
|
||||||
"react-native-camera": "^4.2.1",
|
"react-native-camera": "^4.2.1",
|
||||||
"react-native-device-info": "10.6.0",
|
"react-native-device-info": "10.6.0",
|
||||||
"react-native-safe-area-context": "4.5.3",
|
"react-native-safe-area-context": "4.5.3",
|
||||||
"react-native-webview": "12.1.0",
|
"react-native-webview": "12.1.0",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"react-native-camera": "^4.2.1",
|
"react-native-camera": "^4.2.1",
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ export type ConnectWalletProps = {
|
|||||||
* render a custom button to display the connected wallet details instead of the default button
|
* render a custom button to display the connected wallet details instead of the default button
|
||||||
*/
|
*/
|
||||||
detailsButton?: ConnectWalletDetailsProps["detailsButton"];
|
detailsButton?: ConnectWalletDetailsProps["detailsButton"];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* render custom rows in the Connect Wallet Details modal
|
||||||
|
*/
|
||||||
|
extraRows?: ConnectWalletDetailsProps["extraRows"];
|
||||||
} & ConnectWalletButtonProps;
|
} & ConnectWalletButtonProps;
|
||||||
|
|
||||||
export const ConnectWallet = ({
|
export const ConnectWallet = ({
|
||||||
@@ -21,6 +26,7 @@ export const ConnectWallet = ({
|
|||||||
theme,
|
theme,
|
||||||
buttonTitle,
|
buttonTitle,
|
||||||
modalTitle,
|
modalTitle,
|
||||||
|
extraRows,
|
||||||
}: ConnectWalletProps) => {
|
}: ConnectWalletProps) => {
|
||||||
const fadeAnim = useRef(new Animated.Value(0)).current;
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
||||||
const address = useAddress();
|
const address = useAddress();
|
||||||
@@ -40,6 +46,7 @@ export const ConnectWallet = ({
|
|||||||
<WalletDetailsButton
|
<WalletDetailsButton
|
||||||
address={address}
|
address={address}
|
||||||
detailsButton={detailsButton}
|
detailsButton={detailsButton}
|
||||||
|
extraRows={extraRows}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ConnectWalletButton
|
<ConnectWalletButton
|
||||||
|
|||||||
+73
-43
@@ -1,11 +1,11 @@
|
|||||||
import { Linking, StyleSheet, View } from "react-native";
|
import { Dimensions, Linking, StyleSheet, View } from "react-native";
|
||||||
import Box from "../base/Box";
|
import Box from "../base/Box";
|
||||||
import { Toast } from "../base/Toast";
|
import { Toast } from "../base/Toast";
|
||||||
import { ExportLocalWalletModal } from "./ExportLocalWalletModal";
|
import { ExportLocalWalletModal } from "./ExportLocalWalletModal";
|
||||||
import { NetworkButton } from "../base/NetworkButton";
|
import { NetworkButton } from "../base/NetworkButton";
|
||||||
import { WalletDetailsModalHeader } from "./WalletDetailsModalHeader";
|
import { WalletDetailsModalHeader } from "./WalletDetailsModalHeader";
|
||||||
import {
|
import {
|
||||||
useActiveChain,
|
useChain,
|
||||||
useDisconnect,
|
useDisconnect,
|
||||||
useSetConnectedWallet,
|
useSetConnectedWallet,
|
||||||
useWallet,
|
useWallet,
|
||||||
@@ -18,24 +18,34 @@ import { useSmartWallet } from "../../providers/context-provider";
|
|||||||
import BaseButton from "../base/BaseButton";
|
import BaseButton from "../base/BaseButton";
|
||||||
import { SmartWalletAdditionalActions } from "./SmartWalletAdditionalActions";
|
import { SmartWalletAdditionalActions } from "./SmartWalletAdditionalActions";
|
||||||
import Text from "../base/Text";
|
import Text from "../base/Text";
|
||||||
import { useModalState } from "../../providers/ui-context-provider";
|
|
||||||
import { CLOSE_MODAL_STATE, WalletDetailsModal } from "../../utils/modalTypes";
|
|
||||||
import { useAppTheme } from "../../styles/hooks";
|
import { useAppTheme } from "../../styles/hooks";
|
||||||
import { LocalWalletImportModal } from "../ConnectWalletFlow/LocalWalletImportModal";
|
import { LocalWalletImportModal } from "../ConnectWalletFlow/LocalWalletImportModal";
|
||||||
import { IconTextButton } from "../base/IconTextButton";
|
import { IconTextButton } from "../base/IconTextButton";
|
||||||
import MoneyIcon from "../../assets/money";
|
import MoneyIcon from "../../assets/money";
|
||||||
|
import { TWModal } from "../base/modal/TWModal";
|
||||||
|
|
||||||
export const ConnectWalletDetailsModal = () => {
|
const MODAL_HEIGHT = Dimensions.get("window").height * 0.7;
|
||||||
|
const DEVICE_WIDTH = Dimensions.get("window").width;
|
||||||
|
|
||||||
|
export const ConnectWalletDetailsModal = ({
|
||||||
|
isVisible,
|
||||||
|
onClosePress,
|
||||||
|
extraRows,
|
||||||
|
address,
|
||||||
|
}: {
|
||||||
|
isVisible: boolean;
|
||||||
|
onClosePress: () => void;
|
||||||
|
extraRows?: React.FC;
|
||||||
|
address?: string;
|
||||||
|
}) => {
|
||||||
const theme = useAppTheme();
|
const theme = useAppTheme();
|
||||||
const [isExportModalVisible, setIsExportModalVisible] = useState(false);
|
const [isExportModalVisible, setIsExportModalVisible] = useState(false);
|
||||||
const activeWallet = useWallet();
|
const activeWallet = useWallet();
|
||||||
const chain = useActiveChain();
|
const chain = useChain();
|
||||||
const disconnect = useDisconnect();
|
const disconnect = useDisconnect();
|
||||||
const [smartWallet, setSmartWallet] = useSmartWallet();
|
const [smartWallet, setSmartWallet] = useSmartWallet();
|
||||||
const [addressCopied, setAddressCopied] = useState(false);
|
const [addressCopied, setAddressCopied] = useState(false);
|
||||||
const [isImportModalVisible, setIsImportModalVisible] = useState(false);
|
const [isImportModalVisible, setIsImportModalVisible] = useState(false);
|
||||||
const { modalState, setModalState } = useModalState();
|
|
||||||
const { address } = (modalState as WalletDetailsModal).data;
|
|
||||||
const setConnectedWallet = useSetConnectedWallet();
|
const setConnectedWallet = useSetConnectedWallet();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -50,8 +60,8 @@ export const ConnectWalletDetailsModal = () => {
|
|||||||
|
|
||||||
const onDisconnectPress = () => {
|
const onDisconnectPress = () => {
|
||||||
disconnect().finally(() => {
|
disconnect().finally(() => {
|
||||||
setModalState(CLOSE_MODAL_STATE("ConnectWalletDetailsModal"));
|
|
||||||
setSmartWallet?.(undefined);
|
setSmartWallet?.(undefined);
|
||||||
|
onClosePress();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -176,45 +186,65 @@ export const ConnectWalletDetailsModal = () => {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<TWModal isVisible={isVisible} onBackdropPress={onClosePress}>
|
||||||
<ExportLocalWalletModal
|
<View
|
||||||
isVisible={isExportModalVisible}
|
style={[styles.modal, { backgroundColor: theme.colors.background }]}
|
||||||
onClose={onExportModalClose}
|
>
|
||||||
/>
|
<Box style={styles.contentContainer}>
|
||||||
<WalletDetailsModalHeader
|
<ExportLocalWalletModal
|
||||||
address={address}
|
isVisible={isExportModalVisible}
|
||||||
onDisconnectPress={onDisconnectPress}
|
onClose={onExportModalClose}
|
||||||
onAddressCopied={onAddressCopied}
|
/>
|
||||||
/>
|
<WalletDetailsModalHeader
|
||||||
<View style={styles.currentNetwork}>
|
address={address}
|
||||||
<Text variant="bodySmallSecondary">Current Network</Text>
|
onDisconnectPress={onDisconnectPress}
|
||||||
|
onAddressCopied={onAddressCopied}
|
||||||
|
/>
|
||||||
|
<View style={styles.currentNetwork}>
|
||||||
|
<Text variant="bodySmallSecondary">Current Network</Text>
|
||||||
|
</View>
|
||||||
|
<NetworkButton
|
||||||
|
chainIconUrl={chain?.icon?.url || ""}
|
||||||
|
chainName={chain?.name || "Unknown Network"}
|
||||||
|
onPress={onChangeNetworkPress}
|
||||||
|
/>
|
||||||
|
{chain?.testnet && chain?.faucets?.length ? (
|
||||||
|
<IconTextButton
|
||||||
|
mt="xs"
|
||||||
|
text="Request Testnet Funds"
|
||||||
|
icon={<MoneyIcon height={10} width={10} />}
|
||||||
|
onPress={() => {
|
||||||
|
if (chain?.faucets?.[0]) {
|
||||||
|
Linking.openURL(chain.faucets[0]);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
|
{getAdditionalActions()}
|
||||||
|
{extraRows ? extraRows({}) : null}
|
||||||
|
{addressCopied === true ? (
|
||||||
|
<Toast text={"Address copied to clipboard"} />
|
||||||
|
) : null}
|
||||||
|
</Box>
|
||||||
</View>
|
</View>
|
||||||
<NetworkButton
|
</TWModal>
|
||||||
chainIconUrl={chain?.icon?.url || ""}
|
|
||||||
chainName={chain?.name || "Unknown Network"}
|
|
||||||
onPress={onChangeNetworkPress}
|
|
||||||
/>
|
|
||||||
{chain?.testnet && chain?.faucets?.length ? (
|
|
||||||
<IconTextButton
|
|
||||||
mt="xs"
|
|
||||||
text="Request Testnet Funds"
|
|
||||||
icon={<MoneyIcon height={10} width={10} />}
|
|
||||||
onPress={() => {
|
|
||||||
if (chain?.faucets?.[0]) {
|
|
||||||
Linking.openURL(chain.faucets[0]);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{getAdditionalActions()}
|
|
||||||
{addressCopied === true ? (
|
|
||||||
<Toast text={"Address copied to clipboard"} />
|
|
||||||
) : null}
|
|
||||||
</Box>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
modal: {
|
||||||
|
position: "absolute",
|
||||||
|
bottom: -20,
|
||||||
|
left: -20,
|
||||||
|
width: DEVICE_WIDTH,
|
||||||
|
borderTopLeftRadius: 24,
|
||||||
|
borderTopRightRadius: 24,
|
||||||
|
padding: 24,
|
||||||
|
},
|
||||||
|
contentContainer: {
|
||||||
|
maxHeight: MODAL_HEIGHT,
|
||||||
|
display: "flex",
|
||||||
|
},
|
||||||
exportWalletInfo: {
|
exportWalletInfo: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: "flex-start",
|
justifyContent: "flex-start",
|
||||||
|
|||||||
+22
-12
@@ -6,37 +6,47 @@ import { WalletIcon } from "../base/WalletIcon";
|
|||||||
import { useWallet, useBalance, useChain } from "@thirdweb-dev/react-core";
|
import { useWallet, useBalance, useChain } from "@thirdweb-dev/react-core";
|
||||||
import { StyleSheet } from "react-native";
|
import { StyleSheet } from "react-native";
|
||||||
import { LocalWallet } from "@thirdweb-dev/wallets";
|
import { LocalWallet } from "@thirdweb-dev/wallets";
|
||||||
import { useModalState } from "../../providers/ui-context-provider";
|
|
||||||
import Box from "../base/Box";
|
import Box from "../base/Box";
|
||||||
|
import { ConnectWalletDetailsModal } from "./ConnectWalletDetailsModal";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export type ConnectWalletDetailsProps = {
|
export type ConnectWalletDetailsProps = {
|
||||||
address: string;
|
address?: string;
|
||||||
detailsButton?: React.FC<{ onPress: () => void }>;
|
detailsButton?: React.FC<{ onPress: () => void }>;
|
||||||
|
extraRows?: React.FC;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const WalletDetailsButton = ({
|
export const WalletDetailsButton = ({
|
||||||
address,
|
address,
|
||||||
detailsButton,
|
detailsButton,
|
||||||
|
extraRows,
|
||||||
}: ConnectWalletDetailsProps) => {
|
}: ConnectWalletDetailsProps) => {
|
||||||
const activeWallet = useWallet();
|
const activeWallet = useWallet();
|
||||||
const chain = useChain();
|
const chain = useChain();
|
||||||
const balanceQuery = useBalance();
|
const balanceQuery = useBalance();
|
||||||
const { setModalState } = useModalState();
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||||
|
|
||||||
const onPress = () => {
|
const onPress = () => {
|
||||||
setModalState({
|
// setModalState({
|
||||||
view: "WalletDetails",
|
// view: "WalletDetails",
|
||||||
data: {
|
// data: {
|
||||||
address: address,
|
// address: address,
|
||||||
},
|
// },
|
||||||
isOpen: true,
|
// isOpen: true,
|
||||||
isSheet: true,
|
// isSheet: true,
|
||||||
caller: "ConnectWalletDetails",
|
// caller: "ConnectWalletDetails",
|
||||||
});
|
// });
|
||||||
|
setIsModalVisible(!isModalVisible);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<ConnectWalletDetailsModal
|
||||||
|
isVisible={isModalVisible}
|
||||||
|
onClosePress={onPress}
|
||||||
|
extraRows={extraRows}
|
||||||
|
address={address}
|
||||||
|
/>
|
||||||
{detailsButton ? (
|
{detailsButton ? (
|
||||||
detailsButton({ onPress })
|
detailsButton({ onPress })
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
+4
-1
@@ -12,7 +12,7 @@ import CopyIcon from "../../assets/copy";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
interface WalletDetailsModalHeaderProps {
|
interface WalletDetailsModalHeaderProps {
|
||||||
address: string;
|
address?: string;
|
||||||
onDisconnectPress: () => void;
|
onDisconnectPress: () => void;
|
||||||
onAddressCopied?: () => void;
|
onAddressCopied?: () => void;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
@@ -29,6 +29,9 @@ export const WalletDetailsModalHeader = ({
|
|||||||
const [showLoading, setShowLoading] = useState(false);
|
const [showLoading, setShowLoading] = useState(false);
|
||||||
|
|
||||||
const onAddressPress = async () => {
|
const onAddressPress = async () => {
|
||||||
|
if (!address) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await Clipboard.setStringAsync(address);
|
await Clipboard.setStringAsync(address);
|
||||||
onAddressCopied?.();
|
onAddressCopied?.();
|
||||||
};
|
};
|
||||||
|
|||||||
+41
-27
@@ -16,6 +16,7 @@ import * as FileSystem from "expo-file-system";
|
|||||||
import { TWModal } from "../base/modal/TWModal";
|
import { TWModal } from "../base/modal/TWModal";
|
||||||
import { localWallet } from "../../wallets/wallets/local-wallet";
|
import { localWallet } from "../../wallets/wallets/local-wallet";
|
||||||
import { TextInput } from "../base";
|
import { TextInput } from "../base";
|
||||||
|
import { useAppTheme } from "../../styles/hooks";
|
||||||
|
|
||||||
export type LocalWalletImportModalProps = {
|
export type LocalWalletImportModalProps = {
|
||||||
isVisible: boolean;
|
isVisible: boolean;
|
||||||
@@ -29,11 +30,14 @@ export const LocalWalletImportModal = ({
|
|||||||
onWalletImported,
|
onWalletImported,
|
||||||
}: LocalWalletImportModalProps) => {
|
}: LocalWalletImportModalProps) => {
|
||||||
const [password, setPassword] = useState<string | undefined>();
|
const [password, setPassword] = useState<string | undefined>();
|
||||||
const [privateKey, setPrivateKey] = useState<string | undefined>(undefined);
|
const [privateKeyOrMnemonic, setPrivateKeyOrMnemonic] = useState<
|
||||||
|
string | undefined
|
||||||
|
>(undefined);
|
||||||
const [jsonFile, setJsonFile] = useState<string | undefined>();
|
const [jsonFile, setJsonFile] = useState<string | undefined>();
|
||||||
const [error, setError] = useState<string | undefined>();
|
const [error, setError] = useState<string | undefined>();
|
||||||
const [isImporting, setIsImporting] = useState<boolean>(false);
|
const [isImporting, setIsImporting] = useState<boolean>(false);
|
||||||
const createWalletInstance = useCreateWalletInstance();
|
const createWalletInstance = useCreateWalletInstance();
|
||||||
|
const theme = useAppTheme();
|
||||||
|
|
||||||
const createLocalWalletFromJsonFile = async () => {
|
const createLocalWalletFromJsonFile = async () => {
|
||||||
if (!jsonFile || !password) {
|
if (!jsonFile || !password) {
|
||||||
@@ -65,17 +69,24 @@ export const LocalWalletImportModal = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const createLocalWalletPK = async () => {
|
const createLocalWalletPK = async () => {
|
||||||
if (!privateKey) {
|
if (!privateKeyOrMnemonic) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const localWalletInstance = createWalletInstance(localWallet());
|
const localWalletInstance = createWalletInstance(localWallet());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await localWalletInstance.import({
|
if (privateKeyOrMnemonic.indexOf(" ") === -1) {
|
||||||
privateKey: privateKey,
|
await localWalletInstance.import({
|
||||||
encryption: false,
|
privateKey: privateKeyOrMnemonic,
|
||||||
});
|
encryption: false,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await localWalletInstance.import({
|
||||||
|
mnemonic: privateKeyOrMnemonic,
|
||||||
|
encryption: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error importing the wallet", err);
|
console.error("Error importing the wallet", err);
|
||||||
return null;
|
return null;
|
||||||
@@ -88,27 +99,29 @@ export const LocalWalletImportModal = ({
|
|||||||
setError(undefined);
|
setError(undefined);
|
||||||
setIsImporting(true);
|
setIsImporting(true);
|
||||||
|
|
||||||
let localWalletInstance = await createLocalWalletFromJsonFile();
|
setTimeout(async () => {
|
||||||
|
let localWalletInstance = await createLocalWalletFromJsonFile();
|
||||||
|
|
||||||
if (!localWalletInstance) {
|
if (!localWalletInstance) {
|
||||||
localWalletInstance = await createLocalWalletPK();
|
localWalletInstance = await createLocalWalletPK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!localWalletInstance) {
|
||||||
|
setError("Please, double check your password or private key.");
|
||||||
|
setIsImporting(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
localWalletInstance.save({
|
||||||
|
strategy: "privateKey",
|
||||||
|
encryption: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
onWalletImported(localWalletInstance);
|
||||||
|
|
||||||
if (!localWalletInstance) {
|
|
||||||
setError("Please, double check your password or private key.");
|
|
||||||
setIsImporting(false);
|
setIsImporting(false);
|
||||||
return;
|
onCloseInternal();
|
||||||
}
|
}, 0);
|
||||||
|
|
||||||
localWalletInstance.save({
|
|
||||||
strategy: "privateKey",
|
|
||||||
encryption: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
onWalletImported(localWalletInstance);
|
|
||||||
|
|
||||||
setIsImporting(false);
|
|
||||||
onCloseInternal();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCloseInternal = () => {
|
const onCloseInternal = () => {
|
||||||
@@ -139,7 +152,7 @@ export const LocalWalletImportModal = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onPrivateKeyEntered = (text: string) => {
|
const onPrivateKeyEntered = (text: string) => {
|
||||||
setPrivateKey(text);
|
setPrivateKeyOrMnemonic(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -180,11 +193,12 @@ export const LocalWalletImportModal = ({
|
|||||||
{error}
|
{error}
|
||||||
</Text>
|
</Text>
|
||||||
<Text variant="bodySmall" m="xs" textAlign="center">
|
<Text variant="bodySmall" m="xs" textAlign="center">
|
||||||
---- Or enter a private key ----
|
---- Or Private key or Mnemonic ----
|
||||||
</Text>
|
</Text>
|
||||||
<TextInput
|
<TextInput
|
||||||
secureTextEntry={true}
|
secureTextEntry={true}
|
||||||
placeholder={"Private key"}
|
placeholder={"Private key / Mnemonic"}
|
||||||
|
placeholderTextColor={theme.colors.textSecondary}
|
||||||
onChangeText={onPrivateKeyEntered}
|
onChangeText={onPrivateKeyEntered}
|
||||||
/>
|
/>
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { useModalState } from "../providers/ui-context-provider";
|
|||||||
import { ConnectWalletFlow } from "./ConnectWalletFlow/ConnectWalletFlow";
|
import { ConnectWalletFlow } from "./ConnectWalletFlow/ConnectWalletFlow";
|
||||||
import { Dimensions, StyleSheet, View } from "react-native";
|
import { Dimensions, StyleSheet, View } from "react-native";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { ConnectWalletDetailsModal } from "./ConnectWalletDetails/ConnectWalletDetailsModal";
|
|
||||||
import { CLOSE_MODAL_STATE } from "../utils/modalTypes";
|
import { CLOSE_MODAL_STATE } from "../utils/modalTypes";
|
||||||
import { ThemeProvider } from "../styles/ThemeProvider";
|
import { ThemeProvider } from "../styles/ThemeProvider";
|
||||||
import { useAppTheme } from "../styles/hooks";
|
import { useAppTheme } from "../styles/hooks";
|
||||||
@@ -24,8 +23,8 @@ export const MainModal = () => {
|
|||||||
switch (modalState?.view) {
|
switch (modalState?.view) {
|
||||||
case "ConnectWalletFlow":
|
case "ConnectWalletFlow":
|
||||||
return <ConnectWalletFlow />;
|
return <ConnectWalletFlow />;
|
||||||
case "WalletDetails":
|
// case "WalletDetails":
|
||||||
return <ConnectWalletDetailsModal />;
|
// return <ConnectWalletDetailsModal />;
|
||||||
case "WalletConnectSessionRequestModal":
|
case "WalletConnectSessionRequestModal":
|
||||||
return <SessionRequestModal />;
|
return <SessionRequestModal />;
|
||||||
case "WalletConnectSessionProposalModal":
|
case "WalletConnectSessionProposalModal":
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const IconTextButton = ({
|
|||||||
}: IconTextProps) => {
|
}: IconTextProps) => {
|
||||||
return (
|
return (
|
||||||
<BaseButton
|
<BaseButton
|
||||||
p={p || "md"}
|
p={p || "sm"}
|
||||||
backgroundColor="background"
|
backgroundColor="background"
|
||||||
style={styles.networkContainer}
|
style={styles.networkContainer}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { resolveIpfsUri } from "@thirdweb-dev/react-core";
|
import { useStorage } from "@thirdweb-dev/react-core";
|
||||||
|
import { useState } from "react";
|
||||||
import { Image } from "react-native";
|
import { Image } from "react-native";
|
||||||
import { SvgUri } from "react-native-svg";
|
import { SvgUri } from "react-native-svg";
|
||||||
|
|
||||||
@@ -13,21 +14,35 @@ const ImageSvgUri = ({
|
|||||||
height: number;
|
height: number;
|
||||||
imageAlt?: string;
|
imageAlt?: string;
|
||||||
}) => {
|
}) => {
|
||||||
const isSvg = imageUrl.toLowerCase().endsWith(".svg");
|
const storage = useStorage();
|
||||||
const resolvedImageUrl = resolveIpfsUri(imageUrl) || "";
|
const resolvedImageUrl = storage
|
||||||
|
? storage.resolveScheme(imageUrl)
|
||||||
|
: imageUrl.replace("ipfs://", "https://ipfs.io/ipfs/");
|
||||||
|
|
||||||
|
const [error, setError] = useState(false);
|
||||||
|
|
||||||
if (!resolvedImageUrl || resolvedImageUrl === "") {
|
if (!resolvedImageUrl || resolvedImageUrl === "") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSvg) {
|
if (error) {
|
||||||
return <SvgUri width={width} height={height} uri={resolvedImageUrl} />;
|
return (
|
||||||
|
<SvgUri
|
||||||
|
width={width}
|
||||||
|
height={height}
|
||||||
|
uri={resolvedImageUrl}
|
||||||
|
onError={() => setError(true)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// always try to render Image first, if error then try to render svg
|
||||||
|
// Image from RN handles onError better than SvgUri
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
alt={imageAlt}
|
alt={imageAlt}
|
||||||
source={{ uri: resolvedImageUrl }}
|
source={{ uri: resolvedImageUrl }}
|
||||||
style={[{ width: width, height: height }]}
|
style={[{ width: width, height: height }]}
|
||||||
|
onError={() => setError(true)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,37 @@
|
|||||||
import Box from "./Box";
|
import Box from "./Box";
|
||||||
import Text from "./Text";
|
import Text from "./Text";
|
||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
type LabelProps = {
|
type LabelProps = {
|
||||||
text: string;
|
text: string;
|
||||||
};
|
} & (typeof Text)["arguments"];
|
||||||
export const Label = ({ text }: LabelProps) => {
|
|
||||||
|
export const Label = ({ text, ...props }: LabelProps) => {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
flexDirection="row"
|
flexDirection="row"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
paddingVertical="xxs"
|
borderRadius="md"
|
||||||
paddingHorizontal="xs"
|
|
||||||
borderRadius="lg"
|
|
||||||
backgroundColor="labelBackground"
|
backgroundColor="labelBackground"
|
||||||
>
|
>
|
||||||
<Text variant="bodyLarge">{text}</Text>
|
<Text
|
||||||
|
variant="bodySmall"
|
||||||
|
style={{
|
||||||
|
...style.text,
|
||||||
|
...props,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{text}
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const style = StyleSheet.create({
|
||||||
|
text: {
|
||||||
|
textAlign: "center",
|
||||||
|
paddingVertical: 3,
|
||||||
|
paddingHorizontal: 8,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ export const ThirdwebProvider = <
|
|||||||
theme,
|
theme,
|
||||||
...restProps
|
...restProps
|
||||||
}: PropsWithChildren<ThirdwebProviderProps<TChains>>) => {
|
}: PropsWithChildren<ThirdwebProviderProps<TChains>>) => {
|
||||||
useCoinbaseWalletListener();
|
useCoinbaseWalletListener(
|
||||||
|
!!supportedWallets.find((w) => w.id === walletIds.coinbase),
|
||||||
|
);
|
||||||
|
|
||||||
const hasMagicConfig = useMemo(
|
const hasMagicConfig = useMemo(
|
||||||
() => !!supportedWallets.find((wc) => wc.id === walletIds.magicLink),
|
() => !!supportedWallets.find((wc) => wc.id === walletIds.magicLink),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { ThemeProviderProps } from "../styles/ThemeProvider";
|
|||||||
import { Theme, darkTheme, lightTheme } from "../styles/theme";
|
import { Theme, darkTheme, lightTheme } from "../styles/theme";
|
||||||
import { useAppTheme } from "../styles/hooks";
|
import { useAppTheme } from "../styles/hooks";
|
||||||
import { useTheme } from "@shopify/restyle";
|
import { useTheme } from "@shopify/restyle";
|
||||||
|
import { PropsWithChildren } from "react";
|
||||||
|
|
||||||
type UIContextType = {
|
type UIContextType = {
|
||||||
modalState: ModalState;
|
modalState: ModalState;
|
||||||
@@ -25,7 +26,7 @@ const UIContext = createContext<UIContextType>({
|
|||||||
setTheme: () => {},
|
setTheme: () => {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const UIContextProvider = (props: React.PropsWithChildren<{}>) => {
|
export const UIContextProvider = (props: PropsWithChildren<{}>) => {
|
||||||
const [modalState, setModalState] = useState<ModalState>({
|
const [modalState, setModalState] = useState<ModalState>({
|
||||||
view: "Closed",
|
view: "Closed",
|
||||||
data: {},
|
data: {},
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ import {
|
|||||||
WagmiConnector,
|
WagmiConnector,
|
||||||
} from "@thirdweb-dev/wallets";
|
} from "@thirdweb-dev/wallets";
|
||||||
import type { Address } from "abitype";
|
import type { Address } from "abitype";
|
||||||
import { providers } from "ethers";
|
import { providers, utils } from "ethers";
|
||||||
import { getAddress, hexValue } from "ethers/lib/utils.js";
|
|
||||||
|
|
||||||
export type CoinbaseWalletConnectorOptions = WalletMobileSDKProviderOptions &
|
export type CoinbaseWalletConnectorOptions = WalletMobileSDKProviderOptions &
|
||||||
ConfigurationParams & {
|
ConfigurationParams & {
|
||||||
@@ -130,7 +129,7 @@ export class CoinbaseWalletConnector extends WagmiConnector<
|
|||||||
throw new Error("No accounts found");
|
throw new Error("No accounts found");
|
||||||
}
|
}
|
||||||
// return checksum address
|
// return checksum address
|
||||||
return getAddress(accounts[0] as string);
|
return utils.getAddress(accounts[0] as string);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChainId() {
|
async getChainId() {
|
||||||
@@ -193,7 +192,7 @@ export class CoinbaseWalletConnector extends WagmiConnector<
|
|||||||
|
|
||||||
async switchChain(chainId: number): Promise<Chain> {
|
async switchChain(chainId: number): Promise<Chain> {
|
||||||
const provider = await this.getProvider();
|
const provider = await this.getProvider();
|
||||||
const id = hexValue(chainId);
|
const id = utils.hexValue(chainId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await provider.request({
|
await provider.request({
|
||||||
@@ -279,7 +278,7 @@ export class CoinbaseWalletConnector extends WagmiConnector<
|
|||||||
if (accounts.length === 0) {
|
if (accounts.length === 0) {
|
||||||
this.emit("disconnect");
|
this.emit("disconnect");
|
||||||
} else {
|
} else {
|
||||||
this.emit("change", { account: getAddress(accounts[0] as string) });
|
this.emit("change", { account: utils.getAddress(accounts[0] as string) });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { useCoinbaseWalletListener } from "./useCoinbaseWalletListener";
|
|||||||
*/
|
*/
|
||||||
export function useCoinbaseWallet(callbackURL: string) {
|
export function useCoinbaseWallet(callbackURL: string) {
|
||||||
const connect = useConnect();
|
const connect = useConnect();
|
||||||
useCoinbaseWalletListener();
|
useCoinbaseWalletListener(true);
|
||||||
|
|
||||||
return useCallback(
|
return useCallback(
|
||||||
async (connectOptions?: { chainId?: number; callbackURL: string }) => {
|
async (connectOptions?: { chainId?: number; callbackURL: string }) => {
|
||||||
|
|||||||
@@ -7,12 +7,16 @@ import { Linking } from "react-native";
|
|||||||
*
|
*
|
||||||
* This hook sets up the UniversalLinks listener.
|
* This hook sets up the UniversalLinks listener.
|
||||||
*/
|
*/
|
||||||
export function useCoinbaseWalletListener() {
|
export function useCoinbaseWalletListener(enable: boolean) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!enable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const sub = Linking.addEventListener("url", ({ url }) => {
|
const sub = Linking.addEventListener("url", ({ url }) => {
|
||||||
// @ts-ignore - Passing a URL object to handleResponse crashes the function
|
// @ts-ignore - Passing a URL object to handleResponse crashes the function
|
||||||
handleResponse(url);
|
handleResponse(url);
|
||||||
});
|
});
|
||||||
return () => sub?.remove();
|
return () => sub?.remove();
|
||||||
}, []);
|
}, [enable]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export class RainbowWallet extends WalletConnectV2 {
|
|||||||
static meta = {
|
static meta = {
|
||||||
name: "Rainbow",
|
name: "Rainbow",
|
||||||
iconURL:
|
iconURL:
|
||||||
"https://registry.walletconnect.org/v2/logo/md/7a33d7f1-3d12-4b5c-f3ee-5cd83cb1b500",
|
"ipfs://QmSZn47p4DVVBfzvg9BAX2EqwnPxkT1YAE7rUnrtd9CybQ/rainbow-logo.png",
|
||||||
links: {
|
links: {
|
||||||
native: "rainbow:",
|
native: "rainbow:",
|
||||||
universal: "https://rnbwapp.com",
|
universal: "https://rnbwapp.com",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export class TrustWallet extends WalletConnectV2 {
|
|||||||
static meta = {
|
static meta = {
|
||||||
name: "Trust Wallet",
|
name: "Trust Wallet",
|
||||||
iconURL:
|
iconURL:
|
||||||
"https://registry.walletconnect.org/v2/logo/md/0528ee7e-16d1-4089-21e3-bbfb41933100",
|
"ipfs://QmNigQbXk7wKZwDcgN38Znj1ZZQ3JEG3DD6fUKLBU8SUTP/trust%20wallet.svg",
|
||||||
links: {
|
links: {
|
||||||
native: "trust:",
|
native: "trust:",
|
||||||
universal: "https://link.trustwallet.com",
|
universal: "https://link.trustwallet.com",
|
||||||
|
|||||||
@@ -1,5 +1,63 @@
|
|||||||
# @thirdweb-dev/react
|
# @thirdweb-dev/react
|
||||||
|
|
||||||
|
## 3.14.9
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1309](https://github.com/thirdweb-dev/js/pull/1309) [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352) Thanks [@jnsdls](https://github.com/jnsdls)! - unblock storage domains
|
||||||
|
|
||||||
|
- Updated dependencies [[`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5), [`72ada475`](https://github.com/thirdweb-dev/js/commit/72ada47596d5d5c08736c33215faeec636b7156a), [`2c0bb078`](https://github.com/thirdweb-dev/js/commit/2c0bb0789955f6cd397b6fdb8e990a505251c631), [`b5c6eedb`](https://github.com/thirdweb-dev/js/commit/b5c6eedb38aa3c52eb97f3d25ad83e38c55afe61), [`10b3a717`](https://github.com/thirdweb-dev/js/commit/10b3a717da606632a05769ac821bdd21d6b63a03), [`b4aee9b5`](https://github.com/thirdweb-dev/js/commit/b4aee9b59121bab5f9b3d9b7ecdc4bcb4cd66f58), [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.28
|
||||||
|
- @thirdweb-dev/sdk@3.10.29
|
||||||
|
- @thirdweb-dev/wallets@1.0.5
|
||||||
|
- @thirdweb-dev/react-core@3.14.9
|
||||||
|
|
||||||
|
## 3.14.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1282](https://github.com/thirdweb-dev/js/pull/1282) [`7054f9f0`](https://github.com/thirdweb-dev/js/commit/7054f9f01691e1c942ffbec3ee8042218aadd126) Thanks [@kien-ngo](https://github.com/kien-ngo)! - Fix issue #1201 - MediaRenderer HTML MimeType
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
- Updated dependencies [[`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2), [`a3bb17cb`](https://github.com/thirdweb-dev/js/commit/a3bb17cb33f033846fb3b4c8a0a4809ba76cab96)]:
|
||||||
|
- @thirdweb-dev/react-core@3.14.8
|
||||||
|
- @thirdweb-dev/wallets@1.0.4
|
||||||
|
- @thirdweb-dev/chains@0.1.27
|
||||||
|
- @thirdweb-dev/sdk@3.10.28
|
||||||
|
|
||||||
|
## 3.14.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1210](https://github.com/thirdweb-dev/js/pull/1210) [`d794b8f9`](https://github.com/thirdweb-dev/js/commit/d794b8f9f41dbd7e461ef07d0808c5b6d2f85515) Thanks [@konojunya](https://github.com/konojunya)! - Add zerion to useInstalledWallets
|
||||||
|
|
||||||
|
- [#1269](https://github.com/thirdweb-dev/js/pull/1269) [`998e5217`](https://github.com/thirdweb-dev/js/commit/998e521733efd6a67e42f9bf0beab5fbdccf08ae) Thanks [@MananTank](https://github.com/MananTank)! - - Expose `advancedOptions` and `styles` for paper wallet
|
||||||
|
- Allow using "+" in paper email
|
||||||
|
- Allow using "+" in magic email
|
||||||
|
- Update Paper SDK version
|
||||||
|
- Updated dependencies [[`2b113539`](https://github.com/thirdweb-dev/js/commit/2b113539098384f910b3c4d54e1fde9d35a6f053), [`c9535715`](https://github.com/thirdweb-dev/js/commit/c95357158819abd42d4b0900ecc2fa40fcb957f8), [`be606dd3`](https://github.com/thirdweb-dev/js/commit/be606dd3c93c1514834c1d970e864d7f949a07ab), [`edcd22d6`](https://github.com/thirdweb-dev/js/commit/edcd22d61236edb2832f9b2f9796e891d58cb145), [`5882091e`](https://github.com/thirdweb-dev/js/commit/5882091eab65978009a5a5305701f121851b10ad), [`998e5217`](https://github.com/thirdweb-dev/js/commit/998e521733efd6a67e42f9bf0beab5fbdccf08ae)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.3
|
||||||
|
- @thirdweb-dev/sdk@3.10.27
|
||||||
|
- @thirdweb-dev/react-core@3.14.7
|
||||||
|
- @thirdweb-dev/chains@0.1.26
|
||||||
|
|
||||||
|
## 3.14.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`ed711c8c`](https://github.com/thirdweb-dev/js/commit/ed711c8cb2ed6a0deb1b2a5eeec06df1d4edc5e8), [`05a7495a`](https://github.com/thirdweb-dev/js/commit/05a7495a132aabab5f48abbdb80a468ff6f65df8), [`e78da6b3`](https://github.com/thirdweb-dev/js/commit/e78da6b36cfa6d954234820563201bf760186ed1)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.2
|
||||||
|
- @thirdweb-dev/react-core@3.14.6
|
||||||
|
|
||||||
|
## 3.14.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`efb3546e`](https://github.com/thirdweb-dev/js/commit/efb3546ec8268156be00301af28b9d83ecd5ab08)]:
|
||||||
|
- @thirdweb-dev/wallets@1.0.1
|
||||||
|
- @thirdweb-dev/react-core@3.14.5
|
||||||
|
|
||||||
## 3.14.4
|
## 3.14.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
+28
-28
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react",
|
"name": "@thirdweb-dev/react",
|
||||||
"version": "3.14.4",
|
"version": "3.14.9",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -81,15 +81,15 @@
|
|||||||
},
|
},
|
||||||
"sideEffects:": false,
|
"sideEffects:": false,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.19.3",
|
"@babel/core": "^7.22.5",
|
||||||
"@babel/preset-env": "^7.18.10",
|
"@babel/preset-env": "^7.22.5",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.22.5",
|
||||||
"@babel/preset-typescript": "^7.18.6",
|
"@babel/preset-typescript": "^7.22.5",
|
||||||
"@babel/runtime": "^7.19.0",
|
"@babel/runtime": "^7.22.5",
|
||||||
"@microsoft/api-documenter": "^7.19.4",
|
"@microsoft/api-documenter": "^7.22.21",
|
||||||
"@microsoft/api-extractor": "^7.29.2",
|
"@microsoft/api-extractor": "^7.36.0",
|
||||||
"@microsoft/tsdoc": "^0.14.1",
|
"@microsoft/tsdoc": "^0.14.1",
|
||||||
"@preconstruct/cli": "^2.2.1",
|
"@preconstruct/cli": "^2.7.0",
|
||||||
"@solana/wallet-adapter-base": "^0.9.17",
|
"@solana/wallet-adapter-base": "^0.9.17",
|
||||||
"@solana/wallet-adapter-phantom": "^0.9.17",
|
"@solana/wallet-adapter-phantom": "^0.9.17",
|
||||||
"@solana/wallet-adapter-react": "^0.15.19",
|
"@solana/wallet-adapter-react": "^0.15.19",
|
||||||
@@ -99,13 +99,13 @@
|
|||||||
"@thirdweb-dev/sdk": "workspace:*",
|
"@thirdweb-dev/sdk": "workspace:*",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"@types/color": "^3.0.3",
|
"@types/color": "^3.0.3",
|
||||||
"@types/react": "^18.0.5",
|
"@types/react": "^18.2.14",
|
||||||
"@types/react-dom": "^18.0.6",
|
"@types/react-dom": "^18.2.6",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||||
"@typescript-eslint/parser": "^5.33.0",
|
"@typescript-eslint/parser": "^5.60.1",
|
||||||
"eslint": "^8.42.0",
|
"eslint": "^8.43.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"eslint-plugin-better-tree-shaking": "0.0.3",
|
"eslint-plugin-better-tree-shaking": "0.0.3",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
@@ -113,25 +113,25 @@
|
|||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"eslint-plugin-tsdoc": "^0.2.16",
|
"eslint-plugin-tsdoc": "^0.2.16",
|
||||||
"ethers": "^5.7.2",
|
"ethers": "^5.7.2",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.8",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"stream": "npm:stream-browserify@^3.0.0",
|
"stream": "npm:stream-browserify@^3.0.0",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.10.0",
|
"@emotion/react": "^11.11.1",
|
||||||
"@emotion/styled": "^11.10.0",
|
"@emotion/styled": "^11.11.0",
|
||||||
"@google/model-viewer": "^2.1.1",
|
"@google/model-viewer": "^2.1.1",
|
||||||
"@radix-ui/colors": "^0.1.8",
|
"@radix-ui/colors": "^0.1.9",
|
||||||
"@radix-ui/react-dialog": "^1.0.2",
|
"@radix-ui/react-dialog": "^1.0.4",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.2",
|
"@radix-ui/react-dropdown-menu": "^2.0.5",
|
||||||
"@radix-ui/react-icons": "^1.1.1",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"@radix-ui/react-popover": "^1.0.5",
|
"@radix-ui/react-popover": "^1.0.6",
|
||||||
"@radix-ui/react-tabs": "^1.0.2",
|
"@radix-ui/react-tabs": "^1.0.4",
|
||||||
"@radix-ui/react-tooltip": "^1.0.4",
|
"@radix-ui/react-tooltip": "^1.0.6",
|
||||||
"@react-icons/all-files": "^4.1.0",
|
"@react-icons/all-files": "^4.1.0",
|
||||||
"@tanstack/react-query": "^4.0.10",
|
"@tanstack/react-query": "^4.29.19",
|
||||||
"@thirdweb-dev/chains": "workspace:*",
|
"@thirdweb-dev/chains": "workspace:*",
|
||||||
"@thirdweb-dev/react-core": "workspace:*",
|
"@thirdweb-dev/react-core": "workspace:*",
|
||||||
"@thirdweb-dev/wallets": "workspace:*",
|
"@thirdweb-dev/wallets": "workspace:*",
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import type { Theme } from "../design-system";
|
import type { Theme } from "../design-system";
|
||||||
import styled from "@emotion/styled";
|
import styled from "@emotion/styled";
|
||||||
import { Chain } from "@thirdweb-dev/chains";
|
import { Chain } from "@thirdweb-dev/chains";
|
||||||
import { resolveIpfsUri } from "@thirdweb-dev/react-core";
|
import { useStorage } from "@thirdweb-dev/react-core";
|
||||||
|
|
||||||
const defaultChainIcon = /* @__PURE__ */ resolveIpfsUri(
|
const defaultChainIcon =
|
||||||
"ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
"ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png";
|
||||||
);
|
|
||||||
|
|
||||||
export const ChainIcon: React.FC<{
|
export const ChainIcon: React.FC<{
|
||||||
chain?: Chain;
|
chain?: Chain;
|
||||||
@@ -14,8 +13,12 @@ export const ChainIcon: React.FC<{
|
|||||||
className?: string;
|
className?: string;
|
||||||
loading?: "lazy" | "eager";
|
loading?: "lazy" | "eager";
|
||||||
}> = (props) => {
|
}> = (props) => {
|
||||||
const url = props.chain?.icon?.url;
|
const url = props.chain?.icon?.url || defaultChainIcon;
|
||||||
const src = url ? resolveIpfsUri(url) : defaultChainIcon;
|
const storage = useStorage();
|
||||||
|
|
||||||
|
const src = storage
|
||||||
|
? storage.resolveScheme(url)
|
||||||
|
: url.replace("ipfs://", "https://ipfs.io/ipfs/");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { resolveIpfsUri } from "@thirdweb-dev/react-core";
|
import { useStorage } from "@thirdweb-dev/react-core";
|
||||||
|
|
||||||
export const Img: React.FC<{
|
export const Img: React.FC<{
|
||||||
width: string;
|
width: string;
|
||||||
@@ -8,11 +8,16 @@ export const Img: React.FC<{
|
|||||||
loading?: "eager" | "lazy";
|
loading?: "eager" | "lazy";
|
||||||
className?: string;
|
className?: string;
|
||||||
}> = (props) => {
|
}> = (props) => {
|
||||||
|
const storage = useStorage();
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
width={props.width}
|
width={props.width}
|
||||||
height={props.height}
|
height={props.height}
|
||||||
src={resolveIpfsUri(props.src)}
|
src={
|
||||||
|
storage
|
||||||
|
? storage.resolveScheme(props.src)
|
||||||
|
: props.src.replace("ipfs://", "https://ipfs.io/ipfs/")
|
||||||
|
}
|
||||||
alt={props.alt || ""}
|
alt={props.alt || ""}
|
||||||
loading={props.loading}
|
loading={props.loading}
|
||||||
decoding="async"
|
decoding="async"
|
||||||
|
|||||||
@@ -7,11 +7,7 @@ import {
|
|||||||
CarbonPlayFilledAlt,
|
CarbonPlayFilledAlt,
|
||||||
} from "./Icons";
|
} from "./Icons";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import { resolveMimeType, useStorage } from "@thirdweb-dev/react-core";
|
||||||
resolveIpfsUri,
|
|
||||||
resolveMimeType,
|
|
||||||
useStorage,
|
|
||||||
} from "@thirdweb-dev/react-core";
|
|
||||||
import React, {
|
import React, {
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
@@ -431,7 +427,7 @@ export const MediaRenderer = /* @__PURE__ */ React.forwardRef<
|
|||||||
alt={alt}
|
alt={alt}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else if (videoOrImageSrc.mimeType === "text/html") {
|
} else if (videoOrImageSrc.mimeType.startsWith("text/html")) {
|
||||||
return (
|
return (
|
||||||
<IframePlayer
|
<IframePlayer
|
||||||
style={mergedStyle}
|
style={mergedStyle}
|
||||||
@@ -547,18 +543,19 @@ export function useResolvedMediaType(
|
|||||||
) {
|
) {
|
||||||
const storage = useStorage();
|
const storage = useStorage();
|
||||||
|
|
||||||
const resolvedUrl = useMemo(
|
const resolvedUrl = useMemo(() => {
|
||||||
() =>
|
if (!uri) {
|
||||||
resolveIpfsUri(
|
return "";
|
||||||
uri,
|
}
|
||||||
gatewayUrl
|
if (gatewayUrl) {
|
||||||
? { gatewayUrl }
|
return uri.replace("ipfs://", gatewayUrl);
|
||||||
: storage
|
}
|
||||||
? { gatewayUrl: storage.gatewayUrls["ipfs://"][0] }
|
if (storage) {
|
||||||
: undefined,
|
return storage.resolveScheme(uri);
|
||||||
),
|
}
|
||||||
[uri, storage, gatewayUrl],
|
return uri.replace("ipfs://", "https://ipfs.io/ipfs/");
|
||||||
);
|
}, [uri, storage, gatewayUrl]);
|
||||||
|
|
||||||
const resolvedMimType = useQuery(
|
const resolvedMimType = useQuery(
|
||||||
["mime-type", resolvedUrl],
|
["mime-type", resolvedUrl],
|
||||||
() => resolveMimeType(resolvedUrl),
|
() => resolveMimeType(resolvedUrl),
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { useConnect, useWallet } from "@thirdweb-dev/react-core";
|
import { useConnect, useWallet } from "@thirdweb-dev/react-core";
|
||||||
import { PaperWallet, walletIds } from "@thirdweb-dev/wallets";
|
import {
|
||||||
|
PaperWallet,
|
||||||
|
walletIds,
|
||||||
|
PaperWalletAdditionalOptions,
|
||||||
|
} from "@thirdweb-dev/wallets";
|
||||||
import { useCallback, useEffect } from "react";
|
import { useCallback, useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
useQuery,
|
useQuery,
|
||||||
@@ -7,10 +11,12 @@ import {
|
|||||||
useQueryClient,
|
useQueryClient,
|
||||||
} from "@tanstack/react-query";
|
} from "@tanstack/react-query";
|
||||||
|
|
||||||
|
type PaperConfig = Omit<PaperWalletAdditionalOptions, "chain" | "chains">;
|
||||||
|
|
||||||
export function usePaperWallet() {
|
export function usePaperWallet() {
|
||||||
const connect = useConnect();
|
const connect = useConnect();
|
||||||
return useCallback(
|
return useCallback(
|
||||||
async (options: { chainId?: number; clientId: string; email?: string }) => {
|
async (options: { chainId?: number; email?: string } & PaperConfig) => {
|
||||||
const { paperWallet } = await import(
|
const { paperWallet } = await import(
|
||||||
"../../../wallet/wallets/paperWallet"
|
"../../../wallet/wallets/paperWallet"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,22 +3,23 @@ import { assertWindowEthereum } from "@thirdweb-dev/wallets";
|
|||||||
export function useInstalledWallets() {
|
export function useInstalledWallets() {
|
||||||
let isMetamaskInstalled = false;
|
let isMetamaskInstalled = false;
|
||||||
let isCoinbaseWalletInstalled = false;
|
let isCoinbaseWalletInstalled = false;
|
||||||
let isTrustWalletInstalled: boolean | undefined = false;
|
let isZerionWalletInstalled = false;
|
||||||
|
let isTrustWalletInstalled = false;
|
||||||
|
|
||||||
if (assertWindowEthereum(globalThis.window)) {
|
const window_: Window | undefined = globalThis?.window;
|
||||||
isMetamaskInstalled = globalThis.window.ethereum?.isMetaMask;
|
if (assertWindowEthereum(window_)) {
|
||||||
|
isMetamaskInstalled = !!window_.ethereum?.isMetaMask;
|
||||||
isCoinbaseWalletInstalled =
|
isCoinbaseWalletInstalled =
|
||||||
globalThis.window.ethereum?.isCoinbaseWallet ||
|
!!window_.ethereum?.isCoinbaseWallet ||
|
||||||
globalThis.window.ethereum?.providers?.some((p) => p.isCoinbaseWallet) ||
|
!!window_.ethereum?.providers?.some((p) => p.isCoinbaseWallet);
|
||||||
false;
|
isZerionWalletInstalled = !!window_.ethereum?.isZerion;
|
||||||
isTrustWalletInstalled = globalThis.window.ethereum?.isTrust;
|
isTrustWalletInstalled = !!window_.ethereum?.isTrust;
|
||||||
}
|
}
|
||||||
|
|
||||||
const installedWallets = {
|
return {
|
||||||
metamask: !!isMetamaskInstalled,
|
metamask: isMetamaskInstalled,
|
||||||
coinbaseWallet: !!isCoinbaseWalletInstalled,
|
coinbaseWallet: isCoinbaseWalletInstalled,
|
||||||
trustWallet: !!isTrustWalletInstalled,
|
trustWallet: isTrustWalletInstalled,
|
||||||
|
zerionWallet: isZerionWalletInstalled,
|
||||||
};
|
};
|
||||||
|
|
||||||
return installedWallets;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,12 +21,11 @@ export const coinbaseWallet = (): WalletConfig<CoinbaseWallet> => {
|
|||||||
},
|
},
|
||||||
connectUI: CoinbaseConnectUI,
|
connectUI: CoinbaseConnectUI,
|
||||||
isInstalled() {
|
isInstalled() {
|
||||||
if (assertWindowEthereum(globalThis.window)) {
|
const window_: Window | undefined = globalThis?.window;
|
||||||
|
if (assertWindowEthereum(window_)) {
|
||||||
return (
|
return (
|
||||||
globalThis.window.ethereum?.isCoinbaseWallet ||
|
window_.ethereum?.isCoinbaseWallet ||
|
||||||
globalThis.window.ethereum?.providers?.some(
|
window_.ethereum?.providers?.some((p) => p.isCoinbaseWallet) ||
|
||||||
(p) => p.isCoinbaseWallet,
|
|
||||||
) ||
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,10 +19,11 @@ export const frameWallet = (): WalletConfig<FrameWallet> => ({
|
|||||||
},
|
},
|
||||||
connectUI: FrameConnectUI,
|
connectUI: FrameConnectUI,
|
||||||
isInstalled() {
|
isInstalled() {
|
||||||
if (assertWindowEthereum(globalThis.window)) {
|
const window_: Window | undefined = globalThis?.window;
|
||||||
|
if (assertWindowEthereum(window_)) {
|
||||||
return (
|
return (
|
||||||
globalThis.window.ethereum?.isFrame ||
|
window_.ethereum?.isFrame ||
|
||||||
globalThis.window.ethereum?.providers?.some((p) => p.isFrame) ||
|
window_.ethereum?.providers?.some((p) => p.isFrame) ||
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const MagicSelectionUI: React.FC<
|
|||||||
|
|
||||||
if (isEmail && isEmailEnabled) {
|
if (isEmail && isEmailEnabled) {
|
||||||
const emailRegex = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,})$/g;
|
const emailRegex = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,})$/g;
|
||||||
const isValidEmail = emailRegex.test(input);
|
const isValidEmail = emailRegex.test(input.replace(/\+/g, ""));
|
||||||
if (!isValidEmail) {
|
if (!isValidEmail) {
|
||||||
return "Invalid email address";
|
return "Invalid email address";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
import { PaperWallet } from "@thirdweb-dev/wallets";
|
import {
|
||||||
|
PaperWallet,
|
||||||
|
PaperWalletAdditionalOptions,
|
||||||
|
} from "@thirdweb-dev/wallets";
|
||||||
import {
|
import {
|
||||||
WalletConfig,
|
WalletConfig,
|
||||||
WalletOptions,
|
WalletOptions,
|
||||||
@@ -11,7 +14,7 @@ import { Spinner } from "../../components/Spinner";
|
|||||||
import { Flex } from "../../components/basic";
|
import { Flex } from "../../components/basic";
|
||||||
import { InputSelectionUI } from "./InputSelectionUI";
|
import { InputSelectionUI } from "./InputSelectionUI";
|
||||||
|
|
||||||
type PaperConfig = { clientId: string };
|
type PaperConfig = Omit<PaperWalletAdditionalOptions, "chain" | "chains">;
|
||||||
|
|
||||||
export const paperWallet = (config: PaperConfig): WalletConfig<PaperWallet> => {
|
export const paperWallet = (config: PaperConfig): WalletConfig<PaperWallet> => {
|
||||||
return {
|
return {
|
||||||
@@ -32,7 +35,8 @@ const PaperSelectionUI: React.FC<SelectUIProps<PaperWallet>> = (props) => {
|
|||||||
placeholder="Enter your email address"
|
placeholder="Enter your email address"
|
||||||
name="email"
|
name="email"
|
||||||
type="email"
|
type="email"
|
||||||
errorMessage={(input) => {
|
errorMessage={(_input) => {
|
||||||
|
const input = _input.replace(/\+/g, "");
|
||||||
const emailRegex = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,})$/g;
|
const emailRegex = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,})$/g;
|
||||||
const isValidEmail = emailRegex.test(input);
|
const isValidEmail = emailRegex.test(input);
|
||||||
if (!isValidEmail) {
|
if (!isValidEmail) {
|
||||||
|
|||||||
@@ -1,5 +1,44 @@
|
|||||||
# @thirdweb-dev/sdk
|
# @thirdweb-dev/sdk
|
||||||
|
|
||||||
|
## 3.10.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1299](https://github.com/thirdweb-dev/js/pull/1299) [`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5) Thanks [@nkrishang](https://github.com/nkrishang)! - Add ERC721LoyaltyCard and ERC721UpdatableMetadata
|
||||||
|
|
||||||
|
- [#1298](https://github.com/thirdweb-dev/js/pull/1298) [`72ada475`](https://github.com/thirdweb-dev/js/commit/72ada47596d5d5c08736c33215faeec636b7156a) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Proper types for contract.metadata.get() for custom contracts
|
||||||
|
|
||||||
|
- [#1304](https://github.com/thirdweb-dev/js/pull/1304) [`2c0bb078`](https://github.com/thirdweb-dev/js/commit/2c0bb0789955f6cd397b6fdb8e990a505251c631) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Fix pack code snippets
|
||||||
|
|
||||||
|
- Updated dependencies [[`7e044c66`](https://github.com/thirdweb-dev/js/commit/7e044c664d8a034f5324b859ac3596860c86f9a5), [`b5c6eedb`](https://github.com/thirdweb-dev/js/commit/b5c6eedb38aa3c52eb97f3d25ad83e38c55afe61), [`4961b597`](https://github.com/thirdweb-dev/js/commit/4961b597a098dae0a4eff01a9ef268a65fe1a352)]:
|
||||||
|
- @thirdweb-dev/contracts-js@1.3.9
|
||||||
|
- @thirdweb-dev/chains@0.1.28
|
||||||
|
- @thirdweb-dev/storage@1.1.7
|
||||||
|
|
||||||
|
## 3.10.28
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1278](https://github.com/thirdweb-dev/js/pull/1278) [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2) Thanks [@jnsdls](https://github.com/jnsdls)! - updated various dependencies
|
||||||
|
|
||||||
|
- [#1281](https://github.com/thirdweb-dev/js/pull/1281) [`a3bb17cb`](https://github.com/thirdweb-dev/js/commit/a3bb17cb33f033846fb3b4c8a0a4809ba76cab96) Thanks [@nkrishang](https://github.com/nkrishang)! - Handle ERC4337Signer correctly for signTypedData
|
||||||
|
|
||||||
|
- Updated dependencies [[`2d088d36`](https://github.com/thirdweb-dev/js/commit/2d088d367ca54233836dc69712fd411ab7924205), [`8a389f12`](https://github.com/thirdweb-dev/js/commit/8a389f1295d2bf726059997ea0ca10cf0424f2a2), [`9daf0449`](https://github.com/thirdweb-dev/js/commit/9daf044926bf995ac8998929dbeca548c5eb8561), [`546353a4`](https://github.com/thirdweb-dev/js/commit/546353a479c11533818ef917c0f6b4d6f8f69872), [`a3bb17cb`](https://github.com/thirdweb-dev/js/commit/a3bb17cb33f033846fb3b4c8a0a4809ba76cab96), [`0135a779`](https://github.com/thirdweb-dev/js/commit/0135a7790cf2acde6b701cb41ea10dd311da5ec3)]:
|
||||||
|
- @thirdweb-dev/storage@1.1.6
|
||||||
|
- @thirdweb-dev/contracts-js@1.3.8
|
||||||
|
- @thirdweb-dev/chains@0.1.27
|
||||||
|
|
||||||
|
## 3.10.27
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1277](https://github.com/thirdweb-dev/js/pull/1277) [`2b113539`](https://github.com/thirdweb-dev/js/commit/2b113539098384f910b3c4d54e1fde9d35a6f053) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - remove ethers/lib/utils dependency
|
||||||
|
|
||||||
|
- [#1271](https://github.com/thirdweb-dev/js/pull/1271) [`c9535715`](https://github.com/thirdweb-dev/js/commit/c95357158819abd42d4b0900ecc2fa40fcb957f8) Thanks [@nkrishang](https://github.com/nkrishang)! - Rename smart wallets to account
|
||||||
|
|
||||||
|
- Updated dependencies [[`5882091e`](https://github.com/thirdweb-dev/js/commit/5882091eab65978009a5a5305701f121851b10ad)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.26
|
||||||
|
|
||||||
## 3.10.26
|
## 3.10.26
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
+22
-22
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/sdk",
|
"name": "@thirdweb-dev/sdk",
|
||||||
"version": "3.10.26",
|
"version": "3.10.29",
|
||||||
"description": "The main thirdweb SDK.",
|
"description": "The main thirdweb SDK.",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -97,35 +97,35 @@
|
|||||||
"push": "yalc push"
|
"push": "yalc push"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@aws-sdk/client-secrets-manager": "^3.256.0",
|
"@aws-sdk/client-secrets-manager": "^3.363.0",
|
||||||
"@ethersproject/abstract-provider": "^5.7.0",
|
"@ethersproject/abstract-provider": "^5.7.0",
|
||||||
"@metaplex-foundation/amman": "^0.12.1",
|
"@metaplex-foundation/amman": "^0.12.1",
|
||||||
"@metaplex-foundation/amman-client": "^0.2.4",
|
"@metaplex-foundation/amman-client": "^0.2.4",
|
||||||
"@metaplex-foundation/js": "^0.19.2",
|
"@metaplex-foundation/js": "^0.19.2",
|
||||||
"@metaplex-foundation/mpl-token-metadata": "^2.11",
|
"@metaplex-foundation/mpl-token-metadata": "^2.12.0",
|
||||||
"@microsoft/api-documenter": "^7.19.4",
|
"@microsoft/api-documenter": "^7.22.21",
|
||||||
"@microsoft/api-extractor": "^7.29.2",
|
"@microsoft/api-extractor": "^7.36.0",
|
||||||
"@microsoft/tsdoc": "^0.14.1",
|
"@microsoft/tsdoc": "^0.14.1",
|
||||||
"@nomiclabs/hardhat-ethers": "^2.0.5",
|
"@nomiclabs/hardhat-ethers": "^2.2.3",
|
||||||
"@preconstruct/cli": "^2.2.1",
|
"@preconstruct/cli": "^2.7.0",
|
||||||
"@project-serum/anchor": "^0.25.0",
|
"@project-serum/anchor": "^0.25.0",
|
||||||
"@solana/spl-token": "^0.3.5",
|
"@solana/spl-token": "^0.3.5",
|
||||||
"@solana/web3.js": "^1.62.0",
|
"@solana/web3.js": "^1.62.0",
|
||||||
"@swc-node/register": "^1.5.1",
|
"@swc-node/register": "^1.6.6",
|
||||||
"@swc/core": "^1.3.23",
|
"@swc/core": "^1.3.67",
|
||||||
"@thirdweb-dev/tsconfig": "workspace:*",
|
"@thirdweb-dev/tsconfig": "workspace:*",
|
||||||
"@types/bn.js": "^5.1.1",
|
"@types/bn.js": "^5.1.1",
|
||||||
"@types/chai": "^4.3.3",
|
"@types/chai": "^4.3.5",
|
||||||
"@types/deep-equal-in-any-order": "^1.0.1",
|
"@types/deep-equal-in-any-order": "^1.0.1",
|
||||||
"@types/mocha": "^10.0.0",
|
"@types/mocha": "^10.0.0",
|
||||||
"@types/node": "^18.0.0",
|
"@types/node": "^18.16.18",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||||
"@typescript-eslint/parser": "^5.33.0",
|
"@typescript-eslint/parser": "^5.60.1",
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.6",
|
||||||
"deep-equal-in-any-order": "^1.1.18",
|
"deep-equal-in-any-order": "^1.1.18",
|
||||||
"eslint": "^8.42.0",
|
"eslint": "^8.43.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.8.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
"eslint-plugin-better-tree-shaking": "0.0.3",
|
"eslint-plugin-better-tree-shaking": "0.0.3",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
@@ -134,11 +134,11 @@
|
|||||||
"eslint-plugin-tsdoc": "^0.2.16",
|
"eslint-plugin-tsdoc": "^0.2.16",
|
||||||
"ethers": "^5.7.2",
|
"ethers": "^5.7.2",
|
||||||
"ethers-aws-kms-signer": "^1.3.2",
|
"ethers-aws-kms-signer": "^1.3.2",
|
||||||
"hardhat": "^2.9.3",
|
"hardhat": "^2.16.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.8",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^5.1.6",
|
||||||
"zksync-web3": "^0.14.3"
|
"zksync-web3": "^0.14.3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@@ -187,14 +187,14 @@
|
|||||||
"bn.js": "^5.2.1",
|
"bn.js": "^5.2.1",
|
||||||
"bs58": "^5.0.0",
|
"bs58": "^5.0.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"cross-fetch": "^3.1.5",
|
"cross-fetch": "^3.1.6",
|
||||||
"eventemitter3": "^5.0.0",
|
"eventemitter3": "^5.0.1",
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"merkletreejs": "^0.2.24",
|
"merkletreejs": "^0.2.24",
|
||||||
"tiny-invariant": "^1.2.0",
|
"tiny-invariant": "^1.2.0",
|
||||||
"tweetnacl": "^1.0.3",
|
"tweetnacl": "^1.0.3",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
"yaml": "^2.1.1",
|
"yaml": "^2.3.1",
|
||||||
"zod": "^3.20.2"
|
"zod": "^3.20.2"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { BigNumber, providers, constants } from "ethers";
|
import { BigNumber, providers, constants, utils } from "ethers";
|
||||||
import { isAddress } from "ethers/lib/utils";
|
|
||||||
import { extractIPFSHashFromBytecode } from "./extractIPFSHashFromBytecode";
|
import { extractIPFSHashFromBytecode } from "./extractIPFSHashFromBytecode";
|
||||||
import { extractMinimalProxyImplementationAddress } from "./extractMinimalProxyImplementationAddress";
|
import { extractMinimalProxyImplementationAddress } from "./extractMinimalProxyImplementationAddress";
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ export async function resolveContractUriFromAddress(
|
|||||||
);
|
);
|
||||||
const implementationAddress = `0x${proxyStorage.slice(-40)}`;
|
const implementationAddress = `0x${proxyStorage.slice(-40)}`;
|
||||||
if (
|
if (
|
||||||
isAddress(implementationAddress) &&
|
utils.isAddress(implementationAddress) &&
|
||||||
implementationAddress !== constants.AddressZero
|
implementationAddress !== constants.AddressZero
|
||||||
) {
|
) {
|
||||||
return await resolveContractUriFromAddress(
|
return await resolveContractUriFromAddress(
|
||||||
|
|||||||
@@ -31,11 +31,17 @@ export type EIP712Domain = EIP712StandardDomain | EIP712PolygonDomain;
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export async function signTypedDataInternal(
|
export async function signTypedDataInternal(
|
||||||
signer: Signer,
|
signerInput: Signer,
|
||||||
domain: EIP712Domain,
|
domain: EIP712Domain,
|
||||||
types: Record<string, Array<TypedDataField>>,
|
types: Record<string, Array<TypedDataField>>,
|
||||||
message: Record<string, any>,
|
message: Record<string, any>,
|
||||||
) {
|
) {
|
||||||
|
// Handle ERC4337Signer
|
||||||
|
let signer = signerInput;
|
||||||
|
if ((signerInput as any).originalSigner) {
|
||||||
|
signer = (signerInput as any).originalSigner;
|
||||||
|
}
|
||||||
|
|
||||||
const provider = signer?.provider as providers.JsonRpcProvider;
|
const provider = signer?.provider as providers.JsonRpcProvider;
|
||||||
if (!provider) {
|
if (!provider) {
|
||||||
throw new Error("missing provider");
|
throw new Error("missing provider");
|
||||||
@@ -60,7 +66,7 @@ export async function signTypedDataInternal(
|
|||||||
message,
|
message,
|
||||||
);
|
);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err?.message?.includes("Method eth_signTypedData_v4 not supported")) {
|
if (err?.message?.includes("eth_signTypedData_v4")) {
|
||||||
signature = await provider.send("eth_signTypedData", [
|
signature = await provider.send("eth_signTypedData", [
|
||||||
signerAddress,
|
signerAddress,
|
||||||
JSON.stringify(payload),
|
JSON.stringify(payload),
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import {
|
|||||||
FEATURE_NFT_SIGNATURE_MINTABLE_V2,
|
FEATURE_NFT_SIGNATURE_MINTABLE_V2,
|
||||||
FEATURE_NFT_SHARED_METADATA,
|
FEATURE_NFT_SHARED_METADATA,
|
||||||
FEATURE_NFT_CLAIM_ZORA,
|
FEATURE_NFT_CLAIM_ZORA,
|
||||||
|
FEATURE_NFT_LOYALTY_CARD,
|
||||||
|
FEATURE_NFT_UPDATABLE_METADATA,
|
||||||
} from "./erc721-features";
|
} from "./erc721-features";
|
||||||
import {
|
import {
|
||||||
FEATURE_EDITION,
|
FEATURE_EDITION,
|
||||||
@@ -62,8 +64,8 @@ import {
|
|||||||
FEATURE_ENGLISH_AUCTIONS,
|
FEATURE_ENGLISH_AUCTIONS,
|
||||||
FEATURE_OFFERS,
|
FEATURE_OFFERS,
|
||||||
FEATURE_EXTENSION_ROUTER,
|
FEATURE_EXTENSION_ROUTER,
|
||||||
FEATURE_SMART_WALLET,
|
FEATURE_ACCOUNT,
|
||||||
FEATURE_SMART_WALLET_FACTORY,
|
FEATURE_ACCOUNT_FACTORY,
|
||||||
} from "./thirdweb-features";
|
} from "./thirdweb-features";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,6 +100,8 @@ export type Feature =
|
|||||||
| typeof FEATURE_NFT_BURNABLE
|
| typeof FEATURE_NFT_BURNABLE
|
||||||
| typeof FEATURE_NFT_TIERED_DROP
|
| typeof FEATURE_NFT_TIERED_DROP
|
||||||
| typeof FEATURE_NFT_SHARED_METADATA
|
| typeof FEATURE_NFT_SHARED_METADATA
|
||||||
|
| typeof FEATURE_NFT_LOYALTY_CARD
|
||||||
|
| typeof FEATURE_NFT_UPDATABLE_METADATA
|
||||||
| typeof FEATURE_EDITION
|
| typeof FEATURE_EDITION
|
||||||
| typeof FEATURE_EDITION_ENUMERABLE
|
| typeof FEATURE_EDITION_ENUMERABLE
|
||||||
| typeof FEATURE_EDITION_MINTABLE
|
| typeof FEATURE_EDITION_MINTABLE
|
||||||
@@ -127,8 +131,8 @@ export type Feature =
|
|||||||
| typeof FEATURE_DIRECT_LISTINGS
|
| typeof FEATURE_DIRECT_LISTINGS
|
||||||
| typeof FEATURE_ENGLISH_AUCTIONS
|
| typeof FEATURE_ENGLISH_AUCTIONS
|
||||||
| typeof FEATURE_OFFERS
|
| typeof FEATURE_OFFERS
|
||||||
| typeof FEATURE_SMART_WALLET
|
| typeof FEATURE_ACCOUNT
|
||||||
| typeof FEATURE_SMART_WALLET_FACTORY;
|
| typeof FEATURE_ACCOUNT_FACTORY;
|
||||||
|
|
||||||
export type Extension = Feature;
|
export type Extension = Feature;
|
||||||
|
|
||||||
@@ -170,6 +174,8 @@ export const SUPPORTED_FEATURES: Record<string, Feature> = /* @__PURE__ */ {
|
|||||||
[FEATURE_DIRECT_LISTINGS.name]: FEATURE_DIRECT_LISTINGS,
|
[FEATURE_DIRECT_LISTINGS.name]: FEATURE_DIRECT_LISTINGS,
|
||||||
[FEATURE_ENGLISH_AUCTIONS.name]: FEATURE_ENGLISH_AUCTIONS,
|
[FEATURE_ENGLISH_AUCTIONS.name]: FEATURE_ENGLISH_AUCTIONS,
|
||||||
[FEATURE_OFFERS.name]: FEATURE_OFFERS,
|
[FEATURE_OFFERS.name]: FEATURE_OFFERS,
|
||||||
[FEATURE_SMART_WALLET_FACTORY.name]: FEATURE_SMART_WALLET_FACTORY,
|
[FEATURE_ACCOUNT_FACTORY.name]: FEATURE_ACCOUNT_FACTORY,
|
||||||
[FEATURE_SMART_WALLET.name]: FEATURE_SMART_WALLET,
|
[FEATURE_ACCOUNT.name]: FEATURE_ACCOUNT,
|
||||||
|
[FEATURE_NFT_LOYALTY_CARD.name]: FEATURE_NFT_LOYALTY_CARD,
|
||||||
|
[FEATURE_NFT_UPDATABLE_METADATA.name]: FEATURE_NFT_UPDATABLE_METADATA,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import SignatureMintERC721_V1Abi from "@thirdweb-dev/contracts-js/dist/abis/ISig
|
|||||||
import TieredDropAbi from "@thirdweb-dev/contracts-js/dist/abis/LazyMintWithTier.json";
|
import TieredDropAbi from "@thirdweb-dev/contracts-js/dist/abis/LazyMintWithTier.json";
|
||||||
import SharedMetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/SharedMetadata.json";
|
import SharedMetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/SharedMetadata.json";
|
||||||
import zora_IDropERC721 from "@thirdweb-dev/contracts-js/dist/abis/zora_IERC721Drop.json";
|
import zora_IDropERC721 from "@thirdweb-dev/contracts-js/dist/abis/zora_IERC721Drop.json";
|
||||||
|
import ILoyaltyCardAbi from "@thirdweb-dev/contracts-js/dist/abis/ILoyaltyCard.json";
|
||||||
|
import INFTMetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/INFTMetadata.json";
|
||||||
|
|
||||||
export const FEATURE_NFT_BURNABLE = {
|
export const FEATURE_NFT_BURNABLE = {
|
||||||
name: "ERC721Burnable",
|
name: "ERC721Burnable",
|
||||||
@@ -211,6 +213,30 @@ export const FEATURE_NFT_SHARED_METADATA = /* @__PURE__ */ {
|
|||||||
features: {},
|
features: {},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
export const FEATURE_NFT_LOYALTY_CARD = {
|
||||||
|
name: "ERC721LoyaltyCard",
|
||||||
|
namespace: "nft.loyaltyCard",
|
||||||
|
docLinks: {
|
||||||
|
// TODO
|
||||||
|
sdk: "",
|
||||||
|
contracts: "",
|
||||||
|
},
|
||||||
|
abis: [ILoyaltyCardAbi],
|
||||||
|
features: {},
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export const FEATURE_NFT_UPDATABLE_METADATA = {
|
||||||
|
name: "ERC721UpdatableMetadata",
|
||||||
|
namespace: "nft.metadata",
|
||||||
|
docLinks: {
|
||||||
|
// TODO
|
||||||
|
sdk: "",
|
||||||
|
contracts: "",
|
||||||
|
},
|
||||||
|
abis: [INFTMetadataAbi],
|
||||||
|
features: {},
|
||||||
|
} as const;
|
||||||
|
|
||||||
export const FEATURE_NFT = /* @__PURE__ */ {
|
export const FEATURE_NFT = /* @__PURE__ */ {
|
||||||
name: "ERC721",
|
name: "ERC721",
|
||||||
namespace: "nft",
|
namespace: "nft",
|
||||||
@@ -234,5 +260,7 @@ export const FEATURE_NFT = /* @__PURE__ */ {
|
|||||||
[FEATURE_NFT_CLAIM_PHASES_V1.name]: FEATURE_NFT_CLAIM_PHASES_V1,
|
[FEATURE_NFT_CLAIM_PHASES_V1.name]: FEATURE_NFT_CLAIM_PHASES_V1,
|
||||||
[FEATURE_NFT_CLAIM_PHASES_V2.name]: FEATURE_NFT_CLAIM_PHASES_V2,
|
[FEATURE_NFT_CLAIM_PHASES_V2.name]: FEATURE_NFT_CLAIM_PHASES_V2,
|
||||||
[FEATURE_NFT_SHARED_METADATA.name]: FEATURE_NFT_SHARED_METADATA,
|
[FEATURE_NFT_SHARED_METADATA.name]: FEATURE_NFT_SHARED_METADATA,
|
||||||
|
[FEATURE_NFT_LOYALTY_CARD.name]: FEATURE_NFT_LOYALTY_CARD,
|
||||||
|
[FEATURE_NFT_UPDATABLE_METADATA.name]: FEATURE_NFT_UPDATABLE_METADATA,
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -279,24 +279,24 @@ export const FEATURE_OFFERS = {
|
|||||||
features: {},
|
features: {},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const FEATURE_SMART_WALLET_FACTORY = {
|
export const FEATURE_ACCOUNT_FACTORY = {
|
||||||
name: "SmartWalletFactory",
|
name: "AccountFactory",
|
||||||
namespace: "smartwallet.factory",
|
namespace: "accountFactory",
|
||||||
docLinks: {
|
docLinks: {
|
||||||
// TODO
|
// TODO
|
||||||
sdk: "sdk.smartWalletFactory",
|
sdk: "sdk.accountFactory",
|
||||||
contracts: "smartWalletFactory",
|
contracts: "",
|
||||||
},
|
},
|
||||||
abis: [IAccountFactory],
|
abis: [IAccountFactory],
|
||||||
features: {},
|
features: {},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const FEATURE_SMART_WALLET = {
|
export const FEATURE_ACCOUNT = {
|
||||||
name: "SmartWallet",
|
name: "Account",
|
||||||
namespace: "smartwallet",
|
namespace: "account",
|
||||||
docLinks: {
|
docLinks: {
|
||||||
// TODO
|
// TODO
|
||||||
sdk: "",
|
sdk: "sdk.account",
|
||||||
contracts: "",
|
contracts: "",
|
||||||
},
|
},
|
||||||
abis: [IAccountCore],
|
abis: [IAccountCore],
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ export class Marketplace implements UpdateableNetwork {
|
|||||||
(l.type === ListingType.Auction &&
|
(l.type === ListingType.Auction &&
|
||||||
BigNumber.from(l.endTimeInEpochSeconds).gt(now) &&
|
BigNumber.from(l.endTimeInEpochSeconds).gt(now) &&
|
||||||
BigNumber.from(l.startTimeInEpochSeconds).lte(now)) ||
|
BigNumber.from(l.startTimeInEpochSeconds).lte(now)) ||
|
||||||
(l.type === ListingType.Direct && l.quantity > 0)
|
(l.type === ListingType.Direct && BigNumber.from(l.quantity).gt(0))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user