Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4df0c2ee10 | ||
|
|
48a8f9385e | ||
|
|
a91776e121 | ||
|
|
f5aed34d3c | ||
|
|
0f02706906 | ||
|
|
eb463735e2 | ||
|
|
adec589ead | ||
|
|
e5246f2667 | ||
|
|
b29ec675f9 | ||
|
|
b30566c684 | ||
|
|
182a4e7e8f | ||
|
|
8b82f3c59c | ||
|
|
f59b729f8b | ||
|
|
387dddbd87 | ||
|
|
911e14fcac | ||
|
|
cd6b07b591 | ||
|
|
154c55add5 | ||
|
|
f202f597ca | ||
|
|
91f0245be7 | ||
|
|
ae74b8ef62 | ||
|
|
5a373a7509 | ||
|
|
088547f763 | ||
|
|
586e91dbe6 | ||
|
|
f65578d637 | ||
|
|
447d984653 | ||
|
|
34a3bb8ae3 | ||
|
|
bc003c2fef | ||
|
|
c88fa57591 | ||
|
|
c12f0874b4 | ||
|
|
184c325ab2 | ||
|
|
046c9ad604 |
@@ -1,5 +1,33 @@
|
|||||||
# @thirdweb-dev/auth
|
# @thirdweb-dev/auth
|
||||||
|
|
||||||
|
## 3.2.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`eb463735`](https://github.com/thirdweb-dev/js/commit/eb463735e2f784cd1d212a982835af95cf60766b), [`0f027069`](https://github.com/thirdweb-dev/js/commit/0f027069064bebe647f9235fa86ef7f165ffc7b3)]:
|
||||||
|
- @thirdweb-dev/wallets@1.1.21
|
||||||
|
|
||||||
|
## 3.2.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies []:
|
||||||
|
- @thirdweb-dev/wallets@1.1.20
|
||||||
|
|
||||||
|
## 3.2.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies []:
|
||||||
|
- @thirdweb-dev/wallets@1.1.19
|
||||||
|
|
||||||
|
## 3.2.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies []:
|
||||||
|
- @thirdweb-dev/wallets@1.1.18
|
||||||
|
|
||||||
## 3.2.34
|
## 3.2.34
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/auth",
|
"name": "@thirdweb-dev/auth",
|
||||||
"version": "3.2.34",
|
"version": "3.2.38",
|
||||||
"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": {
|
||||||
|
|||||||
@@ -1,5 +1,36 @@
|
|||||||
# @thirdweb-dev/chains
|
# @thirdweb-dev/chains
|
||||||
|
|
||||||
|
## 0.1.49
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1540](https://github.com/thirdweb-dev/js/pull/1540) [`b30566c6`](https://github.com/thirdweb-dev/js/commit/b30566c68436ad94ddc938a380eccc13a8a7147d) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - updated chains
|
||||||
|
|
||||||
|
- [#1422](https://github.com/thirdweb-dev/js/pull/1422) [`0f027069`](https://github.com/thirdweb-dev/js/commit/0f027069064bebe647f9235fa86ef7f165ffc7b3) Thanks [@Marfuen](https://github.com/Marfuen)! - CLI will now use an OAuth like login flow to authenticate the device with the wallet on the dashboard.
|
||||||
|
Any actions performed by the CLI will be linked to your account / wallet on the dashboard, including but not limited to tracking your usage, and billing as needed.
|
||||||
|
|
||||||
|
- [#1551](https://github.com/thirdweb-dev/js/pull/1551) [`f5aed34d`](https://github.com/thirdweb-dev/js/commit/f5aed34d3c71065c3f45df2c1eb84ba9c36162d5) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Update chains
|
||||||
|
|
||||||
|
## 0.1.48
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1530](https://github.com/thirdweb-dev/js/pull/1530) [`911e14fc`](https://github.com/thirdweb-dev/js/commit/911e14fcac743b07fa1a66440c72d662c08e971c) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Add Chiliz Spicy testnet
|
||||||
|
|
||||||
|
## 0.1.47
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1518](https://github.com/thirdweb-dev/js/pull/1518) [`34a3bb8a`](https://github.com/thirdweb-dev/js/commit/34a3bb8ae3c1d7a506e5568a9e79ab7e469557a8) Thanks [@nkrishang](https://github.com/nkrishang)! - Update contracts package
|
||||||
|
|
||||||
|
## 0.1.46
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1508](https://github.com/thirdweb-dev/js/pull/1508) [`184c325a`](https://github.com/thirdweb-dev/js/commit/184c325ab2ef028022a050c4274f2ab12b1a3a7f) Thanks [@jnsdls](https://github.com/jnsdls)! - update xpla chain icons
|
||||||
|
|
||||||
|
- [#1513](https://github.com/thirdweb-dev/js/pull/1513) [`c12f0874`](https://github.com/thirdweb-dev/js/commit/c12f0874b4dac43c263c7edb20d0343c16381c34) Thanks [@jnsdls](https://github.com/jnsdls)! - add additonal chains
|
||||||
|
|
||||||
## 0.1.45
|
## 0.1.45
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ export default {
|
|||||||
"https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
|
"wss://mainnet.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"features": [
|
"features": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ export default {
|
|||||||
"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://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://mainnet.optimism.io",
|
"https://mainnet.optimism.io",
|
||||||
"https://optimism.publicnode.com"
|
"https://optimism.publicnode.com",
|
||||||
|
"https://optimism.gateway.tenderly.co",
|
||||||
|
"wss://optimism.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ export default {
|
|||||||
"https://rpc.sepolia.org",
|
"https://rpc.sepolia.org",
|
||||||
"https://rpc2.sepolia.org",
|
"https://rpc2.sepolia.org",
|
||||||
"https://rpc-sepolia.rockx.com",
|
"https://rpc-sepolia.rockx.com",
|
||||||
"https://rpc.sepolia.ethpandaops.io"
|
"https://rpc.sepolia.ethpandaops.io",
|
||||||
|
"https://sepolia.gateway.tenderly.co",
|
||||||
|
"wss://sepolia.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"http://fauceth.komputing.org?chain=11155111&address=${ADDRESS}"
|
"http://fauceth.komputing.org?chain=11155111&address=${ADDRESS}"
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
import type { Chain } from "../src/types";
|
|
||||||
export default {
|
|
||||||
"name": "DeBank Testnet",
|
|
||||||
"chain": "DeBank",
|
|
||||||
"rpc": [],
|
|
||||||
"faucets": [],
|
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://QmW9pBps8WHRRWmyXhjLZrjZJUe8F48hUu7z98bu2RVsjN",
|
|
||||||
"width": 400,
|
|
||||||
"height": 400,
|
|
||||||
"format": "png"
|
|
||||||
},
|
|
||||||
"nativeCurrency": {
|
|
||||||
"name": "Ether",
|
|
||||||
"symbol": "ETH",
|
|
||||||
"decimals": 18
|
|
||||||
},
|
|
||||||
"infoURL": "https://debank.com",
|
|
||||||
"shortName": "debank-testnet",
|
|
||||||
"chainId": 115,
|
|
||||||
"networkId": 115,
|
|
||||||
"explorers": [],
|
|
||||||
"testnet": true,
|
|
||||||
"slug": "debank-testnet"
|
|
||||||
} as const satisfies Chain;
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import type { Chain } from "../src/types";
|
|
||||||
export default {
|
|
||||||
"name": "DeBank Mainnet",
|
|
||||||
"chain": "DeBank",
|
|
||||||
"rpc": [],
|
|
||||||
"faucets": [],
|
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://QmW9pBps8WHRRWmyXhjLZrjZJUe8F48hUu7z98bu2RVsjN",
|
|
||||||
"width": 400,
|
|
||||||
"height": 400,
|
|
||||||
"format": "png"
|
|
||||||
},
|
|
||||||
"nativeCurrency": {
|
|
||||||
"name": "Ether",
|
|
||||||
"symbol": "ETH",
|
|
||||||
"decimals": 18
|
|
||||||
},
|
|
||||||
"infoURL": "https://debank.com",
|
|
||||||
"shortName": "debank-mainnet",
|
|
||||||
"chainId": 116,
|
|
||||||
"networkId": 116,
|
|
||||||
"explorers": [],
|
|
||||||
"testnet": false,
|
|
||||||
"slug": "debank"
|
|
||||||
} as const satisfies Chain;
|
|
||||||
@@ -17,8 +17,14 @@ export default {
|
|||||||
"symbol": "MC",
|
"symbol": "MC",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://gaming.meritcircle.io",
|
"infoURL": "https://www.onbeam.com",
|
||||||
"shortName": "BEAM",
|
"shortName": "beam-testnet",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmQJ21NWyGGDraicVEzS1Uqq1yXahM9NCuNZgnfYvtspdt",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
"chainId": 13337,
|
"chainId": 13337,
|
||||||
"networkId": 13337,
|
"networkId": 13337,
|
||||||
"explorers": [
|
"explorers": [
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ export default {
|
|||||||
"https://rpc-mainnet.maticvigil.com",
|
"https://rpc-mainnet.maticvigil.com",
|
||||||
"https://rpc-mainnet.matic.quiknode.pro",
|
"https://rpc-mainnet.matic.quiknode.pro",
|
||||||
"https://matic-mainnet-full-rpc.bwarelabs.com",
|
"https://matic-mainnet-full-rpc.bwarelabs.com",
|
||||||
"https://polygon-bor.publicnode.com"
|
"https://polygon-bor.publicnode.com",
|
||||||
|
"https://polygon.gateway.tenderly.co",
|
||||||
|
"wss://polygon.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Redbelly Network Mainnet",
|
||||||
|
"shortName": "rbn",
|
||||||
|
"chain": "RBN",
|
||||||
|
"chainId": 151,
|
||||||
|
"networkId": 151,
|
||||||
|
"rpc": [],
|
||||||
|
"faucets": [],
|
||||||
|
"infoURL": "https://redbelly.network",
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Redbelly Network Coin",
|
||||||
|
"symbol": "RBNT",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"status": "incubating",
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "redbelly-network"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Redbelly Network Devnet",
|
||||||
|
"shortName": "rbn-devnet",
|
||||||
|
"chain": "RBN",
|
||||||
|
"chainId": 152,
|
||||||
|
"networkId": 152,
|
||||||
|
"rpc": [],
|
||||||
|
"faucets": [],
|
||||||
|
"infoURL": "https://redbelly.network",
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Redbelly Network Coin",
|
||||||
|
"symbol": "RBNT",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"status": "incubating",
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "redbelly-network-devnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Redbelly Network Testnet",
|
||||||
|
"shortName": "rbn-testnet",
|
||||||
|
"chain": "RBN",
|
||||||
|
"chainId": 153,
|
||||||
|
"networkId": 153,
|
||||||
|
"rpc": [],
|
||||||
|
"faucets": [],
|
||||||
|
"infoURL": "https://redbelly.network",
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Redbelly Network Coin",
|
||||||
|
"symbol": "RBNT",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"status": "incubating",
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "redbelly-network-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Redbelly Network TGE",
|
||||||
|
"shortName": "rbn-tge",
|
||||||
|
"chain": "RBN",
|
||||||
|
"chainId": 154,
|
||||||
|
"networkId": 154,
|
||||||
|
"rpc": [],
|
||||||
|
"faucets": [],
|
||||||
|
"infoURL": "https://redbelly.network",
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Redbelly Network Coin",
|
||||||
|
"symbol": "RBNT",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "redbelly-network-tge"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import type { Chain } from "../src/types";
|
import type { Chain } from "../src/types";
|
||||||
export default {
|
export default {
|
||||||
"name": "Omni Testnet 1",
|
"name": "Omni Testnet",
|
||||||
"chain": "Omni",
|
"chain": "Omni",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://omni-testnet-1.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://omni-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://testnet-1.omni.network"
|
"https://testnet.omni.network"
|
||||||
],
|
],
|
||||||
"features": [
|
"features": [
|
||||||
{
|
{
|
||||||
@@ -24,10 +24,10 @@ export default {
|
|||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "Omni Explorer",
|
"name": "Omni Explorer",
|
||||||
"url": "https://testnet-1.explorer.omni.network",
|
"url": "https://testnet.explorer.omni.network",
|
||||||
"standard": "EIP3091"
|
"standard": "EIP3091"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"testnet": true,
|
"testnet": true,
|
||||||
"slug": "omni-testnet-1"
|
"slug": "omni-testnet"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -11,8 +11,8 @@ export default {
|
|||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://horizen-gobi-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://horizen-gobi-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://gobi-testnet.horizenlabs.io/ethv1",
|
"https://gobi-rpc.horizenlabs.io/ethv1",
|
||||||
"https://rpc.ankr.com/horizen_testnet_evm"
|
"https://rpc.ankr.com/horizen_gobi_testnet"
|
||||||
],
|
],
|
||||||
"features": [
|
"features": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Bitchain Mainnet",
|
||||||
|
"chain": "Bit",
|
||||||
|
"rpc": [
|
||||||
|
"https://bitchain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.bitchain.biz/"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Bitcoin",
|
||||||
|
"symbol": "BTC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.bitchain.biz/",
|
||||||
|
"shortName": "bit",
|
||||||
|
"chainId": 198,
|
||||||
|
"networkId": 198,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Bitchain Scan",
|
||||||
|
"url": "https://explorer.bitchain.biz",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "bitchain"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "DeBank Testnet",
|
||||||
|
"chain": "DeBank",
|
||||||
|
"rpc": [
|
||||||
|
"https://debank-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"http://rpc.testnet.debank.com"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmW9pBps8WHRRWmyXhjLZrjZJUe8F48hUu7z98bu2RVsjN",
|
||||||
|
"width": 400,
|
||||||
|
"height": 400,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "DeBank USD",
|
||||||
|
"symbol": "USD",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://debank.com",
|
||||||
|
"shortName": "dbk",
|
||||||
|
"chainId": 2021398,
|
||||||
|
"networkId": 2021398,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "DeBank Chain Explorer",
|
||||||
|
"url": "https://explorer.testnet.debank.com",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "debank-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "opBNB Mainnet",
|
||||||
|
"chain": "opBNB",
|
||||||
|
"rpc": [
|
||||||
|
"https://opbnb.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://opbnb-mainnet-rpc.bnbchain.org"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://free-online-app.com/faucet-for-eth-evm-chains"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "BNB Chain Native Token",
|
||||||
|
"symbol": "BNB",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://opbnb.bnbchain.org/en",
|
||||||
|
"shortName": "obnb",
|
||||||
|
"chainId": 204,
|
||||||
|
"networkId": 204,
|
||||||
|
"slip44": 714,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "opbnbscan",
|
||||||
|
"url": "http://mainnet.opbnbscan.com",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "opbnb"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Ancient8 Testnet",
|
||||||
|
"chain": "Ancient8",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmSX8sHToRzyFupT8BvPQjVsegRWFYz2mdnLkVnqBFKohY",
|
||||||
|
"width": 901,
|
||||||
|
"height": 901,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://ancient8-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc-testnet.ancient8.gg"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Ether",
|
||||||
|
"symbol": "ETH",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://ancient8.gg/",
|
||||||
|
"shortName": "a8",
|
||||||
|
"chainId": 2863311531,
|
||||||
|
"networkId": 2863311531,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "a8scan-testnet",
|
||||||
|
"url": "https://testnet.a8scan.io",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "ancient8-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -6,8 +6,8 @@ export default {
|
|||||||
"https://boba-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://boba-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://mainnet.boba.network",
|
"https://mainnet.boba.network",
|
||||||
"https://replica.boba.network",
|
"https://replica.boba.network",
|
||||||
"http://boba-ethereum.gateway.tenderly.co",
|
"https://boba-ethereum.gateway.tenderly.co",
|
||||||
"http://gateway.tenderly.co/public/boba-ethereum",
|
"https://gateway.tenderly.co/public/boba-ethereum",
|
||||||
"wss://boba-ethereum.gateway.tenderly.co/",
|
"wss://boba-ethereum.gateway.tenderly.co/",
|
||||||
"wss://gateway.tenderly.co/public/boba-ethereum"
|
"wss://gateway.tenderly.co/public/boba-ethereum"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Dubxcoin network",
|
||||||
|
"chain": "DUBX",
|
||||||
|
"rpc": [
|
||||||
|
"https://dubxcoin-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpcmain.arabianchain.org"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Dubxcoin mainnet",
|
||||||
|
"symbol": "DUBX",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://arabianchain.org",
|
||||||
|
"shortName": "dubx",
|
||||||
|
"chainId": 3269,
|
||||||
|
"networkId": 3269,
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "dubxcoin-network"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Dubxcoin testnet",
|
||||||
|
"chain": "TESTDUBX",
|
||||||
|
"rpc": [
|
||||||
|
"https://dubxcoin-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpctestnet.arabianchain.org"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://faucet.arabianchain.org/"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Dubxcoin testnet",
|
||||||
|
"symbol": "TDUBX",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://arabianchain.org",
|
||||||
|
"shortName": "testdubx",
|
||||||
|
"chainId": 3270,
|
||||||
|
"networkId": 3270,
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "dubxcoin-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -5,6 +5,12 @@ export default {
|
|||||||
"shortName": "POPTestnet",
|
"shortName": "POPTestnet",
|
||||||
"chainId": 331769,
|
"chainId": 331769,
|
||||||
"testnet": true,
|
"testnet": true,
|
||||||
|
"icon": {
|
||||||
|
"format": "png",
|
||||||
|
"url": "ipfs://QmP8rYvcc7aJB3c2YZxjxaySvHapHnoK8MnxuSuDT4PtF2",
|
||||||
|
"height": 400,
|
||||||
|
"width": 400
|
||||||
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://proofofpepe-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://proofofpepe-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://testnet01.proofofpepe.tech"
|
"https://testnet01.proofofpepe.tech"
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "POP Mainnet",
|
||||||
|
"chain": "POP",
|
||||||
|
"shortName": "POP",
|
||||||
|
"chainId": 331771,
|
||||||
|
"testnet": false,
|
||||||
|
"icon": {
|
||||||
|
"format": "png",
|
||||||
|
"url": "ipfs://QmP8rYvcc7aJB3c2YZxjxaySvHapHnoK8MnxuSuDT4PtF2",
|
||||||
|
"height": 400,
|
||||||
|
"width": 400
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://pop.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc00.proofofpepe.tech",
|
||||||
|
"https://rpc01.proofofpepe.tech",
|
||||||
|
"https://rpc02.proofofpepe.tech"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Pepe",
|
||||||
|
"symbol": "PEPE",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Pepescan",
|
||||||
|
"url": "https://pepescan.app",
|
||||||
|
"standard": "none"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"slug": "pop"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -3,7 +3,7 @@ export default {
|
|||||||
"name": "Xpla Mainnet",
|
"name": "Xpla Mainnet",
|
||||||
"chain": "XPLA",
|
"chain": "XPLA",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://xpla.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://xpla-xpla.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://dimension-evm-rpc.xpla.dev"
|
"https://dimension-evm-rpc.xpla.dev"
|
||||||
],
|
],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
@@ -15,7 +15,7 @@ export default {
|
|||||||
"shortName": "xpla",
|
"shortName": "xpla",
|
||||||
"chainId": 37,
|
"chainId": 37,
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://Qmf4GoxfpeA5VGqu7KP5eyv1WKaCpNDbvMxq1MjQBwFWxq",
|
"url": "ipfs://QmbvEAKZfgJckEziU3mpCwz6jqMeWRcLgd8TNsWA7g8sD9/xpla.png",
|
||||||
"width": 512,
|
"width": 512,
|
||||||
"height": 512,
|
"height": 512,
|
||||||
"format": "png"
|
"format": "png"
|
||||||
@@ -28,5 +28,8 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"testnet": false,
|
"testnet": false,
|
||||||
"slug": "xpla"
|
"redFlags": [
|
||||||
|
"reusedChainId"
|
||||||
|
],
|
||||||
|
"slug": "xpla-xpla"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Xpla Mainnet",
|
||||||
|
"chain": "XPLA",
|
||||||
|
"rpc": [
|
||||||
|
"https://xpla.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://dimension-rpc.xpla.dev"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://faucet.xpla.io/"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "XPLA",
|
||||||
|
"symbol": "XPLA",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://xpla.io/",
|
||||||
|
"shortName": "xpla",
|
||||||
|
"chainId": 3701,
|
||||||
|
"networkId": 3701,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://Qmf4GoxfpeA5VGqu7KP5eyv1WKaCpNDbvMxq1MjQBwFWxq",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "XPLA Explorer",
|
||||||
|
"url": "https://explorer.xpla.io",
|
||||||
|
"standard": "none"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "xpla"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "KalyChain Mainnet",
|
||||||
|
"chain": "KLC",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmUaXcPewLuQtY5a7xPTzJyVdjkH487VfV7gSR8UXrbxQ3",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://kalychain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.kalychain.io/rpc"
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP155"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "KalyCoin",
|
||||||
|
"symbol": "KLC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://kalychain.io",
|
||||||
|
"shortName": "kalymainnet",
|
||||||
|
"chainId": 3888,
|
||||||
|
"networkId": 3888,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "KalyScan",
|
||||||
|
"url": "https://kalyscan.io",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "kalychain"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "KalyChain Testnet",
|
||||||
|
"chain": "KLC",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmUaXcPewLuQtY5a7xPTzJyVdjkH487VfV7gSR8UXrbxQ3",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://kalychain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://testnetrpc.kalychain.io/rpc"
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP155"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "KalyCoin",
|
||||||
|
"symbol": "KLC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://kalychain.io",
|
||||||
|
"shortName": "kalytestnet",
|
||||||
|
"chainId": 3889,
|
||||||
|
"networkId": 3889,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "KalyScan",
|
||||||
|
"url": "https://testnet.kalyscan.io",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "kalychain-testnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
import type { Chain } from "../src/types";
|
import type { Chain } from "../src/types";
|
||||||
export default {
|
export default {
|
||||||
"name": "Unicorn Ultra Testnet",
|
"name": "U2U Solaris Mainnet",
|
||||||
"chain": "u2u",
|
"chain": "u2u",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://unicorn-ultra-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://u2u-solaris.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://rpc-testnet.uniultra.xyz"
|
"https://rpc-mainnet.uniultra.xyz"
|
||||||
],
|
|
||||||
"faucets": [
|
|
||||||
"https://faucet.uniultra.xyz"
|
|
||||||
],
|
],
|
||||||
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"name": "Unicorn Ultra",
|
"name": "Unicorn Ultra",
|
||||||
"symbol": "U2U",
|
"symbol": "U2U",
|
||||||
@@ -33,10 +31,10 @@ export default {
|
|||||||
"format": "png"
|
"format": "png"
|
||||||
},
|
},
|
||||||
"name": "U2U Explorer",
|
"name": "U2U Explorer",
|
||||||
"url": "https://testnet.uniultra.xyz",
|
"url": "https://u2uscan.xyz",
|
||||||
"standard": "EIP3091"
|
"standard": "EIP3091"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"testnet": true,
|
"testnet": false,
|
||||||
"slug": "unicorn-ultra-testnet"
|
"slug": "u2u-solaris"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -7,7 +7,9 @@ export default {
|
|||||||
"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://opt-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://goerli.optimism.io",
|
"https://goerli.optimism.io",
|
||||||
"https://optimism-goerli.publicnode.com"
|
"https://optimism-goerli.publicnode.com",
|
||||||
|
"https://optimism-goerli.gateway.tenderly.co",
|
||||||
|
"wss://optimism-goerli.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://coinbase.com/faucets/optimism-goerli-faucet"
|
"https://coinbase.com/faucets/optimism-goerli-faucet"
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Beam",
|
||||||
|
"chain": "BEAM",
|
||||||
|
"rpc": [
|
||||||
|
"https://beam.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://subnets.avax.network/beam/mainnet/rpc"
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Merit Circle",
|
||||||
|
"symbol": "MC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.onbeam.com",
|
||||||
|
"shortName": "beam",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmQJ21NWyGGDraicVEzS1Uqq1yXahM9NCuNZgnfYvtspdt",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"chainId": 4337,
|
||||||
|
"networkId": 4337,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Beam Explorer",
|
||||||
|
"url": "https://subnets.avax.network/beam",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "beam"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -18,7 +18,7 @@ export default {
|
|||||||
"shortName": "xpla-test",
|
"shortName": "xpla-test",
|
||||||
"chainId": 47,
|
"chainId": 47,
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://Qmf4GoxfpeA5VGqu7KP5eyv1WKaCpNDbvMxq1MjQBwFWxq",
|
"url": "ipfs://QmbvEAKZfgJckEziU3mpCwz6jqMeWRcLgd8TNsWA7g8sD9/xpla.png",
|
||||||
"width": 512,
|
"width": 512,
|
||||||
"height": 512,
|
"height": 512,
|
||||||
"format": "png"
|
"format": "png"
|
||||||
@@ -31,5 +31,8 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"testnet": true,
|
"testnet": true,
|
||||||
|
"redFlags": [
|
||||||
|
"reusedChainId"
|
||||||
|
],
|
||||||
"slug": "xpla-testnet"
|
"slug": "xpla-testnet"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -9,7 +9,9 @@ export default {
|
|||||||
"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://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",
|
||||||
|
"https://goerli.gateway.tenderly.co",
|
||||||
|
"wss://goerli.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://faucet.paradigm.xyz/",
|
"https://faucet.paradigm.xyz/",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { Chain } from "../src/types";
|
import type { Chain } from "../src/types";
|
||||||
export default {
|
export default {
|
||||||
"name": "opBNB",
|
"name": "Opbnb Testnet",
|
||||||
"chain": "opBNB",
|
"chain": "opBNB",
|
||||||
"shortName": "opBNB",
|
"shortName": "opBNB",
|
||||||
"chainId": 5611,
|
"chainId": 5611,
|
||||||
@@ -11,7 +11,7 @@ export default {
|
|||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://opbnb.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://opbnb-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://opbnb-testnet-rpc.bnbchain.org"
|
"https://opbnb-testnet-rpc.bnbchain.org"
|
||||||
],
|
],
|
||||||
"explorers": [
|
"explorers": [
|
||||||
@@ -31,5 +31,5 @@ export default {
|
|||||||
"width": 512,
|
"width": 512,
|
||||||
"format": "svg"
|
"format": "svg"
|
||||||
},
|
},
|
||||||
"slug": "opbnb"
|
"slug": "opbnb-testnet"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -5,8 +5,8 @@ export default {
|
|||||||
"rpc": [
|
"rpc": [
|
||||||
"https://boba-bnb.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://boba-bnb.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://bnb.boba.network",
|
"https://bnb.boba.network",
|
||||||
"http://boba-bnb.gateway.tenderly.co/",
|
"https://boba-bnb.gateway.tenderly.co/",
|
||||||
"http://gateway.tenderly.co/public/boba-bnb",
|
"https://gateway.tenderly.co/public/boba-bnb",
|
||||||
"https://replica.bnb.boba.network",
|
"https://replica.bnb.boba.network",
|
||||||
"wss://boba-bnb.gateway.tenderly.co/",
|
"wss://boba-bnb.gateway.tenderly.co/",
|
||||||
"wss://gateway.tenderly.co/public/boba-bnb"
|
"wss://gateway.tenderly.co/public/boba-bnb"
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Tanssi EVM ContainerChain",
|
||||||
|
"chain": "EVMCC",
|
||||||
|
"rpc": [
|
||||||
|
"https://tanssi-evm-containerchain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://fraa-dancebox-3001-rpc.a.dancebox.tanssi.network",
|
||||||
|
"wss://fraa-dancebox-3001-rpc.a.dancebox.tanssi.network"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Unit",
|
||||||
|
"symbol": "Unit",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://tanssi.network",
|
||||||
|
"shortName": "TanssiCC",
|
||||||
|
"chainId": 5678,
|
||||||
|
"networkId": 5678,
|
||||||
|
"explorers": [],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "tanssi-evm-containerchain"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "VELO Labs Mainnet",
|
||||||
|
"chain": "NOVA chain",
|
||||||
|
"rpc": [
|
||||||
|
"https://velo-labs.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://nova.velo.org"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://nova-faucet.velo.org"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Nova",
|
||||||
|
"symbol": "NOVA",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://velo.org",
|
||||||
|
"shortName": "VELO",
|
||||||
|
"chainId": 56789,
|
||||||
|
"networkId": 56789,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmYqvnW2jwPEKUv8BdaV4sbL8Audcwosat6SPn4GqYtKxc",
|
||||||
|
"width": 225,
|
||||||
|
"height": 225,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "novascan",
|
||||||
|
"url": "https://novascan.velo.org",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "velo-labs"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Amplify Subnet",
|
||||||
|
"chain": "AMPLIFY",
|
||||||
|
"rpc": [
|
||||||
|
"https://amplify-subnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://subnets.avax.network/amplify/testnet/rpc"
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "AMP",
|
||||||
|
"symbol": "AMP",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.avax.network",
|
||||||
|
"shortName": "amplify",
|
||||||
|
"chainId": 78430,
|
||||||
|
"networkId": 78430,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "AMPLIFY Explorer",
|
||||||
|
"url": "https://subnets-test.avax.network/amplify",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "amplify-subnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Bulletin Subnet",
|
||||||
|
"chain": "BULLETIN",
|
||||||
|
"rpc": [
|
||||||
|
"https://bulletin-subnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://subnets.avax.network/bulletin/testnet/rpc"
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "BLT",
|
||||||
|
"symbol": "BLT",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.avax.network",
|
||||||
|
"shortName": "bulletin",
|
||||||
|
"chainId": 78431,
|
||||||
|
"networkId": 78431,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "BULLETIN Explorer",
|
||||||
|
"url": "https://subnets-test.avax.network/bulletin",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "bulletin-subnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Conduit Subnet",
|
||||||
|
"chain": "CONDUIT",
|
||||||
|
"rpc": [
|
||||||
|
"https://conduit-subnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://subnets.avax.network/conduit/testnet/rpc"
|
||||||
|
],
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "CON",
|
||||||
|
"symbol": "CON",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://www.avax.network",
|
||||||
|
"shortName": "conduit",
|
||||||
|
"chainId": 78432,
|
||||||
|
"networkId": 78432,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "CONDUIT Explorer",
|
||||||
|
"url": "https://subnets-test.avax.network/conduit",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "conduit-subnet"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -16,7 +16,9 @@ export default {
|
|||||||
"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",
|
||||||
"https://polygon-mumbai-bor.publicnode.com"
|
"https://polygon-mumbai-bor.publicnode.com",
|
||||||
|
"https://polygon-mumbai.gateway.tenderly.co",
|
||||||
|
"wss://polygon-mumbai.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://faucet.polygon.technology/"
|
"https://faucet.polygon.technology/"
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
import type { Chain } from "../src/types";
|
import type { Chain } from "../src/types";
|
||||||
export default {
|
export default {
|
||||||
"name": "BeOne Chain Testnet",
|
"name": "Testnet BeOne Chain",
|
||||||
"chain": "BOC",
|
"chain": "tBOC",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://beone-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://testnet-beone-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://pre-boc1.beonechain.com",
|
"https://pre-boc1.beonechain.com"
|
||||||
"https://pre-boc2.beonechain.com",
|
|
||||||
"https://pre-boc3.beonechain.com"
|
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://testnet.beonescan.com/faucet"
|
"https://testnet.beonescan.com/faucet"
|
||||||
],
|
],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"name": "BeOne Chain Testnet",
|
"name": "Testnet BeOne Chain",
|
||||||
"symbol": "BOC",
|
"symbol": "tBOC",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://testnet.beonescan.com",
|
"infoURL": "https://testnet.beonescan.com",
|
||||||
@@ -28,7 +26,7 @@ export default {
|
|||||||
},
|
},
|
||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "BeOne Chain Testnet",
|
"name": "Testnet BeOne Chain",
|
||||||
"url": "https://testnet.beonescan.com",
|
"url": "https://testnet.beonescan.com",
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://QmbVLQnaMDu86bPyKgCvTGhFBeYwjr15hQnrCcsp1EkAGL",
|
"url": "ipfs://QmbVLQnaMDu86bPyKgCvTGhFBeYwjr15hQnrCcsp1EkAGL",
|
||||||
@@ -40,5 +38,5 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"testnet": true,
|
"testnet": true,
|
||||||
"slug": "beone-chain-testnet"
|
"slug": "testnet-beone-chain"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -5,7 +5,10 @@ export default {
|
|||||||
"rpc": [
|
"rpc": [
|
||||||
"https://base.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://base.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://mainnet.base.org/",
|
"https://mainnet.base.org/",
|
||||||
"https://developer-access-mainnet.base.org/"
|
"https://developer-access-mainnet.base.org/",
|
||||||
|
"https://base.gateway.tenderly.co",
|
||||||
|
"wss://base.gateway.tenderly.co",
|
||||||
|
"https://base.publicnode.com"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ export default {
|
|||||||
"chain": "ETH",
|
"chain": "ETH",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://base-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://base-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://base-goerli.publicnode.com",
|
||||||
|
"wss://base-goerli.gateway.tenderly.co",
|
||||||
|
"https://base-goerli.gateway.tenderly.co",
|
||||||
"https://goerli.base.org"
|
"https://goerli.base.org"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Aerie Network",
|
||||||
|
"chain": "Aerie",
|
||||||
|
"rpc": [
|
||||||
|
"https://aerie-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://mainnet.aerielab.io"
|
||||||
|
],
|
||||||
|
"faucets": [],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Aerie",
|
||||||
|
"symbol": "AER",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://aerielab.io/",
|
||||||
|
"shortName": "Aerie",
|
||||||
|
"chainId": 84886,
|
||||||
|
"networkId": 84886,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafkreig54jss26xllpjbclmfgwvot72m4ku7qxignhlqei6mijvwi2m4pu",
|
||||||
|
"width": 1062,
|
||||||
|
"height": 1069,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Aerie Explorer",
|
||||||
|
"url": "https://explorer.aerielab.io",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://bafkreig54jss26xllpjbclmfgwvot72m4ku7qxignhlqei6mijvwi2m4pu",
|
||||||
|
"width": 1062,
|
||||||
|
"height": 1069,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "aerie-network"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Spicy Chain",
|
||||||
|
"chain": "Spicy",
|
||||||
|
"rpc": [
|
||||||
|
"https://spicy-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://spicy-rpc.chiliz.com/"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://spicy-faucet.chiliz.com/"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Chiliz",
|
||||||
|
"symbol": "CHZ",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://chiliz.com/",
|
||||||
|
"shortName": "Spicy",
|
||||||
|
"chainId": 88882,
|
||||||
|
"networkId": 88882,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Spicy Explorer",
|
||||||
|
"url": "http://spicy-explorer.chiliz.com/",
|
||||||
|
"standard": "none"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmTGYofJ8VLkeNY4J69AvXi8e126kmbHmf34wLFoJ1FKAK",
|
||||||
|
"width": 400,
|
||||||
|
"height": 400,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"testnet": true,
|
||||||
|
"slug": "spicy-chain"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Worlds Appchain",
|
||||||
|
"chain": "WRLDS",
|
||||||
|
"shortName": "WRLDS",
|
||||||
|
"chainId": 91003,
|
||||||
|
"testnet": true,
|
||||||
|
"rpc": [
|
||||||
|
"https://worlds-appchain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://api.evm.worlds.dev.eclipsenetwork.xyz/"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "WRLDS",
|
||||||
|
"symbol": "WRLDS",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"faucets": [
|
||||||
|
"https://faucet.evm.worlds.dev.eclipsenetwork.xyz/request_neon"
|
||||||
|
],
|
||||||
|
"slug": "worlds-appchain"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -7,7 +7,9 @@ export default {
|
|||||||
"https://testnet.bnb.boba.network",
|
"https://testnet.bnb.boba.network",
|
||||||
"wss://wss.testnet.bnb.boba.network",
|
"wss://wss.testnet.bnb.boba.network",
|
||||||
"https://replica.testnet.bnb.boba.network",
|
"https://replica.testnet.bnb.boba.network",
|
||||||
"wss://replica-wss.testnet.bnb.boba.network"
|
"wss://replica-wss.testnet.bnb.boba.network",
|
||||||
|
"https://boba-bnb-testnet.gateway.tenderly.co",
|
||||||
|
"wss://boba-bnb-testnet.gateway.tenderly.co"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export default {
|
|||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://mind-smart-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://mind-smart-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://testnet-msc.mindchain.info/"
|
"https://testnet-msc.mindchain.info/",
|
||||||
|
"wss://testnet-msc.mindchain.info/ws"
|
||||||
],
|
],
|
||||||
"faucets": [
|
"faucets": [
|
||||||
"https://faucet.mindchain.info/"
|
"https://faucet.mindchain.info/"
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ export default {
|
|||||||
shortName: "POPTestnet",
|
shortName: "POPTestnet",
|
||||||
chainId: 331769,
|
chainId: 331769,
|
||||||
testnet: true,
|
testnet: true,
|
||||||
|
icon: {
|
||||||
|
format: "png",
|
||||||
|
url: "ipfs://QmP8rYvcc7aJB3c2YZxjxaySvHapHnoK8MnxuSuDT4PtF2",
|
||||||
|
height: 400,
|
||||||
|
width: 400,
|
||||||
|
},
|
||||||
rpc: ["https://testnet01.proofofpepe.tech"],
|
rpc: ["https://testnet01.proofofpepe.tech"],
|
||||||
nativeCurrency: {
|
nativeCurrency: {
|
||||||
name: "POP",
|
name: "POP",
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// @ts-check
|
||||||
|
/** @typedef { import("../../src/types").Chain } Chain */
|
||||||
|
|
||||||
|
/** @type {Omit<Chain, "slug">} */
|
||||||
|
export default {
|
||||||
|
name: "POP Mainnet",
|
||||||
|
chain: "POP",
|
||||||
|
shortName: "POP",
|
||||||
|
chainId: 331771,
|
||||||
|
testnet: false,
|
||||||
|
icon: {
|
||||||
|
format: "png",
|
||||||
|
url: "ipfs://QmP8rYvcc7aJB3c2YZxjxaySvHapHnoK8MnxuSuDT4PtF2",
|
||||||
|
height: 400,
|
||||||
|
width: 400,
|
||||||
|
},
|
||||||
|
rpc: [
|
||||||
|
"https://rpc00.proofofpepe.tech",
|
||||||
|
"https://rpc01.proofofpepe.tech",
|
||||||
|
"https://rpc02.proofofpepe.tech",
|
||||||
|
],
|
||||||
|
nativeCurrency: {
|
||||||
|
name: "Pepe",
|
||||||
|
symbol: "PEPE",
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
explorers: [
|
||||||
|
{ name: "Pepescan", url: "https://pepescan.app", standard: "none" },
|
||||||
|
],
|
||||||
|
};
|
||||||
@@ -15,7 +15,7 @@ export default {
|
|||||||
shortName: "xpla",
|
shortName: "xpla",
|
||||||
chainId: 37,
|
chainId: 37,
|
||||||
icon: {
|
icon: {
|
||||||
url: "ipfs://Qmf4GoxfpeA5VGqu7KP5eyv1WKaCpNDbvMxq1MjQBwFWxq",
|
url: "ipfs://QmbvEAKZfgJckEziU3mpCwz6jqMeWRcLgd8TNsWA7g8sD9/xpla.png",
|
||||||
width: 512,
|
width: 512,
|
||||||
height: 512,
|
height: 512,
|
||||||
format: "png",
|
format: "png",
|
||||||
@@ -28,4 +28,5 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
testnet: false,
|
testnet: false,
|
||||||
|
redFlags: ["reusedChainId"],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
shortName: "xpla-test",
|
shortName: "xpla-test",
|
||||||
chainId: 47,
|
chainId: 47,
|
||||||
icon: {
|
icon: {
|
||||||
url: "ipfs://Qmf4GoxfpeA5VGqu7KP5eyv1WKaCpNDbvMxq1MjQBwFWxq",
|
url: "ipfs://QmbvEAKZfgJckEziU3mpCwz6jqMeWRcLgd8TNsWA7g8sD9/xpla.png",
|
||||||
width: 512,
|
width: 512,
|
||||||
height: 512,
|
height: 512,
|
||||||
format: "png",
|
format: "png",
|
||||||
@@ -29,4 +29,5 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
testnet: true,
|
testnet: true,
|
||||||
|
redFlags: ["reusedChainId"],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// @ts-check
|
||||||
|
/** @typedef { import("../../src/types").Chain } Chain */
|
||||||
|
|
||||||
|
/** @type {Omit<Chain, "slug">} */
|
||||||
|
export default {
|
||||||
|
name: "Spicy Chain",
|
||||||
|
chain: "Spicy",
|
||||||
|
rpc: ["https://spicy-rpc.chiliz.com/"],
|
||||||
|
faucets: ["https://spicy-faucet.chiliz.com/"],
|
||||||
|
nativeCurrency: {
|
||||||
|
name: "Chiliz",
|
||||||
|
symbol: "CHZ",
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
infoURL: "https://chiliz.com/",
|
||||||
|
shortName: "Spicy",
|
||||||
|
chainId: 88882,
|
||||||
|
networkId: 88882,
|
||||||
|
explorers: [
|
||||||
|
{
|
||||||
|
name: "Spicy Explorer",
|
||||||
|
url: "http://spicy-explorer.chiliz.com/",
|
||||||
|
standard: "none",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
icon: {
|
||||||
|
url: "ipfs://QmTGYofJ8VLkeNY4J69AvXi8e126kmbHmf34wLFoJ1FKAK",
|
||||||
|
width: 400,
|
||||||
|
height: 400,
|
||||||
|
format: "png",
|
||||||
|
},
|
||||||
|
testnet: true,
|
||||||
|
};
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// @ts-check
|
||||||
|
/** @typedef { import("../../src/types").Chain } Chain */
|
||||||
|
|
||||||
|
/** @type {Omit<Chain, "slug">} */
|
||||||
|
export default {
|
||||||
|
name: "Worlds Appchain",
|
||||||
|
chain: "WRLDS",
|
||||||
|
shortName: "WRLDS",
|
||||||
|
chainId: 91003,
|
||||||
|
testnet: true,
|
||||||
|
rpc: ["https://api.evm.worlds.dev.eclipsenetwork.xyz/"],
|
||||||
|
nativeCurrency: {
|
||||||
|
name: "WRLDS",
|
||||||
|
symbol: "WRLDS",
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
faucets: ["https://faucet.evm.worlds.dev.eclipsenetwork.xyz/request_neon"],
|
||||||
|
};
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// @ts-check
|
||||||
|
/** @typedef { import("../../src/types").Chain } Chain */
|
||||||
|
|
||||||
|
/** @type {Partial<Chain>} */
|
||||||
|
export default {
|
||||||
|
name: "Opbnb Testnet",
|
||||||
|
slug: "opbnb-testnet",
|
||||||
|
};
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/chains",
|
"name": "@thirdweb-dev/chains",
|
||||||
"version": "0.1.45",
|
"version": "0.1.49",
|
||||||
"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": {
|
||||||
|
|||||||
@@ -344,6 +344,7 @@ ${exports.join("\n")}
|
|||||||
export * from "./types";
|
export * from "./types";
|
||||||
export * from "./utils";
|
export * from "./utils";
|
||||||
export const defaultChains = [c1, c5, c8453, c84531, c137, c80001, c42161, c421613, c10, c420, c56, c97, c250, c4002, c43114, c43113, c1337];
|
export const defaultChains = [c1, c5, c8453, c84531, c137, c80001, c42161, c421613, c10, c420, c56, c97, c250, c4002, c43114, c43113, c1337];
|
||||||
|
// @ts-expect-error - TODO: fix this later
|
||||||
export const allChains: Chain[] = [${exportNames.join(", ")}];
|
export const allChains: Chain[] = [${exportNames.join(", ")}];
|
||||||
|
|
||||||
type ChainsById = {
|
type ChainsById = {
|
||||||
|
|||||||
+104
-19
File diff suppressed because one or more lines are too long
@@ -75,7 +75,6 @@ export function getChainRPCs(
|
|||||||
*
|
*
|
||||||
* @param chain - The chain config to assemble RPC URLs from
|
* @param chain - The chain config to assemble RPC URLs from
|
||||||
* @param clientId - The client id to use for the RPC URL
|
* @param clientId - The client id to use for the RPC URL
|
||||||
* @param secretKey - The secret key to use for the RPC URL
|
|
||||||
* @returns The first valid RPC URL for the chain
|
* @returns The first valid RPC URL for the chain
|
||||||
*/
|
*/
|
||||||
export function getValidChainRPCs(
|
export function getValidChainRPCs(
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const CHAIN_RPC_TEST_CASES: [ChainRPCOptions, string[]][] = [
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -27,6 +28,7 @@ const CHAIN_RPC_TEST_CASES: [ChainRPCOptions, string[]][] = [
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -36,12 +38,16 @@ const CHAIN_RPC_TEST_CASES: [ChainRPCOptions, string[]][] = [
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
// infura is supported for both http and ws
|
// infura is supported for both http and ws
|
||||||
[
|
[
|
||||||
{ mode: "ws", infuraApiKey: "SAMPLE_KEY" },
|
{ mode: "ws", infuraApiKey: "SAMPLE_KEY" },
|
||||||
["wss://mainnet.infura.io/ws/v3/SAMPLE_KEY"],
|
[
|
||||||
|
"wss://mainnet.infura.io/ws/v3/SAMPLE_KEY",
|
||||||
|
"wss://mainnet.gateway.tenderly.co",
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -53,12 +59,6 @@ describe("chains/utils", () => {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
test("Should throw error if no processedRPCs (getChainRPCs(%p))", () => {
|
|
||||||
expect(() => {
|
|
||||||
getChainRPCs(Ethereum, { mode: "ws" });
|
|
||||||
}).toThrowError('No RPC available for chainId "1" with mode ws');
|
|
||||||
});
|
|
||||||
|
|
||||||
test.each([
|
test.each([
|
||||||
[
|
[
|
||||||
undefined,
|
undefined,
|
||||||
@@ -68,6 +68,7 @@ describe("chains/utils", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -78,6 +79,7 @@ describe("chains/utils", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -88,6 +90,7 @@ describe("chains/utils", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -98,24 +101,13 @@ describe("chains/utils", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
])("getValidChainRPCs(Ethereum, %s, %s) = %p", (clientId, mode, expected) => {
|
])("getValidChainRPCs(Ethereum, %s, %s) = %p", (clientId, mode, expected) => {
|
||||||
expect(getValidChainRPCs(Ethereum, clientId, mode)).toEqual(expected);
|
expect(getValidChainRPCs(Ethereum, clientId, mode)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.each([
|
|
||||||
[undefined, "ws"],
|
|
||||||
["SAMPLE_CLIENT_KEY", "ws"],
|
|
||||||
])(
|
|
||||||
"Should throw error if no processedRPCs (getValidChainRPCs(Ethereum, %s, %s))",
|
|
||||||
(clientId, mode) => {
|
|
||||||
expect(() => {
|
|
||||||
getValidChainRPCs(Ethereum, clientId, mode);
|
|
||||||
}).toThrowError('No RPC available for chainId "1" with mode ws');
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
test.each(CHAIN_RPC_TEST_CASES)(
|
test.each(CHAIN_RPC_TEST_CASES)(
|
||||||
"getChainRPC(%p) = %p",
|
"getChainRPC(%p) = %p",
|
||||||
(options, expected) => {
|
(options, expected) => {
|
||||||
@@ -174,6 +166,7 @@ describe("chains/utils", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -187,6 +180,7 @@ describe("chains/utils", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -210,6 +204,7 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -220,6 +215,7 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -230,6 +226,7 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -240,6 +237,7 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
])("getValidChainRPCs(Ethereum, %s, %s) = %p", (clientId, mode, expected) => {
|
])("getValidChainRPCs(Ethereum, %s, %s) = %p", (clientId, mode, expected) => {
|
||||||
@@ -257,6 +255,7 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -270,6 +269,7 @@ describe("chains/utils with APP_BUNDLE_ID", () => {
|
|||||||
"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",
|
||||||
|
"https://mainnet.gateway.tenderly.co",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,55 @@
|
|||||||
# thirdweb
|
# thirdweb
|
||||||
|
|
||||||
|
## 0.12.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#1422](https://github.com/thirdweb-dev/js/pull/1422) [`0f027069`](https://github.com/thirdweb-dev/js/commit/0f027069064bebe647f9235fa86ef7f165ffc7b3) Thanks [@Marfuen](https://github.com/Marfuen)! - CLI will now use an OAuth like login flow to authenticate the device with the wallet on the dashboard.
|
||||||
|
Any actions performed by the CLI will be linked to your account / wallet on the dashboard, including but not limited to tracking your usage, and billing as needed.
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`eb463735`](https://github.com/thirdweb-dev/js/commit/eb463735e2f784cd1d212a982835af95cf60766b), [`adec589e`](https://github.com/thirdweb-dev/js/commit/adec589ead8ceff1b57169e05a3e6733b4652cc7), [`b30566c6`](https://github.com/thirdweb-dev/js/commit/b30566c68436ad94ddc938a380eccc13a8a7147d), [`0f027069`](https://github.com/thirdweb-dev/js/commit/0f027069064bebe647f9235fa86ef7f165ffc7b3), [`f5aed34d`](https://github.com/thirdweb-dev/js/commit/f5aed34d3c71065c3f45df2c1eb84ba9c36162d5)]:
|
||||||
|
- @thirdweb-dev/wallets@1.1.21
|
||||||
|
- @thirdweb-dev/sdk@3.10.57
|
||||||
|
- @thirdweb-dev/chains@0.1.49
|
||||||
|
- @thirdweb-dev/storage@1.2.9
|
||||||
|
- @thirdweb-dev/auth@3.2.38
|
||||||
|
|
||||||
|
## 0.11.20
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1538](https://github.com/thirdweb-dev/js/pull/1538) [`8b82f3c5`](https://github.com/thirdweb-dev/js/commit/8b82f3c59cad6bd1167c13cb0b8a1cdc36475ab8) Thanks [@iketw](https://github.com/iketw)! - Adds support for creating PWA Vite apps
|
||||||
|
|
||||||
|
You can now run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx thirdweb@nightly create --template pwa-vite-typescript-starter
|
||||||
|
```
|
||||||
|
|
||||||
|
- Updated dependencies [[`f59b729f`](https://github.com/thirdweb-dev/js/commit/f59b729f8b09aa86655b8e8a70fba644fc52009b), [`911e14fc`](https://github.com/thirdweb-dev/js/commit/911e14fcac743b07fa1a66440c72d662c08e971c), [`cd6b07b5`](https://github.com/thirdweb-dev/js/commit/cd6b07b591606d2671794cebebf8edcb59076c32)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.11.19
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`586e91db`](https://github.com/thirdweb-dev/js/commit/586e91dbe610588cc7b24fade59172fed6481074), [`34a3bb8a`](https://github.com/thirdweb-dev/js/commit/34a3bb8ae3c1d7a506e5568a9e79ab7e469557a8), [`91f0245b`](https://github.com/thirdweb-dev/js/commit/91f0245be78ae523e1faea26b1032bfb283467d9), [`f65578d6`](https://github.com/thirdweb-dev/js/commit/f65578d637decc8b87cada5b5b0c8c504064d9d5), [`5a373a75`](https://github.com/thirdweb-dev/js/commit/5a373a75090da7e1e05724ed1a3a3a6aa9f7fd21), [`ae74b8ef`](https://github.com/thirdweb-dev/js/commit/ae74b8ef6200dba8affa8b52e7d834c5552350d0), [`bc003c2f`](https://github.com/thirdweb-dev/js/commit/bc003c2fef33fcf7ce5981d8634911ac4bcaa927), [`447d9846`](https://github.com/thirdweb-dev/js/commit/447d984653f77af6860ae907072e768b584b263d), [`f65578d6`](https://github.com/thirdweb-dev/js/commit/f65578d637decc8b87cada5b5b0c8c504064d9d5)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.11.18
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`184c325a`](https://github.com/thirdweb-dev/js/commit/184c325ab2ef028022a050c4274f2ab12b1a3a7f), [`046c9ad6`](https://github.com/thirdweb-dev/js/commit/046c9ad604587ff79bf028c4fe7b1f9c94f4ea54), [`c12f0874`](https://github.com/thirdweb-dev/js/commit/c12f0874b4dac43c263c7edb20d0343c16381c34)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
## 0.11.17
|
## 0.11.17
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "thirdweb",
|
"name": "thirdweb",
|
||||||
"main": "dist/cli/index.js",
|
"main": "dist/cli/index.js",
|
||||||
"version": "0.11.17",
|
"version": "0.12.0",
|
||||||
"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",
|
||||||
@@ -37,9 +37,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
|
"@thirdweb-dev/auth": "workspace:*",
|
||||||
"@thirdweb-dev/chains": "workspace:*",
|
"@thirdweb-dev/chains": "workspace:*",
|
||||||
"@thirdweb-dev/sdk": "workspace:*",
|
"@thirdweb-dev/sdk": "workspace:*",
|
||||||
"@thirdweb-dev/storage": "workspace:*",
|
"@thirdweb-dev/storage": "workspace:*",
|
||||||
|
"@thirdweb-dev/wallets": "workspace:*",
|
||||||
"async-retry": "^1.3.3",
|
"async-retry": "^1.3.3",
|
||||||
"commander": "^9.1.0",
|
"commander": "^9.1.0",
|
||||||
"detect-package-manager": "^2.0.1",
|
"detect-package-manager": "^2.0.1",
|
||||||
@@ -53,10 +55,10 @@
|
|||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"solc": "0.8.17",
|
"solc": "0.8.17",
|
||||||
"sync-disk-cache": "^2.1.0",
|
|
||||||
"tar": "^6.1.15",
|
"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",
|
||||||
|
"xdg-app-paths": "^8.3.0",
|
||||||
"yaml": "^2.3.1"
|
"yaml": "^2.3.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
+254
-65
@@ -1,105 +1,294 @@
|
|||||||
|
import { LocalWallet } from "@thirdweb-dev/wallets";
|
||||||
|
import assert from "assert";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
import prompts from "prompts";
|
import fs from "fs";
|
||||||
import Cache, { CacheEntry } from "sync-disk-cache";
|
import http from "http";
|
||||||
import { ApiResponse } from "../lib/types";
|
import open from "open";
|
||||||
import os from "os";
|
import ora from "ora";
|
||||||
|
import url from "url";
|
||||||
|
import { logger, spinner } from "../core/helpers/logger";
|
||||||
|
import { ThirdwebAuth } from "@thirdweb-dev/auth";
|
||||||
|
import { ICredsConfig } from "../lib/types";
|
||||||
|
import { generateStateParameter } from "../lib/utils";
|
||||||
|
import crypto from "node:crypto";
|
||||||
|
|
||||||
|
type LoginProps = {
|
||||||
|
browser: boolean;
|
||||||
|
configPaths: ConfigPaths;
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultLoginProps = {
|
||||||
|
browser: true,
|
||||||
|
configPaths: {
|
||||||
|
credsConfigPath: "",
|
||||||
|
cliWalletPath: "",
|
||||||
|
tokenPath: "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
type ConfigPaths = {
|
||||||
|
credsConfigPath: string;
|
||||||
|
cliWalletPath: string;
|
||||||
|
tokenPath: string;
|
||||||
|
}
|
||||||
|
|
||||||
export async function loginUser(
|
export async function loginUser(
|
||||||
cache: Cache,
|
configPaths: ConfigPaths,
|
||||||
options?: { new: boolean },
|
options?: { new: boolean },
|
||||||
showLogs?: boolean,
|
showLogs?: boolean,
|
||||||
) {
|
) {
|
||||||
const keyFound = getSession(cache);
|
const { credsConfigPath, tokenPath } = configPaths;
|
||||||
if (keyFound && !options?.new) {
|
const authToken = await getSession(tokenPath, credsConfigPath);
|
||||||
|
if (authToken && !options?.new) {
|
||||||
if (showLogs) {
|
if (showLogs) {
|
||||||
console.log(chalk.green("You are already logged in"));
|
console.log(chalk.green("You are already logged in"));
|
||||||
}
|
}
|
||||||
return keyFound;
|
globalThis["TW_AUTH_TOKEN"] = authToken;
|
||||||
|
return authToken;
|
||||||
} else {
|
} else {
|
||||||
const apiKey = await createSession(cache);
|
const token = await authenticateUser({ browser: true, configPaths });
|
||||||
return apiKey;
|
if (!token) {
|
||||||
|
throw new Error("Failed to login");
|
||||||
|
}
|
||||||
|
|
||||||
|
globalThis["TW_AUTH_TOKEN"] = token;
|
||||||
|
return token;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function logoutUser(cache: Cache) {
|
export async function logoutUser(credsConfigPath: string, tokenPath: string, cliWalletPath: string) {
|
||||||
try {
|
try {
|
||||||
cache.remove("api-secret-key");
|
ora("Logging out...").start();
|
||||||
console.log(chalk.green("You have been logged out"));
|
const dirExists = fs.existsSync(credsConfigPath) && fs.existsSync(tokenPath);
|
||||||
|
if (!dirExists) {
|
||||||
|
ora().warn(chalk.yellow("You are already logged out, did you mean to login?"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.unlinkSync(credsConfigPath);
|
||||||
|
fs.unlinkSync(tokenPath);
|
||||||
|
// TODO: We can consider not removing this on logout later, once we want to implement teams. For now this wallet will be ephemeral.
|
||||||
|
fs.unlinkSync(cliWalletPath);
|
||||||
|
ora().succeed(chalk.green("You have been logged out"));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(chalk.red("Something went wrong", error));
|
console.log(chalk.red("Something went wrong", error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSession(cache: Cache) {
|
export async function getSession(tokenPath: string, configCredsPath: string) {
|
||||||
|
if (!fs.existsSync(tokenPath) || !fs.existsSync(configCredsPath)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const apiKey: CacheEntry = cache.get("api-secret-key");
|
return fs.readFileSync(tokenPath, "utf8");
|
||||||
return apiKey.value;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createSession(cache: Cache) {
|
export const authenticateUser = async (
|
||||||
try {
|
props: LoginProps = defaultLoginProps,
|
||||||
const isWindows = os.type() === "Windows_NT";
|
) => {
|
||||||
if (isWindows) {
|
const { credsConfigPath, cliWalletPath, tokenPath } = props.configPaths;
|
||||||
console.log(chalk.yellow("Windows detected: if you are using powershell, there are some known issues with it that we are actively working on, please use git bash or the command prompt. Thank you for your understanding."));
|
const waitForDashboard = spinner("Waiting for a response from the dashboard").clear();
|
||||||
}
|
|
||||||
const response = await prompts({
|
// Get or generate a localwallet.
|
||||||
type: "invisible",
|
const wallet = await getOrGenerateLocalWallet(credsConfigPath, cliWalletPath);
|
||||||
name: "apiSecretKey",
|
const walletAddress = await wallet.getAddress();
|
||||||
message: `Please enter your API secret key, you can find or create it on ${chalk.blue(
|
const domain = "thirdweb.com";
|
||||||
"https://thirdweb.com/create-api-key",
|
const auth = new ThirdwebAuth(wallet, domain);
|
||||||
)}`,
|
|
||||||
|
// Generate the login payload to pass to the dashboard.
|
||||||
|
const loggedIn = await auth.login({
|
||||||
|
domain: domain,
|
||||||
|
address: walletAddress,
|
||||||
|
});
|
||||||
|
|
||||||
|
// In this case the state is the loggedIn object.
|
||||||
|
const ourState = generateStateParameter(32);
|
||||||
|
const payload = encodeURIComponent(JSON.stringify(loggedIn));
|
||||||
|
const urlToOpen = `https://thirdweb.com/cli/login?payload=${payload}&#${ourState}`;
|
||||||
|
|
||||||
|
let server: http.Server;
|
||||||
|
let loginTimeoutHandle: NodeJS.Timeout;
|
||||||
|
const timerPromise = new Promise<void>((resolve, reject) => {
|
||||||
|
loginTimeoutHandle = setTimeout(() => {
|
||||||
|
logger.error("Login session timed out, server didn't receive a response in 5 minutes. Please try again.");
|
||||||
|
server.close();
|
||||||
|
clearTimeout(loginTimeoutHandle);
|
||||||
|
reject(new Error("Login session timed out, server didn't receive a response in 5 minutes. Please try again."));
|
||||||
|
}, 300000);
|
||||||
|
});
|
||||||
|
|
||||||
|
const loginPromise = new Promise<string>((resolve, reject) => {
|
||||||
|
server = http.createServer(async (req, res) => {
|
||||||
|
function finish(error?: Error) {
|
||||||
|
clearTimeout(loginTimeoutHandle);
|
||||||
|
server.close((closeErr?: Error) => {
|
||||||
|
if (error || closeErr) {
|
||||||
|
reject(error || closeErr);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
||||||
|
res.setHeader('Access-Control-Allow-Origin', "https://thirdweb.com");
|
||||||
|
res.setHeader('Access-Control-Allow-Methods', 'POST');
|
||||||
|
|
||||||
|
if (req.method === 'OPTIONS') {
|
||||||
|
res.setHeader('Access-Control-Allow-Headers', 'content-type, baggage, sentry-trace');
|
||||||
|
res.writeHead(200);
|
||||||
|
res.end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(req.url, "This request doesn't have a URL");
|
||||||
|
const { pathname, query } = url.parse(req.url, true);
|
||||||
|
switch (pathname) {
|
||||||
|
case "/auth/callback": {
|
||||||
|
if (query.failed) {
|
||||||
|
res.writeHead(500, "Unable to authenticate with the dashboard!");
|
||||||
|
res.end("Unable to authenticate with the dashboard!", () => {
|
||||||
|
finish(new Error("Unable to authenticate with the dashboard!"));
|
||||||
|
})
|
||||||
|
reject(chalk.red("Something went wrong! Unable to authenticate with the dashboard."));
|
||||||
|
waitForDashboard.stop();
|
||||||
|
}
|
||||||
|
if (query.token) {
|
||||||
|
const token = Array.isArray(query.token) ? query.token[0] : query.token;
|
||||||
|
const theirState = Array.isArray(query.state)
|
||||||
|
? query.state[0]
|
||||||
|
: query.state;
|
||||||
|
|
||||||
|
// Check if the state sent back is the same as the one we sent.
|
||||||
|
if (theirState !== ourState) {
|
||||||
|
res.writeHead(400, { "Content-Type": "text/plain" }); // send a 400 response
|
||||||
|
res.end("Unauthorized request, state mismatch", () => {
|
||||||
|
finish(new Error("Unauthorized request, state mismatch"));
|
||||||
|
});
|
||||||
|
reject(
|
||||||
|
new Error(chalk.red("\nUnauthorized request, state mismatch")),
|
||||||
|
);
|
||||||
|
waitForDashboard.stop();
|
||||||
|
} else {
|
||||||
|
// Save the token to the config file.
|
||||||
|
// eslint-disable-next-line no-unused-expressions
|
||||||
|
fs.writeFileSync(tokenPath, token), {
|
||||||
|
encoding: "utf8",
|
||||||
|
mode: 0o600,
|
||||||
|
};
|
||||||
|
res.end(() => {
|
||||||
|
waitForDashboard.clear();
|
||||||
|
console.log(chalk.green(`Successfully linked your account to this device`));
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
logger.info(chalk.green(`\nSuccessfully logged in.`));
|
||||||
|
resolve(token); // resolve promise with secretKey
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res.writeHead(400, { "Content-Type": "text/plain" });
|
||||||
|
res.end("No authToken received", () => {
|
||||||
|
finish(new Error("No authToken received"));
|
||||||
|
});
|
||||||
|
reject(new Error(chalk.red("\nNo authToken received")));
|
||||||
|
waitForDashboard.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const keyPassed = response.apiSecretKey;
|
server.listen(8976);
|
||||||
if (!keyPassed) {
|
});
|
||||||
console.log(chalk.red("You need to pass an API secret key"));
|
if (props?.browser) {
|
||||||
process.exit(1);
|
console.log(chalk.yellow(`Automatically opening a link to authenticate with our dashboard...\n`))
|
||||||
}
|
waitForDashboard.start();
|
||||||
|
// Adding this timeout since it feels weird for the browser to open before the spinner.
|
||||||
|
setTimeout(async () => {
|
||||||
|
await open(urlToOpen);
|
||||||
|
}, 2000);
|
||||||
|
} else {
|
||||||
|
logger.info(`Visit this link to authenticate: ${urlToOpen}`);
|
||||||
|
}
|
||||||
|
|
||||||
if (keyPassed.length === 32) {
|
return Promise.race([timerPromise, loginPromise]);
|
||||||
console.log(chalk.red(`This is not a valid secret key. To get your secret key
|
};
|
||||||
1. Create an API key at https://thirdweb.com/create-api-key
|
|
||||||
2. Store and copy your Secret Key. This will be shown only once.
|
|
||||||
3. Paste it in the CLI when prompted`));
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
async function getOrCreatePassword(configCredsPath: string): Promise<string> {
|
||||||
|
const passwordFileExists = fs.existsSync(configCredsPath);
|
||||||
|
if (!passwordFileExists) {
|
||||||
|
// Generate a random password for the CLI to be able to import / export the wallet.
|
||||||
|
return crypto.randomUUID();
|
||||||
|
} else {
|
||||||
|
const file = fs.readFileSync(configCredsPath, "utf8");
|
||||||
try {
|
try {
|
||||||
await validateKey(response.apiSecretKey);
|
JSON.parse(file);
|
||||||
} catch (error) {
|
} catch (e) {
|
||||||
console.log(error);
|
// If it fails to parse the password we should just delete the file and generate a new password, since this password is not shown to the user.
|
||||||
process.exit(1);
|
fs.unlinkSync(configCredsPath);
|
||||||
|
return getOrCreatePassword(configCredsPath);
|
||||||
}
|
}
|
||||||
cache.set("api-secret-key", response.apiSecretKey);
|
const { password } = JSON.parse(file) as ICredsConfig;
|
||||||
return response.apiSecretKey;
|
return password;
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function validateKey(apiSecretKey: string) {
|
async function getOrGenerateLocalWallet(configCredsPath: string, cliWalletPath: string) {
|
||||||
const fetch = (await import("node-fetch")).default;
|
// Get or prompt for password.
|
||||||
// TODO: CHANGE THIS TO PROD BEFORE MERGING!!!
|
const password = await getOrCreatePassword(configCredsPath);
|
||||||
const response = await fetch(
|
const wallet = new LocalWallet();
|
||||||
`https://api.thirdweb.com/v1/keys/use?scope=storage`,
|
const foundWallet = fs.existsSync(cliWalletPath);
|
||||||
{
|
|
||||||
|
if (foundWallet) {
|
||||||
|
const walletJson = fs.readFileSync(cliWalletPath, "utf8");
|
||||||
|
try {
|
||||||
|
// See if file is valid before proceeding.
|
||||||
|
JSON.parse(walletJson);
|
||||||
|
|
||||||
|
await wallet.import({
|
||||||
|
encryptedJson: walletJson,
|
||||||
|
password,
|
||||||
|
});
|
||||||
|
return wallet;
|
||||||
|
} catch (e) {
|
||||||
|
// Wallet file is not valid json, create a new one.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, generate a new wallet.
|
||||||
|
wallet.generate();
|
||||||
|
const walletExported = await wallet.export({
|
||||||
|
strategy: "encryptedJson",
|
||||||
|
password,
|
||||||
|
});
|
||||||
|
|
||||||
|
// write wallet
|
||||||
|
fs.writeFileSync(cliWalletPath, walletExported, {
|
||||||
|
encoding: "utf8",
|
||||||
|
mode: 0o600,
|
||||||
|
});
|
||||||
|
|
||||||
|
// write password
|
||||||
|
fs.writeFileSync(configCredsPath, JSON.stringify({
|
||||||
|
password: password,
|
||||||
|
}), "utf8");
|
||||||
|
|
||||||
|
return wallet;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const validateKey = async (apiSecretKey: string) => {
|
||||||
|
const apiUrl = "https://api.thirdweb.com/v1/keys/use";
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${apiUrl}?scope=storage`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"x-secret-key": apiSecretKey,
|
"x-secret-key": apiSecretKey,
|
||||||
},
|
}
|
||||||
},
|
})
|
||||||
);
|
|
||||||
|
|
||||||
const apiResponse = (await response.json()) as ApiResponse;
|
if (response.status !== 200) {
|
||||||
|
throw new Error("Unauthorized key");
|
||||||
|
}
|
||||||
|
|
||||||
if (!response.ok) {
|
} catch (error) {
|
||||||
const { error } = apiResponse;
|
throw new Error(chalk.red("Unauthorized key"));
|
||||||
throw new Error(chalk.red(error.message));
|
|
||||||
} else {
|
|
||||||
return apiSecretKey;
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
+104
-39
@@ -3,11 +3,11 @@ import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
|||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
import { exec, spawn } from "child_process";
|
import { exec, spawn } from "child_process";
|
||||||
import { Command } from "commander";
|
import { Command } from "commander";
|
||||||
|
import fs from "fs";
|
||||||
import open from "open";
|
import open from "open";
|
||||||
import os from "os";
|
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import prompts from "prompts";
|
import prompts from "prompts";
|
||||||
import Cache, { CacheEntry } from "sync-disk-cache";
|
import xdgAppPaths from "xdg-app-paths";
|
||||||
import { loginUser, logoutUser, validateKey } from "../auth";
|
import { loginUser, logoutUser, validateKey } from "../auth";
|
||||||
import { detectExtensions } from "../common/feature-detector";
|
import { detectExtensions } from "../common/feature-detector";
|
||||||
import { processProject } from "../common/processor";
|
import { processProject } from "../common/processor";
|
||||||
@@ -24,11 +24,17 @@ import { upload } from "../storage/command";
|
|||||||
const main = async () => {
|
const main = async () => {
|
||||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||||
const skipIntro = process.env.THIRDWEB_CLI_SKIP_INTRO === "true";
|
const skipIntro = process.env.THIRDWEB_CLI_SKIP_INTRO === "true";
|
||||||
|
const configDir = xdgAppPaths(".thirdweb").config();
|
||||||
|
const cacheDir = xdgAppPaths(".thirdweb").cache();
|
||||||
|
const lastVersionCheckCachePath = path.join(
|
||||||
|
cacheDir,
|
||||||
|
"last-version-check.txt",
|
||||||
|
);
|
||||||
|
const credsConfigPath = path.join(configDir, "creds.json");
|
||||||
|
const cliWalletPath = path.join(configDir, "wallet.json");
|
||||||
|
const tokenPath = path.join(configDir, "auth-token.txt");
|
||||||
|
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
const cache = new Cache("thirdweb-cli", {
|
|
||||||
location: path.join(os.homedir(), ".thirdweb", "creds"),
|
|
||||||
});
|
|
||||||
|
|
||||||
// yes this has to look like this, eliminates whitespace
|
// yes this has to look like this, eliminates whitespace
|
||||||
if (!skipIntro) {
|
if (!skipIntro) {
|
||||||
@@ -50,16 +56,32 @@ const main = async () => {
|
|||||||
.version(cliVersion, "-v, --version")
|
.version(cliVersion, "-v, --version")
|
||||||
.option("--skip-update-check", "Skip check for auto updates")
|
.option("--skip-update-check", "Skip check for auto updates")
|
||||||
.hook("preAction", async () => {
|
.hook("preAction", async () => {
|
||||||
|
const regenerateConfig = !fs.existsSync(configDir);
|
||||||
|
const regenerateCache = !fs.existsSync(cacheDir);
|
||||||
|
|
||||||
|
// Create config directory if it doesn't exist
|
||||||
|
if (regenerateConfig) {
|
||||||
|
fs.mkdirSync(configDir, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create cache directory if it doesn't exist
|
||||||
|
if (regenerateCache) {
|
||||||
|
fs.mkdirSync(cacheDir, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
if (skipIntro || program.opts().skipUpdateCheck) {
|
if (skipIntro || program.opts().skipUpdateCheck) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let shouldCheckVersion = true;
|
let shouldCheckVersion = true;
|
||||||
try {
|
try {
|
||||||
const lastCheckCache: CacheEntry = cache.get("last-version-check");
|
const lastVersionCheckCache = fs.readFileSync(
|
||||||
|
lastVersionCheckCachePath,
|
||||||
|
"utf-8",
|
||||||
|
);
|
||||||
|
|
||||||
if (lastCheckCache.isCached) {
|
if (lastVersionCheckCache) {
|
||||||
const lastVersionCheck = new Date(lastCheckCache.value);
|
const lastVersionCheck = new Date(lastVersionCheckCache);
|
||||||
// Don't check for updates if already checked within past 24 hours
|
// Don't check for updates if already checked within past 24 hours
|
||||||
if (Date.now() - lastVersionCheck.getTime() < 1000 * 60 * 60 * 24) {
|
if (Date.now() - lastVersionCheck.getTime() < 1000 * 60 * 60 * 24) {
|
||||||
shouldCheckVersion = false;
|
shouldCheckVersion = false;
|
||||||
@@ -88,7 +110,14 @@ const main = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Set cache to prevent checking for updates again for 24 hours
|
// Set cache to prevent checking for updates again for 24 hours
|
||||||
cache.set("last-version-check", new Date().toISOString());
|
fs.writeFileSync(
|
||||||
|
lastVersionCheckCachePath,
|
||||||
|
new Date().toISOString(),
|
||||||
|
{
|
||||||
|
encoding: "utf-8",
|
||||||
|
mode: 0o600,
|
||||||
|
},
|
||||||
|
);
|
||||||
} catch {
|
} catch {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
@@ -300,17 +329,22 @@ const main = async () => {
|
|||||||
"Deploy a dynamic smart contract made up of extensions to blockchains",
|
"Deploy a dynamic smart contract made up of extensions to blockchains",
|
||||||
)
|
)
|
||||||
.option("--zksync", "Deploy on ZKSync")
|
.option("--zksync", "Deploy on ZKSync")
|
||||||
.option("-k, --key <key>", "API key to authorize usage")
|
.option("-k, --key <key>", "API secret key to authorize usage")
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
let apiSecretKey = "";
|
let secretKey = "";
|
||||||
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
||||||
if (!options.key) {
|
if (!options.key) {
|
||||||
apiSecretKey = await loginUser(cache);
|
await loginUser({
|
||||||
|
credsConfigPath,
|
||||||
|
cliWalletPath,
|
||||||
|
tokenPath,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Don't need to validate anymore? Also, should probably rely on the underlying service to throw that error.
|
||||||
await validateKey(options.key);
|
await validateKey(options.key);
|
||||||
apiSecretKey = options.key;
|
secretKey = options.key;
|
||||||
}
|
}
|
||||||
const url = await deploy(options, apiSecretKey);
|
const url = await deploy(options, secretKey);
|
||||||
if (url && !options.ci) {
|
if (url && !options.ci) {
|
||||||
await open(url);
|
await open(url);
|
||||||
}
|
}
|
||||||
@@ -332,20 +366,25 @@ const main = async () => {
|
|||||||
.option("--dry-run", "dry run (skip actually publishing)")
|
.option("--dry-run", "dry run (skip actually publishing)")
|
||||||
.option("-d, --debug", "show debug logs")
|
.option("-d, --debug", "show debug logs")
|
||||||
.option("--ci", "Continuous Integration mode")
|
.option("--ci", "Continuous Integration mode")
|
||||||
.option("-k, --key <key>", "API key to authorize usage")
|
.option("-k, --key <key>", "API secret key to authorize usage")
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
let apiSecretKey = "";
|
let secretKey = "";
|
||||||
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
||||||
if (!options.key) {
|
if (!options.key) {
|
||||||
apiSecretKey = await loginUser(cache);
|
await loginUser({
|
||||||
|
credsConfigPath,
|
||||||
|
cliWalletPath,
|
||||||
|
tokenPath,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Don't need to validate anymore? Also, should probably rely on the underlying service to throw that error.
|
||||||
await validateKey(options.key);
|
await validateKey(options.key);
|
||||||
apiSecretKey = options.key;
|
secretKey = options.key;
|
||||||
}
|
}
|
||||||
logger.warn(
|
logger.warn(
|
||||||
"'release' is deprecated and will be removed in a future update. Please use 'publish' instead.",
|
"'release' is deprecated and will be removed in a future update. Please use 'publish' instead.",
|
||||||
);
|
);
|
||||||
const url = await processProject(options, "publish", apiSecretKey);
|
const url = await processProject(options, "publish", secretKey);
|
||||||
info(
|
info(
|
||||||
`Open this link to publish your contracts: ${chalk.blueBright(
|
`Open this link to publish your contracts: ${chalk.blueBright(
|
||||||
url.toString(),
|
url.toString(),
|
||||||
@@ -374,17 +413,22 @@ const main = async () => {
|
|||||||
.option("--dry-run", "dry run (skip actually publishing)")
|
.option("--dry-run", "dry run (skip actually publishing)")
|
||||||
.option("-d, --debug", "show debug logs")
|
.option("-d, --debug", "show debug logs")
|
||||||
.option("--ci", "Continuous Integration mode")
|
.option("--ci", "Continuous Integration mode")
|
||||||
.option("-k, --key <key>", "API key to authorize usage")
|
.option("-k, --key <key>", "API secret key to authorize usage")
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
let apiSecretKey = "";
|
let secretKey = "";
|
||||||
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
||||||
if (!options.key) {
|
if (!options.key) {
|
||||||
apiSecretKey = await loginUser(cache);
|
await loginUser({
|
||||||
|
credsConfigPath,
|
||||||
|
cliWalletPath,
|
||||||
|
tokenPath,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Don't need to validate anymore? Also, should probably rely on the underlying service to throw that error.
|
||||||
await validateKey(options.key);
|
await validateKey(options.key);
|
||||||
apiSecretKey = options.key;
|
secretKey = options.key;
|
||||||
}
|
}
|
||||||
const url = await processProject(options, "publish", apiSecretKey);
|
const url = await processProject(options, "publish", secretKey);
|
||||||
info(
|
info(
|
||||||
`Open this link to publish your contracts: ${chalk.blueBright(
|
`Open this link to publish your contracts: ${chalk.blueBright(
|
||||||
url.toString(),
|
url.toString(),
|
||||||
@@ -399,19 +443,31 @@ const main = async () => {
|
|||||||
.command("upload")
|
.command("upload")
|
||||||
.description("Upload any file or directory to decentralized storage (IPFS)")
|
.description("Upload any file or directory to decentralized storage (IPFS)")
|
||||||
.argument("[upload]", "path to file or directory to upload")
|
.argument("[upload]", "path to file or directory to upload")
|
||||||
.option("-k, --key <key>", "API key to authorize usage")
|
.option("-k, --key <key>", "API secret key to authorize usage")
|
||||||
.action(async (_path, options) => {
|
.action(async (_path, options) => {
|
||||||
let apiSecretKey = "";
|
let secretKey = "";
|
||||||
|
let storage: ThirdwebStorage;
|
||||||
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
||||||
if (!options.key) {
|
if (!options.key) {
|
||||||
apiSecretKey = await loginUser(cache);
|
await loginUser({
|
||||||
|
credsConfigPath,
|
||||||
|
cliWalletPath,
|
||||||
|
tokenPath,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Don't need to validate anymore? Also, should probably rely on the underlying service to throw that error.
|
||||||
await validateKey(options.key);
|
await validateKey(options.key);
|
||||||
apiSecretKey = options.key;
|
secretKey = options.key;
|
||||||
}
|
}
|
||||||
const storage = new ThirdwebStorage({
|
|
||||||
secretKey: apiSecretKey,
|
if (secretKey) {
|
||||||
});
|
storage = new ThirdwebStorage({
|
||||||
|
secretKey,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storage = new ThirdwebStorage();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const uri = await upload(storage, _path);
|
const uri = await upload(storage, _path);
|
||||||
info(
|
info(
|
||||||
@@ -438,7 +494,7 @@ const main = async () => {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
logger.error(chalk.redBright("Failed to upload files"), err);
|
logger.error(chalk.redBright(err.message ? err.message : err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -460,17 +516,22 @@ const main = async () => {
|
|||||||
"Preload ABIs and generate types for your smart contract to strongly type the thirdweb SDK",
|
"Preload ABIs and generate types for your smart contract to strongly type the thirdweb SDK",
|
||||||
)
|
)
|
||||||
.option("-p, --path <project-path>", "path to project", ".")
|
.option("-p, --path <project-path>", "path to project", ".")
|
||||||
.option("-k, --key <key>", "API key to authorize usage")
|
.option("-k, --key <key>", "API secret key to authorize usage")
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
let apiSecretKey = "";
|
let secretKey = "";
|
||||||
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
// If no key is passed in, prompt the user to login. If it is passed in, use it.
|
||||||
if (!options.key) {
|
if (!options.key) {
|
||||||
apiSecretKey = await loginUser(cache);
|
await loginUser({
|
||||||
|
credsConfigPath,
|
||||||
|
cliWalletPath,
|
||||||
|
tokenPath,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// Don't need to validate anymore? Also, should probably rely on the underlying service to throw that error.
|
||||||
await validateKey(options.key);
|
await validateKey(options.key);
|
||||||
apiSecretKey = options.key;
|
secretKey = options.key;
|
||||||
}
|
}
|
||||||
await generate(options, apiSecretKey);
|
await generate(options, secretKey);
|
||||||
});
|
});
|
||||||
|
|
||||||
program
|
program
|
||||||
@@ -480,7 +541,11 @@ const main = async () => {
|
|||||||
)
|
)
|
||||||
.option("-n, --new", "Login with a new API secret key", false)
|
.option("-n, --new", "Login with a new API secret key", false)
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
await loginUser(cache, options, true);
|
await loginUser({
|
||||||
|
credsConfigPath,
|
||||||
|
cliWalletPath,
|
||||||
|
tokenPath,
|
||||||
|
}, options, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
program
|
program
|
||||||
@@ -489,7 +554,7 @@ const main = async () => {
|
|||||||
"Logout of the thirdweb CLI, effectively removing your API secret key from your machine",
|
"Logout of the thirdweb CLI, effectively removing your API secret key from your machine",
|
||||||
)
|
)
|
||||||
.action(async () => {
|
.action(async () => {
|
||||||
await logoutUser(cache);
|
await logoutUser(credsConfigPath, tokenPath, cliWalletPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
await program.parseAsync();
|
await program.parseAsync();
|
||||||
|
|||||||
@@ -32,12 +32,18 @@ import {
|
|||||||
export async function processProject(
|
export async function processProject(
|
||||||
options: any,
|
options: any,
|
||||||
command: "deploy" | "publish",
|
command: "deploy" | "publish",
|
||||||
apiSecretKey: string,
|
secretKey: string,
|
||||||
) {
|
) {
|
||||||
// TODO: allow overriding the default storage
|
// TODO: allow overriding the default storage
|
||||||
const storage = new ThirdwebStorage({
|
let storage: ThirdwebStorage;
|
||||||
secretKey: apiSecretKey,
|
if (secretKey) {
|
||||||
});
|
storage = new ThirdwebStorage({
|
||||||
|
secretKey,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Since the auth key is being set in the global context, we don't need to pass anything here.
|
||||||
|
storage = new ThirdwebStorage();
|
||||||
|
}
|
||||||
|
|
||||||
logger.setSettings({
|
logger.setSettings({
|
||||||
minLevel: options.debug ? "debug" : "info",
|
minLevel: options.debug ? "debug" : "info",
|
||||||
@@ -240,7 +246,7 @@ export async function processProject(
|
|||||||
} else {
|
} else {
|
||||||
const deployArgs: RouterParams = await formatToExtensions(
|
const deployArgs: RouterParams = await formatToExtensions(
|
||||||
selectedContracts,
|
selectedContracts,
|
||||||
apiSecretKey,
|
secretKey,
|
||||||
);
|
);
|
||||||
|
|
||||||
const outputDeployArgs = JSON.stringify(deployArgs, undefined, 2);
|
const outputDeployArgs = JSON.stringify(deployArgs, undefined, 2);
|
||||||
@@ -345,9 +351,9 @@ export async function processProject(
|
|||||||
loader.succeed("Upload successful");
|
loader.succeed("Upload successful");
|
||||||
|
|
||||||
return getUrl(combinedURIs, command);
|
return getUrl(combinedURIs, command);
|
||||||
} catch (e) {
|
} catch (err: any) {
|
||||||
loader.fail("Error uploading metadata");
|
loader.fail("Error uploading metadata");
|
||||||
throw e;
|
throw new Error(err.message ? err.message : err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,8 +362,8 @@ export function getUrl(hashes: string[], command: string) {
|
|||||||
if (hashes.length === 1) {
|
if (hashes.length === 1) {
|
||||||
url = new URL(
|
url = new URL(
|
||||||
THIRDWEB_URL +
|
THIRDWEB_URL +
|
||||||
`/contracts/${command}/` +
|
`/contracts/${command}/` +
|
||||||
encodeURIComponent(hashes[0].replace("ipfs://", "")),
|
encodeURIComponent(hashes[0].replace("ipfs://", "")),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
url = new URL(THIRDWEB_URL + "/contracts/" + command);
|
url = new URL(THIRDWEB_URL + "/contracts/" + command);
|
||||||
@@ -370,14 +376,20 @@ export function getUrl(hashes: string[], command: string) {
|
|||||||
|
|
||||||
async function formatToExtensions(
|
async function formatToExtensions(
|
||||||
contracts: ContractPayload[],
|
contracts: ContractPayload[],
|
||||||
apiSecretKey: string,
|
secretKey: string,
|
||||||
): Promise<{
|
): Promise<{
|
||||||
extensions: Extension[];
|
extensions: Extension[];
|
||||||
extensionDeployArgs: ExtensionDeployArgs[];
|
extensionDeployArgs: ExtensionDeployArgs[];
|
||||||
}> {
|
}> {
|
||||||
const storage = new ThirdwebStorage({
|
let storage: ThirdwebStorage;
|
||||||
secretKey: apiSecretKey,
|
if (secretKey) {
|
||||||
});
|
storage = new ThirdwebStorage({
|
||||||
|
secretKey,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Since the auth key is being set in the global context, we don't need to pass anything here.
|
||||||
|
storage = new ThirdwebStorage();
|
||||||
|
}
|
||||||
const extensions: Extension[] = [];
|
const extensions: Extension[] = [];
|
||||||
const extensionDeployArgs: ExtensionDeployArgs[] = [];
|
const extensionDeployArgs: ExtensionDeployArgs[] = [];
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ export async function twCreate(
|
|||||||
if (options.reactNative) {
|
if (options.reactNative) {
|
||||||
framework = "react-native";
|
framework = "react-native";
|
||||||
}
|
}
|
||||||
|
if (options.pwaVite) {
|
||||||
|
framework = "pwa-vite";
|
||||||
|
}
|
||||||
|
|
||||||
if (options.solana) {
|
if (options.solana) {
|
||||||
chain = "solana";
|
chain = "solana";
|
||||||
@@ -239,6 +242,7 @@ export async function twCreate(
|
|||||||
{ title: "Next.js", value: "next" },
|
{ title: "Next.js", value: "next" },
|
||||||
{ title: "Create React App", value: "cra" },
|
{ title: "Create React App", value: "cra" },
|
||||||
{ title: "Vite", value: "vite" },
|
{ title: "Vite", value: "vite" },
|
||||||
|
{ title: "PWA Vite", value: "pwa-vite" },
|
||||||
{ title: "React Native", value: "react-native" },
|
{ title: "React Native", value: "react-native" },
|
||||||
{ title: "Node.js", value: "node" },
|
{ title: "Node.js", value: "node" },
|
||||||
{ title: "Express", value: "express" },
|
{ title: "Express", value: "express" },
|
||||||
@@ -265,6 +269,8 @@ export async function twCreate(
|
|||||||
if (typeof res.project === "string") {
|
if (typeof res.project === "string") {
|
||||||
language = res.project.trim();
|
language = res.project.trim();
|
||||||
}
|
}
|
||||||
|
} else if (framework === "pwa-vite" || framework === "pwa-next") {
|
||||||
|
language = "typescript";
|
||||||
} else {
|
} else {
|
||||||
const res = await prompts({
|
const res = await prompts({
|
||||||
type: "select",
|
type: "select",
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export async function createApp({
|
|||||||
}
|
}
|
||||||
|
|
||||||
let startOrDev: string | undefined;
|
let startOrDev: string | undefined;
|
||||||
if (framework && (framework === "next" || framework === "vite")) {
|
if (framework && (framework.includes("next") || framework.includes("vite"))) {
|
||||||
startOrDev = "dev";
|
startOrDev = "dev";
|
||||||
} else if (template) {
|
} else if (template) {
|
||||||
startOrDev = await getStartOrDev(template);
|
startOrDev = await getStartOrDev(template);
|
||||||
|
|||||||
@@ -8,11 +8,17 @@ import { upload } from "../storage/command";
|
|||||||
export async function deployApp(
|
export async function deployApp(
|
||||||
distPath = "dist",
|
distPath = "dist",
|
||||||
projectPath = ".",
|
projectPath = ".",
|
||||||
apiSecretKey: string,
|
secretKey: string,
|
||||||
) {
|
) {
|
||||||
const storage = new ThirdwebStorage({
|
let storage: ThirdwebStorage;
|
||||||
secretKey: apiSecretKey,
|
if (secretKey) {
|
||||||
});
|
storage = new ThirdwebStorage({
|
||||||
|
secretKey,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Since the auth key is being set in the global context, we don't need to pass anything here.
|
||||||
|
storage = new ThirdwebStorage();
|
||||||
|
}
|
||||||
const detectedPackageManager = await detectPackageManager(projectPath, {});
|
const detectedPackageManager = await detectPackageManager(projectPath, {});
|
||||||
const detectedFramework = await detectFramework(
|
const detectedFramework = await detectFramework(
|
||||||
projectPath,
|
projectPath,
|
||||||
@@ -74,8 +80,8 @@ export async function deployApp(
|
|||||||
"ipfs://",
|
"ipfs://",
|
||||||
"https://cf-ipfs.com/ipfs/",
|
"https://cf-ipfs.com/ipfs/",
|
||||||
)}`;
|
)}`;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
console.error("Can't upload project", err);
|
console.error(err.message ? err.message : err);
|
||||||
return Promise.reject("Can't upload project");
|
return Promise.reject("Can't upload project");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ type DeployOptions = {
|
|||||||
distPath?: string;
|
distPath?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function deploy(options: DeployOptions, apiSecretKey: string) {
|
export async function deploy(options: DeployOptions, secretKey: string) {
|
||||||
if (options.name) {
|
if (options.name) {
|
||||||
const url = generateDashboardUrl(options.name, options.contractVersion);
|
const url = generateDashboardUrl(options.name, options.contractVersion);
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ export async function deploy(options: DeployOptions, apiSecretKey: string) {
|
|||||||
|
|
||||||
if (options.app) {
|
if (options.app) {
|
||||||
try {
|
try {
|
||||||
const url = await deployApp(options.distPath, options.path, apiSecretKey);
|
const url = await deployApp(options.distPath, options.path, secretKey);
|
||||||
info(`Here is the link to your app: ${chalk.blueBright(url.toString())}`);
|
info(`Here is the link to your app: ${chalk.blueBright(url.toString())}`);
|
||||||
return url.toString();
|
return url.toString();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -44,7 +44,7 @@ export async function deploy(options: DeployOptions, apiSecretKey: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = await processProject(options, "deploy", apiSecretKey);
|
const url = await processProject(options, "deploy", secretKey);
|
||||||
info(
|
info(
|
||||||
`Open this link to deploy your contracts: ${chalk.blueBright(
|
`Open this link to deploy your contracts: ${chalk.blueBright(
|
||||||
url.toString(),
|
url.toString(),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { info } from "../core/helpers/logger";
|
|||||||
import { GenerateOptions, ThirdwebConfig } from "./types";
|
import { GenerateOptions, ThirdwebConfig } from "./types";
|
||||||
import { CHAIN_OPTIONS, getContractsForAddresses } from "./utils";
|
import { CHAIN_OPTIONS, getContractsForAddresses } from "./utils";
|
||||||
|
|
||||||
export async function generate(options: GenerateOptions, apiSecretKey: string) {
|
export async function generate(options: GenerateOptions, secretKey: string) {
|
||||||
const projectPath: string = options.path?.replace(/\/$/, "") || ".";
|
const projectPath: string = options.path?.replace(/\/$/, "") || ".";
|
||||||
let contracts: DeployedContract[] = [];
|
let contracts: DeployedContract[] = [];
|
||||||
|
|
||||||
@@ -55,8 +55,7 @@ export async function generate(options: GenerateOptions, apiSecretKey: string) {
|
|||||||
const numberOfNewContracts =
|
const numberOfNewContracts =
|
||||||
contracts.length - thirdwebConfig.contracts.length;
|
contracts.length - thirdwebConfig.contracts.length;
|
||||||
info(
|
info(
|
||||||
`Updated thirdweb.json with ${numberOfNewContracts} new contract${
|
`Updated thirdweb.json with ${numberOfNewContracts} new contract${numberOfNewContracts === 1 ? "" : "s"
|
||||||
numberOfNewContracts === 1 ? "" : "s"
|
|
||||||
}`,
|
}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -86,19 +85,22 @@ export async function generate(options: GenerateOptions, apiSecretKey: string) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
info(
|
info(
|
||||||
`Created a thirdweb.json file with configuration for ${
|
`Created a thirdweb.json file with configuration for ${contracts.length
|
||||||
contracts.length
|
} contract${contracts.length === 1 ? "" : "s"
|
||||||
} contract${
|
|
||||||
contracts.length === 1 ? "" : "s"
|
|
||||||
} detected in your project.\n\n - You can also update this configuration manually by editing the file.\n`,
|
} detected in your project.\n\n - You can also update this configuration manually by editing the file.\n`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to download the ABI for each contract
|
// Attempt to download the ABI for each contract
|
||||||
ora(`Downloading ABIs for contracts configured in 'thirdweb.json'`).info();
|
ora(`Downloading ABIs for contracts configured in 'thirdweb.json'`).info();
|
||||||
const storage = new ThirdwebStorage({
|
let storage: ThirdwebStorage;
|
||||||
secretKey: apiSecretKey,
|
if (secretKey) {
|
||||||
});
|
storage = new ThirdwebStorage({
|
||||||
|
secretKey,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
storage = new ThirdwebStorage();
|
||||||
|
}
|
||||||
const metadata: {
|
const metadata: {
|
||||||
address: string;
|
address: string;
|
||||||
metadata: Awaited<ReturnType<typeof fetchContractMetadataFromAddress>>;
|
metadata: Awaited<ReturnType<typeof fetchContractMetadataFromAddress>>;
|
||||||
@@ -187,8 +189,7 @@ export async function generate(options: GenerateOptions, apiSecretKey: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ora(
|
ora(
|
||||||
`Downloaded and cached ABIs for ${metadata.length} smart contract${
|
`Downloaded and cached ABIs for ${metadata.length} smart contract${metadata.length === 1 ? "" : "s"
|
||||||
metadata.length === 1 ? "" : "s"
|
|
||||||
}`,
|
}`,
|
||||||
).succeed();
|
).succeed();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { DeployedContract } from "@thirdweb-dev/sdk";
|
import { DeployedContract } from "@thirdweb-dev/sdk";
|
||||||
|
|
||||||
|
export type AuthConfig = {
|
||||||
|
secretKey?: string;
|
||||||
|
authToken?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type ThirdwebConfig = {
|
export type ThirdwebConfig = {
|
||||||
chainIds: number[];
|
chainIds: number[];
|
||||||
contracts: DeployedContract[];
|
contracts: DeployedContract[];
|
||||||
|
|||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
declare module globalThis {
|
||||||
|
// eslint-disable-next-line no-var
|
||||||
|
var TW_AUTH_TOKEN: string;
|
||||||
|
}
|
||||||
@@ -4,6 +4,11 @@ import {
|
|||||||
PackageManagerType,
|
PackageManagerType,
|
||||||
} from "../core/types/ProjectType";
|
} from "../core/types/ProjectType";
|
||||||
|
|
||||||
|
export type ICredsConfig = {
|
||||||
|
password: string;
|
||||||
|
expiration: number;
|
||||||
|
}
|
||||||
|
|
||||||
export type IProcessContractAppTypeArgs = {
|
export type IProcessContractAppTypeArgs = {
|
||||||
detectedPackageManager: PackageManagerType;
|
detectedPackageManager: PackageManagerType;
|
||||||
thirdwebDepsToUpdate: Set<string>;
|
thirdwebDepsToUpdate: Set<string>;
|
||||||
@@ -43,4 +48,4 @@ export type ApiResponse = {
|
|||||||
statusCode: number;
|
statusCode: number;
|
||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -4,6 +4,11 @@ import path from "path";
|
|||||||
import { PackageManagerType } from "../core/types/ProjectType";
|
import { PackageManagerType } from "../core/types/ProjectType";
|
||||||
import { runCommand } from "../create/helpers/run-command";
|
import { runCommand } from "../create/helpers/run-command";
|
||||||
import { IProcessAppTypeArgs, IProcessContractAppTypeArgs } from "./types";
|
import { IProcessAppTypeArgs, IProcessContractAppTypeArgs } from "./types";
|
||||||
|
import crypto from "crypto";
|
||||||
|
|
||||||
|
export function generateStateParameter(length: number) {
|
||||||
|
return crypto.randomBytes(length).toString("hex");
|
||||||
|
}
|
||||||
|
|
||||||
export function convertDependenciesToStringFormat(dependenciesObject: object) {
|
export function convertDependenciesToStringFormat(dependenciesObject: object) {
|
||||||
return Object.entries(dependenciesObject).map(([pkg, versionDetails]) => {
|
return Object.entries(dependenciesObject).map(([pkg, versionDetails]) => {
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ export async function upload(
|
|||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
uri = await storage.upload(file, { uploadWithoutDirectory: true });
|
uri = await storage.upload(file, { uploadWithoutDirectory: true });
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
spin.fail("Failed to upload file to IPFS.");
|
spin.fail("Failed to upload file to IPFS.");
|
||||||
return Promise.reject(err);
|
return Promise.reject(err.message ? err.message : err);
|
||||||
}
|
}
|
||||||
spin.succeed("Successfully uploaded file to IPFS.");
|
spin.succeed("Successfully uploaded file to IPFS.");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @thirdweb-dev/contracts-js
|
# @thirdweb-dev/contracts-js
|
||||||
|
|
||||||
|
## 1.3.12
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1518](https://github.com/thirdweb-dev/js/pull/1518) [`34a3bb8a`](https://github.com/thirdweb-dev/js/commit/34a3bb8ae3c1d7a506e5568a9e79ab7e469557a8) Thanks [@nkrishang](https://github.com/nkrishang)! - Update contracts package
|
||||||
|
|
||||||
## 1.3.11
|
## 1.3.11
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/contracts-js",
|
"name": "@thirdweb-dev/contracts-js",
|
||||||
"version": "1.3.11",
|
"version": "1.3.12",
|
||||||
"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,7 +10,7 @@
|
|||||||
"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.8.3"
|
"@thirdweb-dev/contracts": "3.9.3-0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.22.9",
|
"@babel/preset-env": "^7.22.9",
|
||||||
|
|||||||
@@ -1,5 +1,51 @@
|
|||||||
# @thirdweb-dev/react-core
|
# @thirdweb-dev/react-core
|
||||||
|
|
||||||
|
## 3.14.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`eb463735`](https://github.com/thirdweb-dev/js/commit/eb463735e2f784cd1d212a982835af95cf60766b), [`adec589e`](https://github.com/thirdweb-dev/js/commit/adec589ead8ceff1b57169e05a3e6733b4652cc7), [`b30566c6`](https://github.com/thirdweb-dev/js/commit/b30566c68436ad94ddc938a380eccc13a8a7147d), [`0f027069`](https://github.com/thirdweb-dev/js/commit/0f027069064bebe647f9235fa86ef7f165ffc7b3), [`f5aed34d`](https://github.com/thirdweb-dev/js/commit/f5aed34d3c71065c3f45df2c1eb84ba9c36162d5)]:
|
||||||
|
- @thirdweb-dev/wallets@1.1.21
|
||||||
|
- @thirdweb-dev/sdk@3.10.57
|
||||||
|
- @thirdweb-dev/chains@0.1.49
|
||||||
|
- @thirdweb-dev/storage@1.2.9
|
||||||
|
- @thirdweb-dev/auth@3.2.38
|
||||||
|
|
||||||
|
## 3.14.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`f59b729f`](https://github.com/thirdweb-dev/js/commit/f59b729f8b09aa86655b8e8a70fba644fc52009b), [`911e14fc`](https://github.com/thirdweb-dev/js/commit/911e14fcac743b07fa1a66440c72d662c08e971c), [`cd6b07b5`](https://github.com/thirdweb-dev/js/commit/cd6b07b591606d2671794cebebf8edcb59076c32)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.56
|
||||||
|
- @thirdweb-dev/chains@0.1.48
|
||||||
|
- @thirdweb-dev/wallets@1.1.20
|
||||||
|
- @thirdweb-dev/auth@3.2.37
|
||||||
|
|
||||||
|
## 3.14.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1522](https://github.com/thirdweb-dev/js/pull/1522) [`088547f7`](https://github.com/thirdweb-dev/js/commit/088547f763294f1641c01ffe1aabac585f255dc0) Thanks [@MananTank](https://github.com/MananTank)! - - New prop `switchToActiveChain` added to `ConnectWallet`` component to show "Switch Network" button if wallet is not connected to the `activeChain`passed to the`ThirdwebProvider`
|
||||||
|
- Add max-height on `ConnectWallet` modal
|
||||||
|
- Local Wallet UI adjustments
|
||||||
|
- Updated dependencies [[`586e91db`](https://github.com/thirdweb-dev/js/commit/586e91dbe610588cc7b24fade59172fed6481074), [`34a3bb8a`](https://github.com/thirdweb-dev/js/commit/34a3bb8ae3c1d7a506e5568a9e79ab7e469557a8), [`91f0245b`](https://github.com/thirdweb-dev/js/commit/91f0245be78ae523e1faea26b1032bfb283467d9), [`f65578d6`](https://github.com/thirdweb-dev/js/commit/f65578d637decc8b87cada5b5b0c8c504064d9d5), [`5a373a75`](https://github.com/thirdweb-dev/js/commit/5a373a75090da7e1e05724ed1a3a3a6aa9f7fd21), [`ae74b8ef`](https://github.com/thirdweb-dev/js/commit/ae74b8ef6200dba8affa8b52e7d834c5552350d0), [`bc003c2f`](https://github.com/thirdweb-dev/js/commit/bc003c2fef33fcf7ce5981d8634911ac4bcaa927), [`447d9846`](https://github.com/thirdweb-dev/js/commit/447d984653f77af6860ae907072e768b584b263d), [`f65578d6`](https://github.com/thirdweb-dev/js/commit/f65578d637decc8b87cada5b5b0c8c504064d9d5)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.55
|
||||||
|
- @thirdweb-dev/chains@0.1.47
|
||||||
|
- @thirdweb-dev/storage@1.2.8
|
||||||
|
- @thirdweb-dev/wallets@1.1.19
|
||||||
|
- @thirdweb-dev/auth@3.2.36
|
||||||
|
|
||||||
|
## 3.14.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`184c325a`](https://github.com/thirdweb-dev/js/commit/184c325ab2ef028022a050c4274f2ab12b1a3a7f), [`046c9ad6`](https://github.com/thirdweb-dev/js/commit/046c9ad604587ff79bf028c4fe7b1f9c94f4ea54), [`c12f0874`](https://github.com/thirdweb-dev/js/commit/c12f0874b4dac43c263c7edb20d0343c16381c34)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.46
|
||||||
|
- @thirdweb-dev/storage@1.2.7
|
||||||
|
- @thirdweb-dev/sdk@3.10.54
|
||||||
|
- @thirdweb-dev/wallets@1.1.18
|
||||||
|
- @thirdweb-dev/auth@3.2.35
|
||||||
|
|
||||||
## 3.14.34
|
## 3.14.34
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-core",
|
"name": "@thirdweb-dev/react-core",
|
||||||
"version": "3.14.34",
|
"version": "3.14.38",
|
||||||
"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",
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
"typescript": "^5.1.6"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tanstack/react-query": "^4.32.0",
|
"@tanstack/react-query": "^4.33.0",
|
||||||
"@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:*",
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ export const ThirdwebProviderCore = <TChains extends Chain[]>({
|
|||||||
autoSwitch={props.autoSwitch}
|
autoSwitch={props.autoSwitch}
|
||||||
autoConnectTimeout={props.autoConnectTimeout}
|
autoConnectTimeout={props.autoConnectTimeout}
|
||||||
clientId={props.clientId}
|
clientId={props.clientId}
|
||||||
|
activeChainSetExplicitly={!!props.activeChain}
|
||||||
>
|
>
|
||||||
<ThirdwebSDKProviderWrapper
|
<ThirdwebSDKProviderWrapper
|
||||||
queryClient={props.queryClient}
|
queryClient={props.queryClient}
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ type ThirdwebWalletContextData = {
|
|||||||
* Get wallet config object from wallet instance
|
* Get wallet config object from wallet instance
|
||||||
*/
|
*/
|
||||||
getWalletConfig: (walletInstance: WalletInstance) => WalletConfig | undefined;
|
getWalletConfig: (walletInstance: WalletInstance) => WalletConfig | undefined;
|
||||||
|
activeChainSetExplicitly: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ThirdwebWalletContext = /* @__PURE__ */ createContext<
|
const ThirdwebWalletContext = /* @__PURE__ */ createContext<
|
||||||
@@ -106,6 +107,7 @@ export function ThirdwebWalletProvider(
|
|||||||
autoSwitch?: boolean;
|
autoSwitch?: boolean;
|
||||||
autoConnectTimeout?: number;
|
autoConnectTimeout?: number;
|
||||||
clientId?: string;
|
clientId?: string;
|
||||||
|
activeChainSetExplicitly: boolean;
|
||||||
}>,
|
}>,
|
||||||
) {
|
) {
|
||||||
const [signer, setSigner] = useState<Signer | undefined>(undefined);
|
const [signer, setSigner] = useState<Signer | undefined>(undefined);
|
||||||
@@ -480,6 +482,7 @@ export function ThirdwebWalletProvider(
|
|||||||
getWalletConfig: (walletInstance: WalletInstance) => {
|
getWalletConfig: (walletInstance: WalletInstance) => {
|
||||||
return walletInstanceToConfig.get(walletInstance);
|
return walletInstanceToConfig.get(walletInstance);
|
||||||
},
|
},
|
||||||
|
activeChainSetExplicitly: props.activeChainSetExplicitly,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import {
|
|||||||
} from "@tanstack/react-query";
|
} from "@tanstack/react-query";
|
||||||
import { getCachedAbiForContract, TransactionResult } from "@thirdweb-dev/sdk";
|
import { getCachedAbiForContract, TransactionResult } from "@thirdweb-dev/sdk";
|
||||||
import type {
|
import type {
|
||||||
Abi,
|
|
||||||
CommonContractSchemaInput,
|
CommonContractSchemaInput,
|
||||||
ContractEvent,
|
ContractEvent,
|
||||||
ContractForPrebuiltContractType,
|
ContractForPrebuiltContractType,
|
||||||
@@ -33,6 +32,7 @@ import type {
|
|||||||
ThirdwebSDK,
|
ThirdwebSDK,
|
||||||
ValidContractInstance,
|
ValidContractInstance,
|
||||||
BaseContractForAddress,
|
BaseContractForAddress,
|
||||||
|
PublishedMetadata,
|
||||||
} from "@thirdweb-dev/sdk";
|
} from "@thirdweb-dev/sdk";
|
||||||
import type { CallOverrides, ContractInterface, providers } from "ethers";
|
import type { CallOverrides, ContractInterface, providers } from "ethers";
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
@@ -88,19 +88,11 @@ export const contractType = {
|
|||||||
|
|
||||||
// end contract type
|
// end contract type
|
||||||
|
|
||||||
type FetchCompilerMetadataReturnType = {
|
|
||||||
name: string;
|
|
||||||
metadata: Record<string, any>;
|
|
||||||
abi: Abi;
|
|
||||||
info: Record<string, any>;
|
|
||||||
licenses: string[];
|
|
||||||
};
|
|
||||||
|
|
||||||
// contract compiler metadata
|
// contract compiler metadata
|
||||||
function fetchCompilerMetadata(
|
function fetchCompilerMetadata(
|
||||||
contractAddress: RequiredParam<ContractAddress>,
|
contractAddress: RequiredParam<ContractAddress>,
|
||||||
sdk: RequiredParam<ThirdwebSDK>,
|
sdk: RequiredParam<ThirdwebSDK>,
|
||||||
): Promise<FetchCompilerMetadataReturnType> | null {
|
): Promise<PublishedMetadata> | null {
|
||||||
if (!contractAddress || !sdk) {
|
if (!contractAddress || !sdk) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -114,7 +106,7 @@ function fetchCompilerMetadata(
|
|||||||
|
|
||||||
export function useCompilerMetadata(
|
export function useCompilerMetadata(
|
||||||
contractAddress: RequiredParam<ContractAddress>,
|
contractAddress: RequiredParam<ContractAddress>,
|
||||||
): UseQueryResult<FetchCompilerMetadataReturnType | null> {
|
): UseQueryResult<PublishedMetadata | null> {
|
||||||
const sdk = useSDK();
|
const sdk = useSDK();
|
||||||
|
|
||||||
return useQueryWithNetwork(
|
return useQueryWithNetwork(
|
||||||
|
|||||||
@@ -251,6 +251,9 @@ export { ThirdwebSDKProvider } from "./providers/thirdweb-sdk-provider";
|
|||||||
export { useSDK, useSDKChainId } from "./hooks/useSDK";
|
export { useSDK, useSDKChainId } from "./hooks/useSDK";
|
||||||
export type { ThirdwebSDKProviderProps } from "./providers/types";
|
export type { ThirdwebSDKProviderProps } from "./providers/types";
|
||||||
|
|
||||||
|
// utils
|
||||||
|
export { invalidateContractAndBalances } from "./utils/cache-keys";
|
||||||
|
|
||||||
// types
|
// types
|
||||||
export type {
|
export type {
|
||||||
Chain,
|
Chain,
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# @thirdweb-dev/react-native-compat
|
# @thirdweb-dev/react-native-compat
|
||||||
|
|
||||||
|
## 0.2.57
|
||||||
|
|
||||||
|
## 0.2.56
|
||||||
|
|
||||||
|
## 0.2.55
|
||||||
|
|
||||||
|
## 0.2.54
|
||||||
|
|
||||||
## 0.2.53
|
## 0.2.53
|
||||||
|
|
||||||
## 0.2.52
|
## 0.2.52
|
||||||
|
|||||||
@@ -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.53",
|
"version": "0.2.57",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,5 +1,62 @@
|
|||||||
# @thirdweb-dev/react-native
|
# @thirdweb-dev/react-native
|
||||||
|
|
||||||
|
## 0.2.57
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`eb463735`](https://github.com/thirdweb-dev/js/commit/eb463735e2f784cd1d212a982835af95cf60766b), [`adec589e`](https://github.com/thirdweb-dev/js/commit/adec589ead8ceff1b57169e05a3e6733b4652cc7), [`b30566c6`](https://github.com/thirdweb-dev/js/commit/b30566c68436ad94ddc938a380eccc13a8a7147d), [`0f027069`](https://github.com/thirdweb-dev/js/commit/0f027069064bebe647f9235fa86ef7f165ffc7b3), [`f5aed34d`](https://github.com/thirdweb-dev/js/commit/f5aed34d3c71065c3f45df2c1eb84ba9c36162d5)]:
|
||||||
|
- @thirdweb-dev/wallets@1.1.21
|
||||||
|
- @thirdweb-dev/sdk@3.10.57
|
||||||
|
- @thirdweb-dev/chains@0.1.49
|
||||||
|
- @thirdweb-dev/storage@1.2.9
|
||||||
|
- @thirdweb-dev/react-core@3.14.38
|
||||||
|
|
||||||
|
## 0.2.56
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1536](https://github.com/thirdweb-dev/js/pull/1536) [`387dddbd`](https://github.com/thirdweb-dev/js/commit/387dddbd87ff6c1a53ffaf663564a44b89a3a2a5) Thanks [@iketw](https://github.com/iketw)! - Adds switchToActiveChain prop to the ConnectWallet button.
|
||||||
|
|
||||||
|
When set to true it will show a "Switch Network" button if the wallet
|
||||||
|
is connected to a different chain than the `activeChain` provided in `ThirdwebProvider`
|
||||||
|
|
||||||
|
**Note:** IF you support multiple networks in your app this prop should
|
||||||
|
be set to `false` to allow users to switch between networks.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
<ConnectWallet switchToActiveChain={true} />
|
||||||
|
```
|
||||||
|
|
||||||
|
- Updated dependencies [[`f59b729f`](https://github.com/thirdweb-dev/js/commit/f59b729f8b09aa86655b8e8a70fba644fc52009b), [`911e14fc`](https://github.com/thirdweb-dev/js/commit/911e14fcac743b07fa1a66440c72d662c08e971c), [`cd6b07b5`](https://github.com/thirdweb-dev/js/commit/cd6b07b591606d2671794cebebf8edcb59076c32)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.2.55
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`586e91db`](https://github.com/thirdweb-dev/js/commit/586e91dbe610588cc7b24fade59172fed6481074), [`34a3bb8a`](https://github.com/thirdweb-dev/js/commit/34a3bb8ae3c1d7a506e5568a9e79ab7e469557a8), [`91f0245b`](https://github.com/thirdweb-dev/js/commit/91f0245be78ae523e1faea26b1032bfb283467d9), [`f65578d6`](https://github.com/thirdweb-dev/js/commit/f65578d637decc8b87cada5b5b0c8c504064d9d5), [`5a373a75`](https://github.com/thirdweb-dev/js/commit/5a373a75090da7e1e05724ed1a3a3a6aa9f7fd21), [`ae74b8ef`](https://github.com/thirdweb-dev/js/commit/ae74b8ef6200dba8affa8b52e7d834c5552350d0), [`bc003c2f`](https://github.com/thirdweb-dev/js/commit/bc003c2fef33fcf7ce5981d8634911ac4bcaa927), [`447d9846`](https://github.com/thirdweb-dev/js/commit/447d984653f77af6860ae907072e768b584b263d), [`f65578d6`](https://github.com/thirdweb-dev/js/commit/f65578d637decc8b87cada5b5b0c8c504064d9d5), [`088547f7`](https://github.com/thirdweb-dev/js/commit/088547f763294f1641c01ffe1aabac585f255dc0)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
|
## 0.2.54
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`184c325a`](https://github.com/thirdweb-dev/js/commit/184c325ab2ef028022a050c4274f2ab12b1a3a7f), [`046c9ad6`](https://github.com/thirdweb-dev/js/commit/046c9ad604587ff79bf028c4fe7b1f9c94f4ea54), [`c12f0874`](https://github.com/thirdweb-dev/js/commit/c12f0874b4dac43c263c7edb20d0343c16381c34)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
## 0.2.53
|
## 0.2.53
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native",
|
"name": "@thirdweb-dev/react-native",
|
||||||
"version": "0.2.53",
|
"version": "0.2.57",
|
||||||
"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",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
"@magic-sdk/provider": "17.2.0",
|
"@magic-sdk/provider": "17.2.0",
|
||||||
"@magic-sdk/react-native-bare": "^18.5.0",
|
"@magic-sdk/react-native-bare": "^18.5.0",
|
||||||
"@shopify/restyle": "^2.4.2",
|
"@shopify/restyle": "^2.4.2",
|
||||||
"@tanstack/react-query": "^4.32.0",
|
"@tanstack/react-query": "^4.33.0",
|
||||||
"@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:*",
|
||||||
|
|||||||
@@ -3,11 +3,18 @@ import {
|
|||||||
ConnectWalletDetailsProps,
|
ConnectWalletDetailsProps,
|
||||||
WalletDetailsButton,
|
WalletDetailsButton,
|
||||||
} from "./ConnectWalletDetails/WalletDetailsButton";
|
} from "./ConnectWalletDetails/WalletDetailsButton";
|
||||||
import { useAddress } from "@thirdweb-dev/react-core";
|
import {
|
||||||
import { useEffect, useRef } from "react";
|
useAddress,
|
||||||
import { Animated } from "react-native";
|
useNetworkMismatch,
|
||||||
|
useSwitchChain,
|
||||||
|
useWalletContext,
|
||||||
|
} from "@thirdweb-dev/react-core";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import { ActivityIndicator, Animated, StyleSheet } from "react-native";
|
||||||
import { ConnectWalletButton } from "./ConnectWalletFlow/ConnectWalletButton";
|
import { ConnectWalletButton } from "./ConnectWalletFlow/ConnectWalletButton";
|
||||||
import { ConnectWalletButtonProps } from "./ConnectWalletFlow/ConnectWalletButton";
|
import { ConnectWalletButtonProps } from "./ConnectWalletFlow/ConnectWalletButton";
|
||||||
|
import BaseButton from "./base/BaseButton";
|
||||||
|
import Text from "./base/Text";
|
||||||
|
|
||||||
export type ConnectWalletProps = {
|
export type ConnectWalletProps = {
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +33,17 @@ export type ConnectWalletProps = {
|
|||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
hideTestnetFaucet?: boolean;
|
hideTestnetFaucet?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show "Switch Network" button if the wallet is connected,
|
||||||
|
* but it is not connected to the `activeChain` provided in `ThirdwebProvider`
|
||||||
|
*
|
||||||
|
* Please, note that if you support multiple networks in your app this prop should
|
||||||
|
* be set to `false` to allow users to switch between networks.
|
||||||
|
*
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
switchToActiveChain?: boolean;
|
||||||
} & ConnectWalletButtonProps;
|
} & ConnectWalletButtonProps;
|
||||||
|
|
||||||
export const ConnectWallet = ({
|
export const ConnectWallet = ({
|
||||||
@@ -35,9 +53,15 @@ export const ConnectWallet = ({
|
|||||||
modalTitle,
|
modalTitle,
|
||||||
extraRows,
|
extraRows,
|
||||||
hideTestnetFaucet,
|
hideTestnetFaucet,
|
||||||
|
switchToActiveChain,
|
||||||
}: ConnectWalletProps) => {
|
}: ConnectWalletProps) => {
|
||||||
const fadeAnim = useRef(new Animated.Value(0)).current;
|
const fadeAnim = useRef(new Animated.Value(0)).current;
|
||||||
const address = useAddress();
|
const address = useAddress();
|
||||||
|
const isNetworkMismatch = useNetworkMismatch();
|
||||||
|
const { activeChainSetExplicitly } = useWalletContext();
|
||||||
|
const { activeChain } = useWalletContext();
|
||||||
|
const switchChain = useSwitchChain();
|
||||||
|
const [switching, setSwitching] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Animated.timing(fadeAnim, {
|
Animated.timing(fadeAnim, {
|
||||||
@@ -51,12 +75,38 @@ export const ConnectWallet = ({
|
|||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<Animated.View style={{ opacity: fadeAnim }}>
|
<Animated.View style={{ opacity: fadeAnim }}>
|
||||||
{address ? (
|
{address ? (
|
||||||
<WalletDetailsButton
|
switchToActiveChain &&
|
||||||
address={address}
|
isNetworkMismatch &&
|
||||||
detailsButton={detailsButton}
|
activeChainSetExplicitly ? (
|
||||||
extraRows={extraRows}
|
<BaseButton
|
||||||
hideTestnetFaucet={hideTestnetFaucet}
|
backgroundColor="buttonBackgroundColor"
|
||||||
/>
|
onPress={async () => {
|
||||||
|
setSwitching(true);
|
||||||
|
try {
|
||||||
|
await switchChain(activeChain.chainId);
|
||||||
|
} catch {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
setSwitching(false);
|
||||||
|
}}
|
||||||
|
style={styles.connectWalletButton}
|
||||||
|
>
|
||||||
|
{switching ? (
|
||||||
|
<ActivityIndicator size="small" color="buttonTextColor" />
|
||||||
|
) : (
|
||||||
|
<Text variant="bodyLarge" color="buttonTextColor">
|
||||||
|
Switch Network
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</BaseButton>
|
||||||
|
) : (
|
||||||
|
<WalletDetailsButton
|
||||||
|
address={address}
|
||||||
|
detailsButton={detailsButton}
|
||||||
|
extraRows={extraRows}
|
||||||
|
hideTestnetFaucet={hideTestnetFaucet}
|
||||||
|
/>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<ConnectWalletButton
|
<ConnectWalletButton
|
||||||
modalTitle={modalTitle}
|
modalTitle={modalTitle}
|
||||||
@@ -68,3 +118,17 @@ export const ConnectWallet = ({
|
|||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
connectWalletButton: {
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
alignContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
borderRadius: 8,
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
paddingVertical: 10,
|
||||||
|
minWidth: 150,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,5 +1,52 @@
|
|||||||
# @thirdweb-dev/react
|
# @thirdweb-dev/react
|
||||||
|
|
||||||
|
## 3.14.38
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1532](https://github.com/thirdweb-dev/js/pull/1532) [`b29ec675`](https://github.com/thirdweb-dev/js/commit/b29ec675f9c41c49c015af2427d5402367c06c73) Thanks [@MananTank](https://github.com/MananTank)! - Export ConnectModalInline component
|
||||||
|
|
||||||
|
- [#1544](https://github.com/thirdweb-dev/js/pull/1544) [`eb463735`](https://github.com/thirdweb-dev/js/commit/eb463735e2f784cd1d212a982835af95cf60766b) Thanks [@iketw](https://github.com/iketw)! - Adds support for Rainbow's new browser extension
|
||||||
|
|
||||||
|
- Updated dependencies [[`eb463735`](https://github.com/thirdweb-dev/js/commit/eb463735e2f784cd1d212a982835af95cf60766b), [`adec589e`](https://github.com/thirdweb-dev/js/commit/adec589ead8ceff1b57169e05a3e6733b4652cc7), [`b30566c6`](https://github.com/thirdweb-dev/js/commit/b30566c68436ad94ddc938a380eccc13a8a7147d), [`0f027069`](https://github.com/thirdweb-dev/js/commit/0f027069064bebe647f9235fa86ef7f165ffc7b3), [`f5aed34d`](https://github.com/thirdweb-dev/js/commit/f5aed34d3c71065c3f45df2c1eb84ba9c36162d5)]:
|
||||||
|
- @thirdweb-dev/wallets@1.1.21
|
||||||
|
- @thirdweb-dev/sdk@3.10.57
|
||||||
|
- @thirdweb-dev/chains@0.1.49
|
||||||
|
- @thirdweb-dev/react-core@3.14.38
|
||||||
|
|
||||||
|
## 3.14.37
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`f59b729f`](https://github.com/thirdweb-dev/js/commit/f59b729f8b09aa86655b8e8a70fba644fc52009b), [`911e14fc`](https://github.com/thirdweb-dev/js/commit/911e14fcac743b07fa1a66440c72d662c08e971c), [`cd6b07b5`](https://github.com/thirdweb-dev/js/commit/cd6b07b591606d2671794cebebf8edcb59076c32)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.56
|
||||||
|
- @thirdweb-dev/chains@0.1.48
|
||||||
|
- @thirdweb-dev/react-core@3.14.37
|
||||||
|
- @thirdweb-dev/wallets@1.1.20
|
||||||
|
|
||||||
|
## 3.14.36
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1522](https://github.com/thirdweb-dev/js/pull/1522) [`088547f7`](https://github.com/thirdweb-dev/js/commit/088547f763294f1641c01ffe1aabac585f255dc0) Thanks [@MananTank](https://github.com/MananTank)! - - New prop `switchToActiveChain` added to `ConnectWallet`` component to show "Switch Network" button if wallet is not connected to the `activeChain`passed to the`ThirdwebProvider`
|
||||||
|
- Add max-height on `ConnectWallet` modal
|
||||||
|
- Local Wallet UI adjustments
|
||||||
|
- Updated dependencies [[`586e91db`](https://github.com/thirdweb-dev/js/commit/586e91dbe610588cc7b24fade59172fed6481074), [`34a3bb8a`](https://github.com/thirdweb-dev/js/commit/34a3bb8ae3c1d7a506e5568a9e79ab7e469557a8), [`91f0245b`](https://github.com/thirdweb-dev/js/commit/91f0245be78ae523e1faea26b1032bfb283467d9), [`5a373a75`](https://github.com/thirdweb-dev/js/commit/5a373a75090da7e1e05724ed1a3a3a6aa9f7fd21), [`ae74b8ef`](https://github.com/thirdweb-dev/js/commit/ae74b8ef6200dba8affa8b52e7d834c5552350d0), [`bc003c2f`](https://github.com/thirdweb-dev/js/commit/bc003c2fef33fcf7ce5981d8634911ac4bcaa927), [`447d9846`](https://github.com/thirdweb-dev/js/commit/447d984653f77af6860ae907072e768b584b263d), [`f65578d6`](https://github.com/thirdweb-dev/js/commit/f65578d637decc8b87cada5b5b0c8c504064d9d5), [`088547f7`](https://github.com/thirdweb-dev/js/commit/088547f763294f1641c01ffe1aabac585f255dc0)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.55
|
||||||
|
- @thirdweb-dev/chains@0.1.47
|
||||||
|
- @thirdweb-dev/react-core@3.14.36
|
||||||
|
- @thirdweb-dev/wallets@1.1.19
|
||||||
|
|
||||||
|
## 3.14.35
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`184c325a`](https://github.com/thirdweb-dev/js/commit/184c325ab2ef028022a050c4274f2ab12b1a3a7f), [`c12f0874`](https://github.com/thirdweb-dev/js/commit/c12f0874b4dac43c263c7edb20d0343c16381c34)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.46
|
||||||
|
- @thirdweb-dev/react-core@3.14.35
|
||||||
|
- @thirdweb-dev/sdk@3.10.54
|
||||||
|
- @thirdweb-dev/wallets@1.1.18
|
||||||
|
|
||||||
## 3.14.34
|
## 3.14.34
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react",
|
"name": "@thirdweb-dev/react",
|
||||||
"version": "3.14.34",
|
"version": "3.14.38",
|
||||||
"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",
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
"@radix-ui/react-tabs": "^1.0.4",
|
"@radix-ui/react-tabs": "^1.0.4",
|
||||||
"@radix-ui/react-tooltip": "^1.0.6",
|
"@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.32.0",
|
"@tanstack/react-query": "^4.33.0",
|
||||||
"@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:*",
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ const DialogContent = styled.div<{ theme?: Theme }>`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const DialogTitle = /* @__PURE__ */ styled(/* @__PURE__ */ Dialog.Title)<{
|
const DialogTitle = /* @__PURE__ */ styled.h2<{
|
||||||
theme?: Theme;
|
theme?: Theme;
|
||||||
}>`
|
}>`
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export const FormFieldWithIconButton: React.FC<{
|
|||||||
error?: string;
|
error?: string;
|
||||||
noSave?: boolean;
|
noSave?: boolean;
|
||||||
dataTest?: string;
|
dataTest?: string;
|
||||||
|
placeholder?: string;
|
||||||
}> = (props) => {
|
}> = (props) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -42,6 +43,7 @@ export const FormFieldWithIconButton: React.FC<{
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
data-test={props.dataTest}
|
data-test={props.dataTest}
|
||||||
|
placeholder={props.placeholder}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<InputButton type="button" onClick={props.right.onClick}>
|
<InputButton type="button" onClick={props.right.onClick}>
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import { type Theme, fontSize, media } from "../design-system";
|
|||||||
import { iconSize } from "../design-system";
|
import { iconSize } from "../design-system";
|
||||||
import { IconButton } from "./buttons";
|
import { IconButton } from "./buttons";
|
||||||
import styled from "@emotion/styled";
|
import styled from "@emotion/styled";
|
||||||
import { Title } from "@radix-ui/react-dialog";
|
|
||||||
import { ChevronLeftIcon } from "@radix-ui/react-icons";
|
import { ChevronLeftIcon } from "@radix-ui/react-icons";
|
||||||
|
|
||||||
export const ModalTitle = /* @__PURE__ */ styled(Title)<{
|
export const ModalTitle = /* @__PURE__ */ styled.h2<{
|
||||||
theme?: Theme;
|
theme?: Theme;
|
||||||
centerOnMobile?: boolean;
|
centerOnMobile?: boolean;
|
||||||
}>`
|
}>`
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ export { useSafe } from "./connectors/gnosis";
|
|||||||
export { useMagic } from "./connectors/magic";
|
export { useMagic } from "./connectors/magic";
|
||||||
|
|
||||||
export { ConnectWallet } from "../wallet/ConnectWallet/ConnectWallet";
|
export { ConnectWallet } from "../wallet/ConnectWallet/ConnectWallet";
|
||||||
|
export { ConnectModalInline } from "../wallet/ConnectWallet/ConnectModal";
|
||||||
|
|
||||||
export { NetworkSelector } from "../wallet/ConnectWallet/NetworkSelector";
|
export { NetworkSelector } from "../wallet/ConnectWallet/NetworkSelector";
|
||||||
export type { NetworkSelectorProps } from "../wallet/ConnectWallet/NetworkSelector";
|
export type { NetworkSelectorProps } from "../wallet/ConnectWallet/NetworkSelector";
|
||||||
|
|
||||||
|
|||||||
@@ -10,25 +10,41 @@ import {
|
|||||||
import {
|
import {
|
||||||
ModalConfigCtx,
|
ModalConfigCtx,
|
||||||
SetModalConfigCtx,
|
SetModalConfigCtx,
|
||||||
|
WalletUIStatesProvider,
|
||||||
useIsWalletModalOpen,
|
useIsWalletModalOpen,
|
||||||
useSetIsWalletModalOpen,
|
useSetIsWalletModalOpen,
|
||||||
} from "../../evm/providers/wallet-ui-states-provider";
|
} from "../../evm/providers/wallet-ui-states-provider";
|
||||||
import { ThemeProvider } from "@emotion/react";
|
import { ThemeProvider } from "@emotion/react";
|
||||||
import { darkTheme, lightTheme } from "../../design-system";
|
import {
|
||||||
|
Theme,
|
||||||
|
darkTheme,
|
||||||
|
lightTheme,
|
||||||
|
radius,
|
||||||
|
spacing,
|
||||||
|
} from "../../design-system";
|
||||||
import { useState, useCallback, useEffect, useRef, useContext } from "react";
|
import { useState, useCallback, useEffect, useRef, useContext } from "react";
|
||||||
import { GetStartedWithWallets } from "./screens/GetStartedWithWallets";
|
import { GetStartedWithWallets } from "./screens/GetStartedWithWallets";
|
||||||
import { reservedScreens } from "./constants";
|
import { reservedScreens } from "./constants";
|
||||||
import { HeadlessConnectUI } from "../wallets/headlessConnectUI";
|
import { HeadlessConnectUI } from "../wallets/headlessConnectUI";
|
||||||
|
import styled from "@emotion/styled";
|
||||||
|
import { scrollbar } from "../../design-system/styles";
|
||||||
|
|
||||||
export const ConnectModal = () => {
|
export const ConnectModalContent = (props: {
|
||||||
const { theme, title } = useContext(ModalConfigCtx);
|
screen: string | WalletConfig;
|
||||||
|
setScreen: (screen: string | WalletConfig) => void;
|
||||||
|
theme?: "light" | "dark";
|
||||||
|
title?: string;
|
||||||
|
}) => {
|
||||||
|
const { screen, setScreen } = props;
|
||||||
|
const modalConfig = useContext(ModalConfigCtx);
|
||||||
|
const title = props.title || modalConfig.title;
|
||||||
|
const theme = props.theme || modalConfig.theme;
|
||||||
const walletConfigs = useWallets();
|
const walletConfigs = useWallets();
|
||||||
const initialScreen =
|
const initialScreen =
|
||||||
walletConfigs.length === 1 && !walletConfigs[0].selectUI
|
walletConfigs.length === 1 && !walletConfigs[0].selectUI
|
||||||
? walletConfigs[0]
|
? walletConfigs[0]
|
||||||
: reservedScreens.main;
|
: reservedScreens.main;
|
||||||
|
|
||||||
const [screen, setScreen] = useState<string | WalletConfig>(initialScreen);
|
|
||||||
const isWalletModalOpen = useIsWalletModalOpen();
|
const isWalletModalOpen = useIsWalletModalOpen();
|
||||||
const setIsWalletModalOpen = useSetIsWalletModalOpen();
|
const setIsWalletModalOpen = useSetIsWalletModalOpen();
|
||||||
const connectionStatus = useConnectionStatus();
|
const connectionStatus = useConnectionStatus();
|
||||||
@@ -47,7 +63,13 @@ export const ConnectModal = () => {
|
|||||||
}
|
}
|
||||||
setIsWalletModalOpen(false);
|
setIsWalletModalOpen(false);
|
||||||
},
|
},
|
||||||
[setIsWalletModalOpen, initialScreen, connectionStatus, disconnect],
|
[
|
||||||
|
connectionStatus,
|
||||||
|
setIsWalletModalOpen,
|
||||||
|
setScreen,
|
||||||
|
initialScreen,
|
||||||
|
disconnect,
|
||||||
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleBack = useCallback(() => {
|
const handleBack = useCallback(() => {
|
||||||
@@ -95,9 +117,59 @@ export const ConnectModal = () => {
|
|||||||
: darkTheme
|
: darkTheme
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
{screen === reservedScreens.main && (
|
||||||
|
<WalletSelector
|
||||||
|
title={title}
|
||||||
|
walletConfigs={walletConfigs}
|
||||||
|
onGetStarted={() => {
|
||||||
|
setScreen(reservedScreens.getStarted);
|
||||||
|
}}
|
||||||
|
selectWallet={setScreen}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{screen === reservedScreens.getStarted && (
|
||||||
|
<GetStartedWithWallets onBack={handleBack} />
|
||||||
|
)}
|
||||||
|
|
||||||
|
{WalletConnectUI && (
|
||||||
|
<WalletConnectUI
|
||||||
|
supportedWallets={walletConfigs}
|
||||||
|
theme={theme}
|
||||||
|
goBack={handleBack}
|
||||||
|
close={handleClose}
|
||||||
|
isOpen={isWalletModalOpen}
|
||||||
|
open={() => {
|
||||||
|
setIsWalletModalOpen(true);
|
||||||
|
}}
|
||||||
|
walletConfig={screen}
|
||||||
|
selectionData={walletModalConfig.data}
|
||||||
|
setSelectionData={(data) => {
|
||||||
|
setWalletModalConfig((config) => ({
|
||||||
|
...config,
|
||||||
|
data,
|
||||||
|
}));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ConnectModal = () => {
|
||||||
|
const { theme } = useContext(ModalConfigCtx);
|
||||||
|
const { screen, setScreen, initialScreen } = useScreen();
|
||||||
|
const isWalletModalOpen = useIsWalletModalOpen();
|
||||||
|
const setIsWalletModalOpen = useSetIsWalletModalOpen();
|
||||||
|
const connectionStatus = useConnectionStatus();
|
||||||
|
const disconnect = useDisconnect();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ThemeProvider theme={theme === "light" ? lightTheme : darkTheme}>
|
||||||
<Modal
|
<Modal
|
||||||
style={{
|
style={{
|
||||||
maxWidth: "480px",
|
maxWidth: "450px",
|
||||||
|
maxHeight: "70vh",
|
||||||
}}
|
}}
|
||||||
open={isWalletModalOpen}
|
open={isWalletModalOpen}
|
||||||
setOpen={(value) => {
|
setOpen={(value) => {
|
||||||
@@ -110,42 +182,62 @@ export const ConnectModal = () => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{screen === reservedScreens.main && (
|
<ConnectModalContent screen={screen} setScreen={setScreen} />
|
||||||
<WalletSelector
|
|
||||||
title={title}
|
|
||||||
walletConfigs={walletConfigs}
|
|
||||||
onGetStarted={() => {
|
|
||||||
setScreen(reservedScreens.getStarted);
|
|
||||||
}}
|
|
||||||
selectWallet={setScreen}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{screen === reservedScreens.getStarted && (
|
|
||||||
<GetStartedWithWallets onBack={handleBack} />
|
|
||||||
)}
|
|
||||||
|
|
||||||
{WalletConnectUI && (
|
|
||||||
<WalletConnectUI
|
|
||||||
supportedWallets={walletConfigs}
|
|
||||||
theme={theme}
|
|
||||||
goBack={handleBack}
|
|
||||||
close={handleClose}
|
|
||||||
isOpen={isWalletModalOpen}
|
|
||||||
open={() => {
|
|
||||||
setIsWalletModalOpen(true);
|
|
||||||
}}
|
|
||||||
walletConfig={screen}
|
|
||||||
selectionData={walletModalConfig.data}
|
|
||||||
setSelectionData={(data) => {
|
|
||||||
setWalletModalConfig((config) => ({
|
|
||||||
...config,
|
|
||||||
data,
|
|
||||||
}));
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Modal>
|
</Modal>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ConnectModalInline = (props: {
|
||||||
|
theme?: "light" | "dark";
|
||||||
|
title?: string;
|
||||||
|
className?: string;
|
||||||
|
}) => {
|
||||||
|
const { screen, setScreen } = useScreen();
|
||||||
|
return (
|
||||||
|
<WalletUIStatesProvider theme={props.theme}>
|
||||||
|
<ThemeProvider theme={props.theme === "light" ? lightTheme : darkTheme}>
|
||||||
|
<ConnectModalInlineContainer className={props.className}>
|
||||||
|
<ConnectModalContent
|
||||||
|
screen={screen}
|
||||||
|
setScreen={setScreen}
|
||||||
|
theme={props.theme}
|
||||||
|
title={props.title}
|
||||||
|
/>
|
||||||
|
</ConnectModalInlineContainer>
|
||||||
|
</ThemeProvider>
|
||||||
|
</WalletUIStatesProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
function useScreen() {
|
||||||
|
const walletConfigs = useWallets();
|
||||||
|
const initialScreen =
|
||||||
|
walletConfigs.length === 1 && !walletConfigs[0].selectUI
|
||||||
|
? walletConfigs[0]
|
||||||
|
: reservedScreens.main;
|
||||||
|
|
||||||
|
const [screen, setScreen] = useState<string | WalletConfig>(initialScreen);
|
||||||
|
return {
|
||||||
|
screen,
|
||||||
|
setScreen,
|
||||||
|
initialScreen,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const ConnectModalInlineContainer = styled.div<{ theme?: Theme }>`
|
||||||
|
background: ${(p) => p.theme.bg.base};
|
||||||
|
padding: ${spacing.lg};
|
||||||
|
border-radius: ${radius.xl};
|
||||||
|
max-width: 450px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
max-height: 70vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
${(p) =>
|
||||||
|
scrollbar({
|
||||||
|
track: "transparent",
|
||||||
|
thumb: p.theme.bg.elevated,
|
||||||
|
hover: p.theme.bg.highlighted,
|
||||||
|
})}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -7,9 +7,12 @@ import {
|
|||||||
useConnectionStatus,
|
useConnectionStatus,
|
||||||
useLogin,
|
useLogin,
|
||||||
useLogout,
|
useLogout,
|
||||||
|
useNetworkMismatch,
|
||||||
|
useSwitchChain,
|
||||||
useThirdwebAuthContext,
|
useThirdwebAuthContext,
|
||||||
useUser,
|
useUser,
|
||||||
useWallet,
|
useWallet,
|
||||||
|
useWalletContext,
|
||||||
} from "@thirdweb-dev/react-core";
|
} from "@thirdweb-dev/react-core";
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
import {
|
import {
|
||||||
@@ -54,6 +57,17 @@ type ConnectWalletProps = {
|
|||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
hideTestnetFaucet?: boolean;
|
hideTestnetFaucet?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show "Switch Network" button if the wallet is connected,
|
||||||
|
* but it is not connected to the `activeChain` provided in `ThirdwebProvider`
|
||||||
|
*
|
||||||
|
* Please, note that if you support multiple networks in your app this prop should
|
||||||
|
* be set to `false` to allow users to switch between networks.
|
||||||
|
*
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
switchToActiveChain?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const TW_CONNECT_WALLET = "tw-connect-wallet";
|
const TW_CONNECT_WALLET = "tw-connect-wallet";
|
||||||
@@ -83,6 +97,8 @@ export const ConnectWallet: React.FC<ConnectWalletProps> = (props) => {
|
|||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { login } = useLogin();
|
const { login } = useLogin();
|
||||||
const { logout } = useLogout();
|
const { logout } = useLogout();
|
||||||
|
const isNetworkMismatch = useNetworkMismatch();
|
||||||
|
const { activeChainSetExplicitly } = useWalletContext();
|
||||||
|
|
||||||
const requiresSignIn = props.auth?.loginOptional
|
const requiresSignIn = props.auth?.loginOptional
|
||||||
? false
|
? false
|
||||||
@@ -108,61 +124,87 @@ export const ConnectWallet: React.FC<ConnectWalletProps> = (props) => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Sign In Button */}
|
{(() => {
|
||||||
{requiresSignIn && (
|
// wallet is not connected
|
||||||
<Button
|
if (!activeWallet) {
|
||||||
variant="inverted"
|
// Connect Wallet button
|
||||||
onClick={signIn}
|
return (
|
||||||
data-theme={theme}
|
<AnimatedButton
|
||||||
className={`${TW_CONNECT_WALLET}--sign-in ${props.className || ""}}`}
|
disabled={isLoading}
|
||||||
style={props.style}
|
className={`${props.className || ""} ${TW_CONNECT_WALLET}`}
|
||||||
>
|
data-theme={theme}
|
||||||
<Flex
|
data-is-loading={isLoading}
|
||||||
alignItems="center"
|
variant="inverted"
|
||||||
gap="sm"
|
type="button"
|
||||||
style={{
|
style={{
|
||||||
paddingRight: spacing.xs,
|
minWidth: "140px",
|
||||||
borderRight: "1px solid",
|
...props.style,
|
||||||
marginRight: spacing.xs,
|
}}
|
||||||
}}
|
aria-label={
|
||||||
>
|
connectionStatus === "connecting" ? "Connecting" : btnTitle
|
||||||
<LockIcon size={iconSize.sm} />
|
}
|
||||||
<span> Sign in </span>
|
onClick={() => {
|
||||||
</Flex>
|
setModalConfig({
|
||||||
<span>{shortenAddress(address || "", true)}</span>
|
title: props.modalTitle || "Choose your wallet",
|
||||||
</Button>
|
theme,
|
||||||
)}
|
data: undefined,
|
||||||
|
});
|
||||||
|
setIsWalletModalOpen(true);
|
||||||
|
}}
|
||||||
|
data-test="connect-wallet-button"
|
||||||
|
>
|
||||||
|
{isLoading ? <Spinner size="sm" color="inverted" /> : btnTitle}
|
||||||
|
</AnimatedButton>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
{!requiresSignIn &&
|
// switch network button
|
||||||
(!activeWallet ? (
|
if (
|
||||||
// connect wallet button
|
props.switchToActiveChain &&
|
||||||
<AnimatedButton
|
isNetworkMismatch &&
|
||||||
disabled={isLoading}
|
activeChainSetExplicitly
|
||||||
className={`${props.className || ""} ${TW_CONNECT_WALLET}`}
|
) {
|
||||||
data-theme={theme}
|
return (
|
||||||
data-is-loading={isLoading}
|
<SwitchNetworkButton
|
||||||
variant="inverted"
|
style={props.style}
|
||||||
type="button"
|
theme={theme}
|
||||||
style={{
|
className={props.className}
|
||||||
minWidth: "140px",
|
/>
|
||||||
...props.style,
|
);
|
||||||
}}
|
}
|
||||||
aria-label={
|
|
||||||
connectionStatus === "connecting" ? "Connecting" : btnTitle
|
// sign in button
|
||||||
}
|
else if (requiresSignIn) {
|
||||||
onClick={() => {
|
return (
|
||||||
setModalConfig({
|
<Button
|
||||||
title: props.modalTitle || "Choose your wallet",
|
variant="inverted"
|
||||||
theme,
|
onClick={signIn}
|
||||||
data: undefined,
|
data-theme={theme}
|
||||||
});
|
className={`${TW_CONNECT_WALLET}--sign-in ${
|
||||||
setIsWalletModalOpen(true);
|
props.className || ""
|
||||||
}}
|
}`}
|
||||||
data-test="connect-wallet-button"
|
style={props.style}
|
||||||
>
|
data-test="sign-in-button"
|
||||||
{isLoading ? <Spinner size="sm" color="inverted" /> : btnTitle}
|
>
|
||||||
</AnimatedButton>
|
<Flex
|
||||||
) : (
|
alignItems="center"
|
||||||
|
gap="sm"
|
||||||
|
style={{
|
||||||
|
paddingRight: spacing.xs,
|
||||||
|
borderRight: "1px solid",
|
||||||
|
marginRight: spacing.xs,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<LockIcon size={iconSize.sm} />
|
||||||
|
<span> Sign in </span>
|
||||||
|
</Flex>
|
||||||
|
<span>{shortenAddress(address || "", true)}</span>
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// wallet details button
|
||||||
|
return (
|
||||||
<ConnectedWalletDetails
|
<ConnectedWalletDetails
|
||||||
networkSelector={props.networkSelector}
|
networkSelector={props.networkSelector}
|
||||||
dropdownPosition={props.dropdownPosition}
|
dropdownPosition={props.dropdownPosition}
|
||||||
@@ -178,11 +220,52 @@ export const ConnectWallet: React.FC<ConnectWalletProps> = (props) => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
);
|
||||||
|
})()}
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function SwitchNetworkButton(props: {
|
||||||
|
style?: React.CSSProperties;
|
||||||
|
className?: string;
|
||||||
|
theme: "dark" | "light";
|
||||||
|
}) {
|
||||||
|
const { activeChain } = useWalletContext();
|
||||||
|
const switchChain = useSwitchChain();
|
||||||
|
const [switching, setSwitching] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedButton
|
||||||
|
className={`${TW_CONNECT_WALLET}--switch-network ${
|
||||||
|
props.className || ""
|
||||||
|
}`}
|
||||||
|
variant="inverted"
|
||||||
|
type="button"
|
||||||
|
data-theme={props.theme}
|
||||||
|
data-is-loading={switching}
|
||||||
|
data-test="switch-network-button"
|
||||||
|
disabled={switching}
|
||||||
|
onClick={async () => {
|
||||||
|
setSwitching(true);
|
||||||
|
try {
|
||||||
|
await switchChain(activeChain.chainId);
|
||||||
|
} catch {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
setSwitching(false);
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
minWidth: "140px",
|
||||||
|
...props.style,
|
||||||
|
}}
|
||||||
|
aria-label={switching ? "Switching Network" : undefined}
|
||||||
|
>
|
||||||
|
{switching ? <Spinner size="sm" color="inverted" /> : "Switch Network"}
|
||||||
|
</AnimatedButton>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const AnimatedButton = /* @__PURE__ */ styled(Button)`
|
const AnimatedButton = /* @__PURE__ */ styled(Button)`
|
||||||
animation: ${fadeInAnimation} 300ms ease;
|
animation: ${fadeInAnimation} 300ms ease;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export const WalletSelection: React.FC<{
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WalletList>
|
<WalletListContainer>
|
||||||
{walletConfigs.map((walletConfig) => {
|
{walletConfigs.map((walletConfig) => {
|
||||||
const isInstalled = walletConfig.isInstalled
|
const isInstalled = walletConfig.isInstalled
|
||||||
? walletConfig.isInstalled()
|
? walletConfig.isInstalled()
|
||||||
@@ -150,11 +150,11 @@ export const WalletSelection: React.FC<{
|
|||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</WalletList>
|
</WalletListContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const WalletList = styled.ul`
|
const WalletListContainer = styled.ul`
|
||||||
all: unset;
|
all: unset;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Spacer } from "../../../components/Spacer";
|
import { Spacer } from "../../../components/Spacer";
|
||||||
import { Button } from "../../../components/buttons";
|
import { Button } from "../../../components/buttons";
|
||||||
import { FormFooter, Label } from "../../../components/formElements";
|
import { Label } from "../../../components/formElements";
|
||||||
import {
|
import {
|
||||||
ModalTitle,
|
ModalTitle,
|
||||||
ModalDescription,
|
ModalDescription,
|
||||||
@@ -172,7 +172,7 @@ export const ExportLocalWallet: React.FC<{
|
|||||||
|
|
||||||
<SavedWalletAddress>{shortenAddress(savedAddress)}</SavedWalletAddress>
|
<SavedWalletAddress>{shortenAddress(savedAddress)}</SavedWalletAddress>
|
||||||
|
|
||||||
<Spacer y="lg" />
|
<Spacer y="xl" />
|
||||||
|
|
||||||
{passwordIsRequired && (
|
{passwordIsRequired && (
|
||||||
<>
|
<>
|
||||||
@@ -207,22 +207,21 @@ export const ExportLocalWallet: React.FC<{
|
|||||||
error={isWrongPassword ? "Wrong Password" : ""}
|
error={isWrongPassword ? "Wrong Password" : ""}
|
||||||
dataTest="current-password"
|
dataTest="current-password"
|
||||||
/>
|
/>
|
||||||
<Spacer y="xl" />
|
<Spacer y="md" />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<FormFooter>
|
<Button
|
||||||
<Button
|
disabled={exportDisabled}
|
||||||
disabled={exportDisabled}
|
variant="inverted"
|
||||||
variant="inverted"
|
style={{
|
||||||
style={{
|
opacity: exportDisabled ? 0.5 : 1,
|
||||||
opacity: exportDisabled ? 0.5 : 1,
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
Backup
|
Backup
|
||||||
</Button>
|
</Button>
|
||||||
</FormFooter>
|
|
||||||
</form>
|
</form>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user