Compare commits

...
Author SHA1 Message Date
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
0f54e99141 Version Packages (#2083)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-15 09:31:22 +13:00
c701c388c6 feat: ethers skipFetchSetup support (#2085)
Co-authored-by: Manan Tank <[email protected]>
2023-12-15 08:37:55 +13:00
iketwandGitHub 328ef5dc9c [RN] Hide back button in WC modal when WC is the only supportedWallet (#2086) 2023-12-14 18:13:55 +00:00
iketwandGitHub 07fbb799be [RN] Adds the ability to login with any arbitrary login payload (#2074) 2023-12-13 20:50:24 +00:00
iketwandGitHub 699f31c20a [RN/React-Core] Improve comments (#2082) 2023-12-13 02:56:39 +00:00
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
c97e51b855 Version Packages (#2071)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-13 13:11:43 +13:00
Adam MajmudarandGitHub e10173bf8a [Wallets] Add support for signTransaction for smart wallets (#2080) 2023-12-12 23:57:45 +00:00
Joaquim VergesandGitHub dbfa73d75a [SDK] Export contract verifier (#2081) 2023-12-12 23:34:31 +00:00
Joaquim VergesandGitHub 1b1212d9fb [Wallet] Export getUserOpReceipt() (#2079) 2023-12-12 22:46:52 +00:00
FirekeeperandGitHub 065f85bf71 [Unity] Support revokeSessionKey/getAllActiveSigners (#2078) 2023-12-12 21:30:46 +00:00
Joaquim VergesandGitHub 09bafa9aeb [Wallets] Respect value in smart wallet gas estimations + add getUserOpReceipt utility function (#2077) 2023-12-12 21:13:18 +00:00
Joaquim VergesandGitHub fe30c88cc3 [SDK] Re-export classes, comment cleanup (#2076) 2023-12-12 09:35:51 +00:00
Joaquim VergesandGitHub 3a9538259c [SDK] cleanup (#2075) 2023-12-12 00:12:03 +00:00
FirekeeperandGitHub 0c730e57e0 [Unity] Add JWT/AuthEndpoint login options (#2073) 2023-12-11 23:43:10 +00:00
iketwandGitHub 33c9f6b1ab [Embedded] Enforce encryption key for custom jwt (#2018) 2023-12-11 22:47:41 +00:00
iketwandGitHub 2346396bdf [RN] Adds analytics nonce to ews (#2072) 2023-12-11 22:41:32 +00:00
Manan TankandGitHub de5ebc9093 [wallets] Fix assertWindowEthereum (#2070) 2023-12-11 20:37:32 +00:00
Joaquim VergesandGitHub 42c4c33d30 [SDK] un-export unneeded classes + package reorganization (#2069) 2023-12-11 19:06:32 +00:00
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
046603ac54 Version Packages (#2068)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-08 22:29:51 -08:00
YashandGitHub bcfa9463bb Fix deployments (#2067) 2023-12-09 04:37:58 +00:00
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
42bda873b4 Version Packages (#2054)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-08 18:04:02 -08:00
Joaquim VergesandGitHub d2001ca464 sync chains (#2066) 2023-12-09 00:14:35 +00:00
Manan TankandGitHub c8ba5cf863 [react] - Add option to only show Official WC Modal, Fix focus trap when CW Modal is hidden (#2063) 2023-12-08 13:14:04 +00:00
Joaquim VergesandGitHub 85842c1596 [SDK] expose BaseFee in getDynamicFeeData() (#2062) 2023-12-07 23:29:17 +00:00
FirekeeperandGitHub 0fb2f1fc5e [Unity] Support for sdk.wallet.GetEmail (#2061) 2023-12-07 22:21:23 +00:00
Jonas DanielsandGitHub 497677f359 fix(sdk): roles.setAll.prepare() correctly sorts role removals (#2059) 2023-12-07 18:48:16 +00:00
Manan TankandGitHub 15ae5e7f95 [react] Add "Open Official WalletConnect Modal" in ConnectWallet (#2058) 2023-12-07 16:57:52 +00:00
FirekeeperandGitHub 5a0283d083 [Unity] Reload local wallet in case of reconnection (sw) (#2056) 2023-12-07 00:32:24 +00:00
Winston YeoandGitHub 9496606964 [wallets]: Winston/custom auth endpoint (#2052) 2023-12-06 23:35:47 +00:00
Manan TankandGitHub b50e4a41b5 [react] Use WalletConnect to connect MM on mobile by default (#2029) 2023-12-06 19:52:46 +00:00
YashandGitHub e595d4d92f [SDK] Update implementation (#2053) 2023-12-06 19:29:10 +00:00
261 changed files with 3685 additions and 1016 deletions
+28
View File
@@ -1,5 +1,33 @@
# @thirdweb-dev/auth
## 4.1.18
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.3.1
## 4.1.17
### Patch Changes
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
- @thirdweb-dev/wallets@2.3.0
## 4.1.16
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.2.1
## 4.1.15
### Patch Changes
- Updated dependencies [[`94966069`](https://github.com/thirdweb-dev/js/commit/9496606964d65268f8ee6bf9f78b2786e99d33ac), [`15ae5e7f`](https://github.com/thirdweb-dev/js/commit/15ae5e7f95a482a9736923c0e10916a0a6115c3d)]:
- @thirdweb-dev/wallets@2.2.0
## 4.1.14
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/auth",
"version": "4.1.14",
"version": "4.1.18",
"main": "dist/thirdweb-dev-auth.cjs.js",
"module": "dist/thirdweb-dev-auth.esm.js",
"browser": {
+6
View File
@@ -1,5 +1,11 @@
# @thirdweb-dev/chains
## 0.1.61
### Patch Changes
- [#2066](https://github.com/thirdweb-dev/js/pull/2066) [`d2001ca4`](https://github.com/thirdweb-dev/js/commit/d2001ca464aa699ac821c97eb37de7409ba865f3) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Updatechains
## 0.1.60
### Patch Changes
+6 -9
View File
@@ -20,20 +20,17 @@ export default {
"format": "png"
},
"infoURL": "https://shimmer.network",
"name": "ShimmerEVM Testnet",
"name": "ShimmerEVM Testnet Deprecated 1072",
"nativeCurrency": {
"name": "SMR",
"symbol": "SMR",
"decimals": 6
},
"networkId": 1072,
"rpc": [
"https://shimmerevm-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://1072.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://json-rpc.evm.testnet.shimmer.network"
],
"shortName": "shimmerevm-testnet",
"slug": "shimmerevm-testnet",
"rpc": [],
"shortName": "shimmerevm-testnet-deprecated-1072",
"slug": "shimmerevm-testnet-deprecated-1072",
"status": "deprecated",
"testnet": true,
"title": "ShimmerEVM Testnet"
"title": "ShimmerEVM Testnet Deprecated 1072"
} as const satisfies Chain;
+39
View File
@@ -0,0 +1,39 @@
import type { Chain } from "../src/types";
export default {
"chain": "ShimmerEVM",
"chainId": 1073,
"explorers": [
{
"name": "explorer",
"url": "https://explorer.evm.testnet.shimmer.network",
"standard": "EIP3091"
}
],
"faucets": [
"https://evm-toolkit.evm.testnet.shimmer.network",
"https://evm-faucet.testnet.shimmer.network"
],
"icon": {
"url": "ipfs://bafkreibky2sy6qhi6arktayvologkrgu5kudpgdxfkx4uosbvmstz7v4di",
"width": 720,
"height": 720,
"format": "png"
},
"infoURL": "https://shimmer.network",
"name": "ShimmerEVM Testnet",
"nativeCurrency": {
"name": "SMR",
"symbol": "SMR",
"decimals": 6
},
"networkId": 1073,
"rpc": [
"https://shimmerevm-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://1073.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://json-rpc.evm.testnet.shimmer.network"
],
"shortName": "shimmerevm-testnet",
"slug": "shimmerevm-testnet",
"testnet": true,
"title": "ShimmerEVM Testnet"
} as const satisfies Chain;
+37
View File
@@ -0,0 +1,37 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 11155420,
"explorers": [
{
"name": "opscout",
"url": "https://optimism-sepolia.blockscout.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
"width": 551,
"height": 540,
"format": "png"
}
}
],
"faucets": [
"https://app.optimism.io/faucet"
],
"infoURL": "https://optimism.io",
"name": "OP Sepolia Testnet",
"nativeCurrency": {
"name": "Sepolia Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 11155420,
"rpc": [
"https://op-sepolia-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://11155420.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://sepolia.optimism.io"
],
"shortName": "opsep",
"slug": "op-sepolia-testnet",
"testnet": true
} as const satisfies Chain;
+33
View File
@@ -0,0 +1,33 @@
import type { Chain } from "../src/types";
export default {
"chain": "TILTYARD",
"chainId": 1127469,
"explorers": [
{
"name": "TILTYARD Explorer",
"url": "http://testnet-explorer.tiltyard.gg",
"standard": "EIP3091"
}
],
"faucets": [],
"features": [
{
"name": "EIP1559"
}
],
"name": "Tiltyard Subnet",
"nativeCurrency": {
"name": "Tiltyard Token",
"symbol": "TILTG",
"decimals": 18
},
"networkId": 1127469,
"rpc": [
"https://tiltyard-subnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://1127469.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/tiltyard/testnet/rpc"
],
"shortName": "tiltyard",
"slug": "tiltyard-subnet",
"testnet": true
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 12035,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "QI M 11272",
"nativeCurrency": {
"name": "QI M 11272 Token",
"symbol": "JZW",
"decimals": 18
},
"networkId": 12035,
"redFlags": [],
"rpc": [
"https://qi-m-11272.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://12035.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avacloud-dev.io/b19c9e32-f359-451f-ad15-7ec784625c04"
],
"shortName": "QI M 11272",
"slug": "qi-m-11272",
"testnet": true
} as const satisfies Chain;
+1 -7
View File
@@ -6,13 +6,7 @@ export default {
{
"name": "Blockscout",
"url": "https://wan-red-ain.explorer.mainnet.skalenodes.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmT5KKrpNt6duU8QfwaYw3xf4ifTBPtjahpWsMi3gsFmcS",
"width": 440,
"height": 600,
"format": "png"
}
"standard": "EIP3091"
}
],
"faucets": [
+1 -13
View File
@@ -6,22 +6,10 @@ export default {
{
"name": "etndscan",
"url": "https://scan.etnd.pro",
"standard": "none",
"icon": {
"url": "ipfs://Qmd26eRJxPb1jJg5Q4mC2M4kD9Jrs5vmcnr5LczHFMGwSD",
"width": 128,
"height": 128,
"format": "png"
}
"standard": "none"
}
],
"faucets": [],
"icon": {
"url": "ipfs://Qmd26eRJxPb1jJg5Q4mC2M4kD9Jrs5vmcnr5LczHFMGwSD",
"width": 128,
"height": 128,
"format": "png"
},
"infoURL": "https://www.etnd.pro",
"name": "ETND Chain Mainnets",
"nativeCurrency": {
+43
View File
@@ -0,0 +1,43 @@
import type { Chain } from "../src/types";
export default {
"chain": "Immutable zkEVM",
"chainId": 13473,
"explorers": [
{
"name": "Immutable Testnet explorer",
"url": "https://explorer.testnet.immutable.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmXFUYFW4e6wifbU9LKVq7owM14bnE6ZbbYq3bn1jBP3Mw",
"width": 1168,
"height": 1168,
"format": "png"
}
}
],
"faucets": [
"https://docs.immutable.com/docs/zkEVM/guides/faucet"
],
"icon": {
"url": "ipfs://QmXFUYFW4e6wifbU9LKVq7owM14bnE6ZbbYq3bn1jBP3Mw",
"width": 1168,
"height": 1168,
"format": "png"
},
"infoURL": "https://www.immutable.com",
"name": "Immutable zkEVM Testnet",
"nativeCurrency": {
"name": "Test IMX",
"symbol": "tIMX",
"decimals": 18
},
"networkId": 13473,
"rpc": [
"https://immutable-zkevm-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://13473.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.testnet.immutable.com"
],
"shortName": "imx-testnet",
"slug": "immutable-zkevm-testnet",
"testnet": true
} as const satisfies Chain;
+43
View File
@@ -0,0 +1,43 @@
import type { Chain } from "../src/types";
export default {
"chain": "Immutable zkEVM",
"chainId": 15003,
"explorers": [
{
"name": "Immutable Devnet explorer",
"url": "https://explorer.dev.immutable.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmXFUYFW4e6wifbU9LKVq7owM14bnE6ZbbYq3bn1jBP3Mw",
"width": 1168,
"height": 1168,
"format": "png"
}
}
],
"faucets": [
"https://docs.immutable.com/docs/zkEVM/guides/faucet"
],
"icon": {
"url": "ipfs://QmXFUYFW4e6wifbU9LKVq7owM14bnE6ZbbYq3bn1jBP3Mw",
"width": 1168,
"height": 1168,
"format": "png"
},
"infoURL": "https://www.immutable.com",
"name": "Immutable zkEVM Devnet",
"nativeCurrency": {
"name": "Dev IMX",
"symbol": "dIMX",
"decimals": 18
},
"networkId": 15003,
"rpc": [
"https://immutable-zkevm-devnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://15003.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.dev.immutable.com"
],
"shortName": "imx-devnet",
"slug": "immutable-zkevm-devnet",
"testnet": false
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 17026,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "QI1204I3",
"nativeCurrency": {
"name": "QI1204I3 Token",
"symbol": "BHOX",
"decimals": 18
},
"networkId": 17026,
"redFlags": [],
"rpc": [
"https://qi1204i3.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://17026.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avacloud-test.io/e7aeac38-06b2-4aaa-87b4-2c2da10fa43e"
],
"shortName": "QI1204I3",
"slug": "qi1204i3",
"testnet": true
} as const satisfies Chain;
+3 -7
View File
@@ -12,7 +12,7 @@ export default {
"format": ".png"
},
"infoURL": "https://tryroll.com/",
"name": "Roll Testnet",
"name": "Form Testnet",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
@@ -20,13 +20,9 @@ export default {
},
"networkId": 1748,
"redFlags": [],
"rpc": [
"https://roll-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://1748.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://roll.calderachain.xyz/http"
],
"rpc": [],
"shortName": "Roll",
"slug": "roll-testnet",
"slug": "form-testnet",
"testnet": true,
"title": "Roll Testnet"
} as const satisfies Chain;
-6
View File
@@ -10,12 +10,6 @@ export default {
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmePhfibWz9jnGUqF9Rven4x734br1h3LxrChYTEjbbQvo",
"width": 256,
"height": 256,
"format": "png"
},
"infoURL": "https://proofofmemes.org",
"name": "Proof Of Memes",
"nativeCurrency": {
+35
View File
@@ -0,0 +1,35 @@
import type { Chain } from "../src/types";
export default {
"chain": "MRK",
"chainId": 1909,
"explorers": [
{
"name": "blockscout",
"url": "https://merklescan.com",
"standard": "none"
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmZocJpCSLoQqoYFkF1kn7uKDuAiFRNTK8P5PoVeiigDBU",
"width": 114,
"height": 132,
"format": "png"
},
"infoURL": "https://merklescan.com",
"name": "Merkle Scan",
"nativeCurrency": {
"name": "Merkle",
"symbol": "MRK",
"decimals": 18
},
"networkId": 1909,
"rpc": [
"https://merkle-scan.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://1909.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://marklechain-rpc.merklescan.com"
],
"shortName": "MRK",
"slug": "merkle-scan",
"testnet": false
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 19683,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "ST 12-07 V1",
"nativeCurrency": {
"name": "ST 12-07 V1 Token",
"symbol": "XRL",
"decimals": 18
},
"networkId": 19683,
"redFlags": [],
"rpc": [
"https://st-12-07-v1.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://19683.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avacloud-test.io/d26b972e-1832-4d3a-bf7b-d0ce1f4331c2"
],
"shortName": "ST 12-07 V1",
"slug": "st-12-07-v1",
"testnet": true
} as const satisfies Chain;
+35
View File
@@ -0,0 +1,35 @@
import type { Chain } from "../src/types";
export default {
"chain": "X1",
"chainId": 202212,
"explorers": [
{
"name": "Blockscout",
"url": "https://explorer.x1-devnet.xen.network",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
"width": 551,
"height": 540,
"format": "png"
}
}
],
"faucets": [],
"infoURL": "https://docs.xen.network/x1/",
"name": "X1 Devnet",
"nativeCurrency": {
"name": "XN",
"symbol": "XN",
"decimals": 18
},
"networkId": 202212,
"rpc": [
"https://x1-devnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://202212.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://x1-devnet.xen.network"
],
"shortName": "x1-devnet",
"slug": "x1-devnet",
"testnet": false
} as const satisfies Chain;
+35
View File
@@ -0,0 +1,35 @@
import type { Chain } from "../src/types";
export default {
"chain": "X1",
"chainId": 204005,
"explorers": [
{
"name": "Blockscout",
"url": "https://explorer.x1-testnet.xen.network",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
"width": 551,
"height": 540,
"format": "png"
}
}
],
"faucets": [],
"infoURL": "https://docs.xen.network/go-x1/",
"name": "X1 Network",
"nativeCurrency": {
"name": "XN",
"symbol": "XN",
"decimals": 18
},
"networkId": 204005,
"rpc": [
"https://x1-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://204005.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://x1-testnet.xen.network"
],
"shortName": "x1-testnet",
"slug": "x1-network",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "BSL",
"chainId": 21912,
"explorers": [
{
"name": "BSL Mainnet Explorer",
"url": "https://scan.nftruth.io",
"standard": "EIP3091"
}
],
"faucets": [],
"infoURL": "https://bsquarelab.com/",
"name": "BSL Mainnet",
"nativeCurrency": {
"name": "Origin NFT",
"symbol": "ONF",
"decimals": 18
},
"networkId": 21912,
"rpc": [
"https://bsl.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://21912.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"http://rpc-mainnet.nftruth.io:8545",
"ws://rpc-mainnet.nftruth.io:8645"
],
"shortName": "onf",
"slug": "bsl",
"testnet": false
} as const satisfies Chain;
+23
View File
@@ -0,0 +1,23 @@
import type { Chain } from "../src/types";
export default {
"chain": "ebro",
"chainId": 2306,
"explorers": [],
"faucets": [],
"infoURL": "https://www.ebrochain.com",
"name": "Ebro Network",
"nativeCurrency": {
"name": "Ebro",
"symbol": "ebro",
"decimals": 18
},
"networkId": 2306,
"rpc": [
"https://ebro-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://2306.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://greendinoswap.com"
],
"shortName": "ebro",
"slug": "ebro-network",
"testnet": false
} as const satisfies Chain;
+1 -6
View File
@@ -14,11 +14,6 @@ export default {
"format": "png"
}
},
{
"name": "native",
"url": "https://devnet.explorer.neon-labs.org",
"standard": "EIP3091"
},
{
"name": "neonscan",
"url": "https://devnet.neonscan.org",
@@ -35,7 +30,7 @@ export default {
"format": "png"
},
"infoURL": "https://neon-labs.org",
"name": "Neon EVM DevNet",
"name": "Neon EVM Devnet",
"nativeCurrency": {
"name": "Neon",
"symbol": "NEON",
+6 -2
View File
@@ -22,14 +22,18 @@ export default {
"format": "png"
},
"infoURL": "https://neonevm.org",
"name": "Neon EVM MainNet",
"name": "Neon EVM Mainnet",
"nativeCurrency": {
"name": "Neon",
"symbol": "NEON",
"decimals": 18
},
"networkId": 245022934,
"rpc": [],
"rpc": [
"https://neon-evm.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://245022934.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://neon-proxy-mainnet.solana.p2p.org"
],
"shortName": "neonevm-mainnet",
"slug": "neon-evm",
"testnet": false
+1
View File
@@ -36,5 +36,6 @@ export default {
],
"shortName": "neonevm-testnet",
"slug": "neon-evm-testnet",
"status": "deprecated",
"testnet": true
} as const satisfies Chain;
+1 -1
View File
@@ -5,7 +5,7 @@ export default {
"explorers": [
{
"name": "Cronos Explorer",
"url": "https://cronoscan.com",
"url": "https://explorer.cronos.org",
"standard": "none"
}
],
+28
View File
@@ -0,0 +1,28 @@
import type { Chain } from "../src/types";
export default {
"chain": "FRAX",
"chainId": 252,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmQLJk5G7zF8ZDxSxkRcpHqEqcifrJEhGmEKC6zwyPXWAw/fraxchain.png",
"width": 512,
"height": 512,
"format": "PNG"
},
"infoURL": "https://mainnet.frax.com",
"name": "Fraxchain Mainnet",
"nativeCurrency": {
"name": "Frax Ether",
"symbol": "frxETH",
"decimals": 18
},
"networkId": 252,
"redFlags": [],
"rpc": [],
"shortName": "fraxchain",
"slug": "fraxchain",
"status": "incubating",
"testnet": false
} as const satisfies Chain;
+32
View File
@@ -0,0 +1,32 @@
import type { Chain } from "../src/types";
export default {
"chain": "FRAX",
"chainId": 2522,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmQLJk5G7zF8ZDxSxkRcpHqEqcifrJEhGmEKC6zwyPXWAw/fraxchain.png",
"width": 512,
"height": 512,
"format": "PNG"
},
"infoURL": "https://testnet.frax.com",
"name": "Fraxchain Testnet",
"nativeCurrency": {
"name": "Frax Ether",
"symbol": "frxETH",
"decimals": 18
},
"networkId": 2522,
"redFlags": [],
"rpc": [
"https://fraxchain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://2522.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.testnet.frax.com"
],
"shortName": "fraxchain-testnet",
"slug": "fraxchain-testnet",
"status": "active",
"testnet": false
} as const satisfies Chain;
+8 -8
View File
@@ -4,14 +4,14 @@ export default {
"chainId": 2710,
"explorers": [
{
"name": "Morphism Testnet Explorer",
"url": "https://explorer-testnet.morphism.xyz",
"name": "Morph Testnet Explorer",
"url": "https://explorer-testnet.morphl2.io",
"standard": "EIP3091"
}
],
"faucets": [],
"infoURL": "https://morphism.xyz",
"name": "Morphism Testnet",
"infoURL": "https://morphl2.io",
"name": "Morph Testnet",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
@@ -23,16 +23,16 @@ export default {
"chain": "eip155-1",
"bridges": [
{
"url": "https://bridge-testnet.morphism.xyz"
"url": "https://bridge-testnet.morphl2.io"
}
]
},
"rpc": [
"https://morphism-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://morph-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://2710.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-testnet.morphism.xyz"
"https://rpc-testnet.morphl2.io"
],
"shortName": "tmorph",
"slug": "morphism-testnet",
"slug": "morph-testnet",
"testnet": true
} as const satisfies Chain;
+7 -8
View File
@@ -15,17 +15,15 @@ export default {
}
}
],
"faucets": [
"https://goerli.portal.zksync.io/faucet"
],
"faucets": [],
"icon": {
"url": "ipfs://QmRkhUD6J3B9WhT4hEWLrcFVTrBhx3CQgNC783aJsrwxSN",
"width": 512,
"height": 512,
"format": "svg"
},
"infoURL": "https://era.zksync.io/docs/",
"name": "zkSync Era Testnet",
"infoURL": "https://zksync.io/",
"name": "zkSync Era Goerli Testnet (deprecated)",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
@@ -37,16 +35,17 @@ export default {
"chain": "eip155-1",
"bridges": [
{
"url": "https://goerli.portal.zksync.io/bridge"
"url": "https://bridge.zksync.io/"
}
]
},
"rpc": [
"https://zksync-era-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://zksync-era-goerli-testnet-deprecated.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://280.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnet.era.zksync.dev"
],
"shortName": "zksync-goerli",
"slug": "zksync-era-testnet",
"slug": "zksync-era-goerli-testnet-deprecated",
"status": "deprecated",
"testnet": true
} as const satisfies Chain;
+44 -11
View File
@@ -1,20 +1,53 @@
import type { Chain } from "../src/types";
export default {
"chain": "OGC",
"chain": "ETH",
"chainId": 300,
"explorers": [],
"explorers": [
{
"name": "zkSync Block Explorer",
"url": "https://sepolia.explorer.zksync.io",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmRkhUD6J3B9WhT4hEWLrcFVTrBhx3CQgNC783aJsrwxSN",
"width": 512,
"height": 512,
"format": "svg"
}
}
],
"faucets": [],
"infoURL": "https://docs.gnosischain.com",
"name": "(deprecated) Optimism on GC",
"icon": {
"url": "ipfs://QmRkhUD6J3B9WhT4hEWLrcFVTrBhx3CQgNC783aJsrwxSN",
"width": 512,
"height": 512,
"format": "svg"
},
"infoURL": "https://zksync.io/",
"name": "zkSync Sepolia Testnet",
"nativeCurrency": {
"name": "xDAI",
"symbol": "xDAI",
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 300,
"rpc": [],
"shortName": "ogc",
"slug": "deprecated-optimism-on-gc",
"status": "deprecated",
"testnet": false
"parent": {
"type": "L2",
"chain": "eip155-1",
"bridges": [
{
"url": "https://bridge.zksync.io/"
}
]
},
"redFlags": [
"reusedChainId"
],
"rpc": [
"https://zksync-sepolia-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://300.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://sepolia.era.zksync.dev"
],
"shortName": "zksync-sepolia",
"slug": "zksync-sepolia-testnet",
"testnet": true
} as const satisfies Chain;
+3 -3
View File
@@ -23,7 +23,7 @@ export default {
"format": "svg"
},
"infoURL": "https://zksync.io/",
"name": "zkSync Era Mainnet",
"name": "zkSync Mainnet",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
@@ -40,11 +40,11 @@ export default {
]
},
"rpc": [
"https://zksync-era.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://zksync.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://324.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://mainnet.era.zksync.io"
],
"shortName": "zksync",
"slug": "zksync-era",
"slug": "zksync",
"testnet": false
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 35730,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "QR1129I1",
"nativeCurrency": {
"name": "QR1129I1 Token",
"symbol": "YXAX",
"decimals": 18
},
"networkId": 35730,
"redFlags": [],
"rpc": [
"https://qr1129i1.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://35730.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/qr1129i1/testnet/rpc"
],
"shortName": "QR1129I1",
"slug": "qr1129i1",
"testnet": true
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 36908,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "QR1205s1",
"nativeCurrency": {
"name": "QR1205s1 Token",
"symbol": "MDN",
"decimals": 18
},
"networkId": 36908,
"redFlags": [],
"rpc": [
"https://qr1205s1.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://36908.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/qr1205s1/testnet/rpc"
],
"shortName": "QR1205s1",
"slug": "qr1205s1",
"testnet": true
} as const satisfies Chain;
+24
View File
@@ -0,0 +1,24 @@
import type { Chain } from "../src/types";
export default {
"chain": "Firechain",
"chainId": 3885,
"explorers": [],
"faucets": [],
"infoURL": "https://docs.thefirechain.com/",
"name": "Firechain zkEVM Ghostrider",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 3885,
"rpc": [
"https://firechain-zkevm-ghostrider.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://3885.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.zkevm.ghostrider.thefirechain.com"
],
"shortName": "firechain-zkEVM-ghostrider",
"slug": "firechain-zkevm-ghostrider",
"testnet": false,
"title": "Firechain zkEVM Ghostrider"
} as const satisfies Chain;
+35
View File
@@ -0,0 +1,35 @@
import type { Chain } from "../src/types";
export default {
"chain": "X1",
"chainId": 4003,
"explorers": [
{
"name": "Blockscout",
"url": "https://explorer.x1-fastnet.xen.network",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
"width": 551,
"height": 540,
"format": "png"
}
}
],
"faucets": [],
"infoURL": "https://docs.xen.network/go-x1/",
"name": "X1 Fastnet",
"nativeCurrency": {
"name": "XN",
"symbol": "XN",
"decimals": 18
},
"networkId": 4003,
"rpc": [
"https://x1-fastnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://4003.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://x1-fastnet.xen.network"
],
"shortName": "x1-fastnet",
"slug": "x1-fastnet",
"testnet": false
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "XFI",
"chainId": 4157,
"explorers": [
{
"name": "Scan Testnet",
"url": "https://scan.testnet.ms/",
"standard": "EIP1559"
}
],
"faucets": [],
"features": [],
"name": "CrossFi Testnet",
"nativeCurrency": {
"name": "XFI",
"symbol": "XFI",
"decimals": 18
},
"networkId": 4157,
"redFlags": [],
"rpc": [
"https://crossfi-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://4157.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.testnet.ms/"
],
"shortName": "XFI",
"slug": "crossfi-testnet",
"testnet": true,
"title": "https://scan.testnet.ms/"
} as const satisfies Chain;
+49
View File
@@ -0,0 +1,49 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 43851,
"explorers": [
{
"name": "ZKFair Testnet Info",
"url": "https://testnet-scan.zkfair.io",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmVb682D4mUXkKNP28xxJDNgSYbDLvEc3kVYx7TQxEa6Cw",
"width": 400,
"height": 400,
"format": "jpg"
}
}
],
"faucets": [],
"features": [
{
"name": "EIP155"
},
{
"name": "EIP1559"
}
],
"icon": {
"url": "ipfs://QmVb682D4mUXkKNP28xxJDNgSYbDLvEc3kVYx7TQxEa6Cw",
"width": 400,
"height": 400,
"format": "jpg"
},
"infoURL": "https://zkfair.io",
"name": "ZKFair Testnet",
"nativeCurrency": {
"name": "USDC Token",
"symbol": "USDC",
"decimals": 18
},
"networkId": 43851,
"rpc": [
"https://zkfair-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://43851.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnet-rpc.zkfair.io"
],
"shortName": "ZKFair-Testnet",
"slug": "zkfair-testnet",
"testnet": true
} as const satisfies Chain;
+35
View File
@@ -0,0 +1,35 @@
import type { Chain } from "../src/types";
export default {
"chain": "Areon",
"chainId": 463,
"explorers": [
{
"name": "AreonScan",
"url": "https://areonscan.com",
"standard": "none"
}
],
"faucets": [],
"icon": {
"url": "ipfs://bafkreihs2nrnizpcuzjmuu2yi7wrtwd7qlqje46qnil5bnntfbfkb2roea",
"width": 1000,
"height": 1000,
"format": "png"
},
"infoURL": "https://areon.network",
"name": "Areon Network Mainnet",
"nativeCurrency": {
"name": "Areon",
"symbol": "AREA",
"decimals": 18
},
"networkId": 463,
"rpc": [
"https://areon-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://463.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://mainnet-rpc.areon.network"
],
"shortName": "area",
"slug": "areon-network",
"testnet": false
} as const satisfies Chain;
+2 -2
View File
@@ -5,7 +5,7 @@ export default {
"explorers": [
{
"name": "Scroll Sepolia Etherscan",
"url": "https://sepolia.scrollscan.dev",
"url": "https://sepolia.scrollscan.com",
"standard": "EIP3091"
},
{
@@ -28,7 +28,7 @@ export default {
"chain": "eip155-11155111",
"bridges": [
{
"url": "https://scroll.io/bridge"
"url": "https://sepolia.scroll.io/bridge"
}
]
},
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 56914,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "KK1223",
"nativeCurrency": {
"name": "KK1223 Token",
"symbol": "KLK",
"decimals": 18
},
"networkId": 56914,
"redFlags": [],
"rpc": [
"https://kk1223.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://56914.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avacloud-dev.io/bf540c23-4601-4768-9e26-f2e5f0f89c18"
],
"shortName": "KK1223",
"slug": "kk1223",
"testnet": true
} as const satisfies Chain;
+41
View File
@@ -0,0 +1,41 @@
import type { Chain } from "../src/types";
export default {
"chain": "GCODE",
"chainId": 59971,
"explorers": [
{
"name": "Genesys Scan",
"url": "https://genesysscan.io",
"standard": "none",
"icon": {
"url": "ipfs://bafkreihgmpaceze7rxpajv7yrlx3cb6daqubippkpvgryzairtaubsjjoe",
"width": 512,
"height": 512,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://bafkreihgmpaceze7rxpajv7yrlx3cb6daqubippkpvgryzairtaubsjjoe",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://genesyscode.io",
"name": "Genesys Code Mainnet",
"nativeCurrency": {
"name": "GenesysCode",
"symbol": "GCODE",
"decimals": 18
},
"networkId": 59971,
"rpc": [
"https://genesys-code.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://59971.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://mainnet.genesyscode.io/"
],
"shortName": "gcode",
"slug": "genesys-code",
"testnet": false
} as const satisfies Chain;
+11 -10
View File
@@ -1,11 +1,11 @@
import type { Chain } from "../src/types";
export default {
"chain": "RTH",
"chain": "HYP",
"chainId": 622277,
"explorers": [
{
"name": "rethereum",
"url": "https://explorer.rethereum.org",
"name": "hypra",
"url": "https://explorer.hypra.network",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
@@ -30,22 +30,23 @@ export default {
"height": 830,
"format": "png"
},
"infoURL": "https://www.rethereum.org",
"name": "Rethereum Mainnet",
"infoURL": "https://www.hypra.network",
"name": "Hypra Mainnet",
"nativeCurrency": {
"name": "Rethereum",
"symbol": "RTH",
"name": "Hypra",
"symbol": "HYP",
"decimals": 18
},
"networkId": 622277,
"rpc": [
"https://rethereum.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://hypra.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://622277.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.hypra.network",
"https://rpc.rethereum.org",
"https://rethereum.rpc.restratagem.com",
"https://rpc.rthcentral.org"
],
"shortName": "rth",
"slug": "rethereum",
"shortName": "hyp",
"slug": "hypra",
"testnet": false
} as const satisfies Chain;
@@ -1,7 +1,7 @@
import type { Chain } from "../src/types";
export default {
"chain": "AUT",
"chainId": 65010000,
"chainId": 65010001,
"explorers": [
{
"name": "autonity-blockscout",
@@ -19,20 +19,20 @@ export default {
"format": "png"
},
"infoURL": "https://autonity.org/",
"name": "Autonity Bakerloo (Thames) Testnet",
"name": "Autonity Bakerloo (Barada) Testnet",
"nativeCurrency": {
"name": "Bakerloo Auton",
"symbol": "ATN",
"decimals": 18
},
"networkId": 65010000,
"networkId": 65010001,
"rpc": [
"https://autonity-bakerloo-thames-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://65010000.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://autonity-bakerloo-barada-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://65010001.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc1.bakerloo.autonity.org/",
"wss://rpc1.bakerloo.autonity.org/ws/"
],
"shortName": "bakerloo-0",
"slug": "autonity-bakerloo-thames-testnet",
"shortName": "bakerloo-01",
"slug": "autonity-bakerloo-barada-testnet",
"testnet": true
} as const satisfies Chain;
+29
View File
@@ -0,0 +1,29 @@
import type { Chain } from "../src/types";
export default {
"chain": "Kalichain",
"chainId": 653,
"explorers": [
{
"name": "kalichain explorer",
"url": "https://explorer.kalichain.com",
"standard": "EIP3091"
}
],
"faucets": [],
"infoURL": "https://kalichain.com",
"name": "Kalichain Mainnet",
"nativeCurrency": {
"name": "kalis",
"symbol": "KALIS",
"decimals": 18
},
"networkId": 653,
"rpc": [
"https://kalichain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://653.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.kalichain.com"
],
"shortName": "kalichain",
"slug": "kalichain",
"testnet": false
} as const satisfies Chain;
+27
View File
@@ -0,0 +1,27 @@
import type { Chain } from "../src/types";
export default {
"chain": "OCASH",
"chainId": 660868,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://ipfs.io/ipfs/QmbwuoezvkfZBY9nrZ65n3iHGyhJG6yDRyhPjqE6k3uCiM",
"width": 350,
"height": 350,
"format": "PNG"
},
"infoURL": "https://www.overline.network",
"name": "Ocash testnet",
"nativeCurrency": {
"name": "OCASH",
"symbol": "OCASH",
"decimals": 18
},
"networkId": 660868,
"redFlags": [],
"rpc": [],
"shortName": "ocash",
"slug": "ocash-testnet",
"testnet": true
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 69740,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "Will's Testnet",
"nativeCurrency": {
"name": "Will's Testnet Token",
"symbol": "WLDVNT",
"decimals": 18
},
"networkId": 69740,
"redFlags": [],
"rpc": [
"https://will-s-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://69740.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "Will's Testnet",
"slug": "will-s-testnet",
"testnet": true
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 70466,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "Cohan test3",
"nativeCurrency": {
"name": "Cohan test3 Token",
"symbol": "HYN",
"decimals": 18
},
"networkId": 70466,
"redFlags": [],
"rpc": [
"https://cohan-test3.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://70466.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avacloud-dev.io/f44b72ee-0574-44d2-a10b-363a74964145"
],
"shortName": "Cohan test3",
"slug": "cohan-test3",
"testnet": true
} as const satisfies Chain;
+24
View File
@@ -0,0 +1,24 @@
import type { Chain } from "../src/types";
export default {
"chain": "BLU",
"chainId": 727,
"explorers": [],
"faucets": [],
"infoURL": "https://www.blucrates.com",
"name": "Blucrates",
"nativeCurrency": {
"name": "Blucrates",
"symbol": "BLU",
"decimals": 18
},
"networkId": 727,
"rpc": [
"https://blucrates.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://727.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://data.bluchain.pro"
],
"shortName": "blu",
"slip44": 727,
"slug": "blucrates",
"testnet": false
} as const satisfies Chain;
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 80182,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "QI M 12051",
"nativeCurrency": {
"name": "QI M 12051 Token",
"symbol": "VTV",
"decimals": 18
},
"networkId": 80182,
"redFlags": [],
"rpc": [
"https://qi-m-12051.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://80182.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avacloud-dev.io/b19c9e32-f359-451f-ad15-7ec784625c04"
],
"shortName": "QI M 12051",
"slug": "qi-m-12051",
"testnet": true
} as const satisfies Chain;
+29
View File
@@ -0,0 +1,29 @@
import type { Chain } from "../src/types";
export default {
"chain": "Nordek",
"chainId": 81041,
"explorers": [
{
"name": "nordek",
"url": "https://nordekscan.com",
"standard": "EIP3091"
}
],
"faucets": [],
"infoURL": "https://nordekscan.com",
"name": "Nordek Mainnet",
"nativeCurrency": {
"name": "NRK",
"symbol": "NRK",
"decimals": 18
},
"networkId": 81041,
"rpc": [
"https://nordek.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://81041.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://mainnet-rpc.nordekscan.com"
],
"shortName": "nordek",
"slug": "nordek",
"testnet": false
} as const satisfies Chain;
+39
View File
@@ -0,0 +1,39 @@
import type { Chain } from "../src/types";
export default {
"chain": "Firechain",
"chainId": 814,
"explorers": [],
"faucets": [],
"icon": {
"url": "ipfs://QmYjuztyURb3Fc6ZTLgCbwQa64CcVoigF5j9cafzuSbqgf",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://docs.thefirechain.com/",
"name": "Firechain zkEVM",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 814,
"parent": {
"type": "L2",
"chain": "eip155-1",
"bridges": [
{
"url": "https://zkevm.bridge.rpc.thefirechain.com"
}
]
},
"rpc": [
"https://firechain-zkevm.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://814.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.zkevm.thefirechain.com"
],
"shortName": "firechan-zkEVM",
"slug": "firechain-zkevm",
"testnet": false,
"title": "Firechain zkEVM"
} as const satisfies Chain;
+1 -1
View File
@@ -5,7 +5,7 @@ export default {
"explorers": [
{
"name": "blockscout",
"url": "https://testnet.torusscan.com",
"url": "https://testnet.toruscan.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM",
+31
View File
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 88883,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": ".svg"
},
"infoURL": "https://avacloud.io",
"name": "Proj Orc Testnet Alpha",
"nativeCurrency": {
"name": "Proj Orc Testnet Alpha Token",
"symbol": "STX",
"decimals": 18
},
"networkId": 88883,
"redFlags": [],
"rpc": [
"https://proj-orc-testnet-alpha.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://88883.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/projorctes/testnet/rpc"
],
"shortName": "Proj Orc Testnet Alpha",
"slug": "proj-orc-testnet-alpha",
"testnet": true
} as const satisfies Chain;
+2 -1
View File
@@ -29,7 +29,8 @@ export default {
"rpc": [
"https://jibchain-l1.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://8899.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-l1.jibchain.net"
"https://rpc-l1.jibchain.net",
"https://jib-rpc.inan.in.th"
],
"shortName": "jbc",
"slug": "jibchain-l1",
+17 -5
View File
@@ -2,12 +2,24 @@ import type { Chain } from "../src/types";
export default {
"chain": "Oort Mainnet",
"chainId": 970,
"explorers": [],
"explorers": [
{
"name": "Oort Mainnet Explorer",
"url": "https://mainnet-scan.oortech.com",
"standard": "none",
"icon": {
"url": "ipfs://bafkreidrbvklkb52sgmg7cmy42fhf7vqpig7qj7bnrq24ijdwywkzr2tfy",
"width": 1440,
"height": 1440,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmZ1jbxFZcuotj3eZ6iKFrg9ZXnaV8AK6sGRa7ELrceWyD",
"width": 1043,
"height": 1079,
"url": "ipfs://bafkreidrbvklkb52sgmg7cmy42fhf7vqpig7qj7bnrq24ijdwywkzr2tfy",
"width": 1440,
"height": 1440,
"format": "png"
},
"infoURL": "https://oortech.com",
@@ -21,7 +33,7 @@ export default {
"rpc": [
"https://oort.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://970.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.oortech.com"
"https://mainnet-rpc.oortech.com"
],
"shortName": "ccn",
"slug": "oort",
+21 -5
View File
@@ -2,12 +2,24 @@ import type { Chain } from "../src/types";
export default {
"chain": "MainnetDev",
"chainId": 9700,
"explorers": [],
"explorers": [
{
"name": "Oort MainnetDev Scan",
"url": "https://dev-scan.oortech.com",
"standard": "none",
"icon": {
"url": "ipfs://bafkreidrbvklkb52sgmg7cmy42fhf7vqpig7qj7bnrq24ijdwywkzr2tfy",
"width": 1440,
"height": 1440,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmZ1jbxFZcuotj3eZ6iKFrg9ZXnaV8AK6sGRa7ELrceWyD",
"width": 1043,
"height": 1079,
"url": "ipfs://bafkreidrbvklkb52sgmg7cmy42fhf7vqpig7qj7bnrq24ijdwywkzr2tfy",
"width": 1440,
"height": 1440,
"format": "png"
},
"infoURL": "https://oortech.com",
@@ -18,7 +30,11 @@ export default {
"decimals": 18
},
"networkId": 9700,
"rpc": [],
"rpc": [
"https://oort-dev.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://9700.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://dev-rpc.oortech.com"
],
"shortName": "MainnetDev",
"slug": "oort-dev",
"testnet": false,
+16 -4
View File
@@ -2,12 +2,24 @@ import type { Chain } from "../src/types";
export default {
"chain": "Ascraeus",
"chainId": 972,
"explorers": [],
"explorers": [
{
"name": "Oort Ascraeus Explorer",
"url": "https://ascraeus-scan.oortech.com",
"standard": "none",
"icon": {
"url": "ipfs://bafkreidrbvklkb52sgmg7cmy42fhf7vqpig7qj7bnrq24ijdwywkzr2tfy",
"width": 1440,
"height": 1440,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://QmZ1jbxFZcuotj3eZ6iKFrg9ZXnaV8AK6sGRa7ELrceWyD",
"width": 1043,
"height": 1079,
"url": "ipfs://bafkreidrbvklkb52sgmg7cmy42fhf7vqpig7qj7bnrq24ijdwywkzr2tfy",
"width": 1440,
"height": 1440,
"format": "png"
},
"infoURL": "https://oortech.com",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/chains",
"version": "0.1.60",
"version": "0.1.61",
"main": "dist/thirdweb-dev-chains.cjs.js",
"module": "dist/thirdweb-dev-chains.esm.js",
"exports": {
File diff suppressed because one or more lines are too long
+36
View File
@@ -1,5 +1,41 @@
# thirdweb
## 0.13.26
### Patch Changes
- Updated dependencies [[`c701c388`](https://github.com/thirdweb-dev/js/commit/c701c388c65a1e531b88991d8fd67d25f153992e)]:
- @thirdweb-dev/sdk@4.0.22
- @thirdweb-dev/wallets@2.3.1
- @thirdweb-dev/auth@4.1.18
## 0.13.25
### Patch Changes
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
- @thirdweb-dev/wallets@2.3.0
- @thirdweb-dev/auth@4.1.17
## 0.13.24
### Patch Changes
- Updated dependencies [[`bcfa9463`](https://github.com/thirdweb-dev/js/commit/bcfa9463bbae6bf1d3b6389b7a141f65ef3e1173)]:
- @thirdweb-dev/sdk@4.0.21
- @thirdweb-dev/wallets@2.2.1
- @thirdweb-dev/auth@4.1.16
## 0.13.23
### Patch Changes
- Updated dependencies [[`d2001ca4`](https://github.com/thirdweb-dev/js/commit/d2001ca464aa699ac821c97eb37de7409ba865f3), [`85842c15`](https://github.com/thirdweb-dev/js/commit/85842c1596c901e228be1894b6702a8871d9e794), [`e595d4d9`](https://github.com/thirdweb-dev/js/commit/e595d4d92f03e36cbe61e1f00a366e37ede5d814), [`497677f3`](https://github.com/thirdweb-dev/js/commit/497677f3596977fa90ebc0fa76cb5842d46d8dcf), [`94966069`](https://github.com/thirdweb-dev/js/commit/9496606964d65268f8ee6bf9f78b2786e99d33ac), [`15ae5e7f`](https://github.com/thirdweb-dev/js/commit/15ae5e7f95a482a9736923c0e10916a0a6115c3d)]:
- @thirdweb-dev/chains@0.1.61
- @thirdweb-dev/sdk@4.0.20
- @thirdweb-dev/wallets@2.2.0
- @thirdweb-dev/auth@4.1.15
## 0.13.22
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "thirdweb",
"main": "dist/cli/index.js",
"version": "0.13.22",
"version": "0.13.26",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
+38
View File
@@ -1,5 +1,43 @@
# @thirdweb-dev/react-core
## 4.1.16
### Patch Changes
- [#2082](https://github.com/thirdweb-dev/js/pull/2082) [`699f31c2`](https://github.com/thirdweb-dev/js/commit/699f31c20a76cd284dbed1629c4a19d93aca7b7f) Thanks [@iketw](https://github.com/iketw)! - Better comments
- Updated dependencies [[`c701c388`](https://github.com/thirdweb-dev/js/commit/c701c388c65a1e531b88991d8fd67d25f153992e)]:
- @thirdweb-dev/sdk@4.0.22
- @thirdweb-dev/wallets@2.3.1
- @thirdweb-dev/auth@4.1.18
## 4.1.15
### Patch Changes
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
- @thirdweb-dev/wallets@2.3.0
- @thirdweb-dev/auth@4.1.17
## 4.1.14
### Patch Changes
- Updated dependencies [[`bcfa9463`](https://github.com/thirdweb-dev/js/commit/bcfa9463bbae6bf1d3b6389b7a141f65ef3e1173)]:
- @thirdweb-dev/sdk@4.0.21
- @thirdweb-dev/wallets@2.2.1
- @thirdweb-dev/auth@4.1.16
## 4.1.13
### Patch Changes
- Updated dependencies [[`d2001ca4`](https://github.com/thirdweb-dev/js/commit/d2001ca464aa699ac821c97eb37de7409ba865f3), [`85842c15`](https://github.com/thirdweb-dev/js/commit/85842c1596c901e228be1894b6702a8871d9e794), [`e595d4d9`](https://github.com/thirdweb-dev/js/commit/e595d4d92f03e36cbe61e1f00a366e37ede5d814), [`497677f3`](https://github.com/thirdweb-dev/js/commit/497677f3596977fa90ebc0fa76cb5842d46d8dcf), [`94966069`](https://github.com/thirdweb-dev/js/commit/9496606964d65268f8ee6bf9f78b2786e99d33ac), [`15ae5e7f`](https://github.com/thirdweb-dev/js/commit/15ae5e7f95a482a9736923c0e10916a0a6115c3d)]:
- @thirdweb-dev/chains@0.1.61
- @thirdweb-dev/sdk@4.0.20
- @thirdweb-dev/wallets@2.2.0
- @thirdweb-dev/auth@4.1.15
## 4.1.12
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-core",
"version": "4.1.12",
"version": "4.1.16",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -84,11 +84,10 @@ export interface ThirdwebProviderCoreProps<TChains extends Chain[]>
/**
* @internal
*/
export const ThirdwebProviderCore = <TChains extends Chain[]>({
createWalletStorage = createAsyncLocalStorage,
...props
}: React.PropsWithChildren<ThirdwebProviderCoreProps<TChains>>) => {
const { activeChain } = props;
export const ThirdwebProviderCore = <TChains extends Chain[]>(
props: React.PropsWithChildren<ThirdwebProviderCoreProps<TChains>>,
) => {
const { activeChain, createWalletStorage = createAsyncLocalStorage } = props;
const supportedChains = (props.supportedChains || defaultChains) as Chain[];
@@ -1,5 +1,10 @@
import { createContext, useContext } from "react";
/**
* Secure storage interface for storing auth tokens.
*
* The implementation of this interface should provide a secure way to store values. Either by encrypting the values or by storing them in a secure location.
*/
export interface ISecureStorage {
getItem(key: string): Promise<string | null>;
setItem(key: string, value: string): Promise<void>;
@@ -7,7 +12,7 @@ export interface ISecureStorage {
}
/**
* The configuration to use the react SDK with an [auth](https://portal.thirdweb.com/auth) server.
* The configuration to use by the React and React Native SDKs with an [auth](https://portal.thirdweb.com/auth) server.
*
*/
export interface ThirdwebAuthConfig {
@@ -12,8 +12,33 @@ import { AUTH_TOKEN_STORAGE_KEY } from "../../../core/constants/auth";
*
* @returns - A function to invoke to login with the connected wallet, and an isLoading state.
*
* @see {@link https://portal.thirdweb.com/react/react.uselogin?utm_source=sdk | Documentation}
* @example
* ```tsx
* function App() {
* const { isLoading, login } = useLogin();
*
* return (
* <button onClick={() => login()}>
* {isLoading ? "Loading..." : "Sign in with Ethereum"}
* </button>
* );
* }
* ```
*
* ```tsx
* // options
* login({
* domain: "https://your-domain.com", // Your dapp domain
* statement: "My statement", // Text that the user will sign
* uri: "https://your-domain.com/login", // RFC 3986 URI referring to the resource that is the subject of the signing
* version: "1.0", // The current version of the message, which MUST be 1 for this specification.
* chainId: "mainnet", // Chain ID to which the session is bound
* nonce: "my-nonce", // randomized token typically used to prevent replay attacks
* expirationTime: new Date(2021, 1, 1), // When this message expires
* invalidBefore: new Date(2020, 12, 1), // When this message becomes valid
* resources: ["balance", "history", "info"], // A list of information or references to information the user wishes to have resolved
* })
* ```
*/
export function useLogin() {
const queryClient = useQueryClient();
@@ -10,8 +10,18 @@ import invariant from "tiny-invariant";
*
* @returns - A function to invoke to logout.
*
* @see {@link https://portal.thirdweb.com/react/react.uselogout?utm_source=sdk | Documentation}
* @example
* ```tsx
* function App() {
* const { logout, isLoading } = useLogout();
*
* return (
* <button onClick={() => logout()}>
* {isLoading ? "Logging out..." : "Logout"}
* </button>
* );
*}
* ```
*/
export function useLogout() {
const queryClient = useQueryClient();
@@ -16,9 +16,23 @@ export interface UserWithData<
* Hook to get the currently logged in user.
*
* @returns - The currently logged in user or null if not logged in, as well as a loading state.
* ```tsx
* {
* user: {
* address: string;
* session?: Json;
* } | undefined;
* isLoggedIn: boolean;
* isLoading: boolean;
*}
* ```
*
* @see {@link https://portal.thirdweb.com/react/react.useuser?utm_source=sdk | Documentation}
*
* @example
* ```tsx
* function App() {
* const { user, isLoggedIn, isLoading } = useUser();
* }
* ```
*/
export function useUser<
TData extends Json = Json,
@@ -1,9 +1,27 @@
import { useSDK } from "../useSDK";
/**
* Get the configured `ThirdwebStorage` instance
* Get the configured `ThirdwebStorage` instance in the `ThirdwebProvider`.
*
* @returns The `storageInterface` configured on the `ThirdwebProvider`
* @see {@link https://portal.thirdweb.com/react/react.usestorage?utm_source=sdk | Documentation}
*
* @example
* ```tsx
* const storage = useStorage();
*
* cost resp = storage?.download("ipfs-url"); // Download a file from IPFS
* if (resp.ok) {
* const value = await resp?.json();
* }
*
* const fileIpfsHash = await storage?.upload({
* name: 'file1',
* type: 'file-mime-type',
* uri: 'file-uri-on-device',
* }); // Upload a file to IPFS
* const objIpfsHash = await storage?.upload({key: 'value'}); // Upload an object to IPFS
* const strIpfsHash = await storage?.upload('string-to-upload'); // Upload a string to IPFS
* ```
*/
export function useStorage() {
const sdk = useSDK();
+2 -4
View File
@@ -3,9 +3,7 @@ import type {
AirdropInput,
Amount,
Erc721,
Erc721Mintable,
Erc1155,
Erc1155Mintable,
ListingType,
NFTMetadataInput,
Price,
@@ -150,9 +148,9 @@ export type MintNFTParams = {
*
*/
export type MintNFTReturnType<TContract> = TContract extends Erc721
? Awaited<ReturnType<Erc721Mintable["to"]>>
? Awaited<ReturnType<Erc721["mintTo"]>>
: TContract extends Erc1155
? Awaited<ReturnType<Erc1155Mintable["to"]>>
? Awaited<ReturnType<Erc1155["mintTo"]>>
: never;
/**
@@ -1,5 +1,13 @@
# @thirdweb-dev/react-native-compat
## 0.5.1
## 0.5.0
## 0.4.14
## 0.4.13
## 0.4.12
## 0.4.11
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@thirdweb-dev/react-native-compat",
"description": "Shims for Thirdweb in React Native Projects",
"version": "0.4.12",
"version": "0.5.1",
"author": "thirdweb eng <[email protected]>",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
"license": "Apache-2.0",
+66
View File
@@ -1,5 +1,71 @@
# @thirdweb-dev/react-native
## 0.5.1
### Patch Changes
- [#2074](https://github.com/thirdweb-dev/js/pull/2074) [`07fbb799`](https://github.com/thirdweb-dev/js/commit/07fbb799be87c1c5229ae3183fa8bc67ae15c756) Thanks [@iketw](https://github.com/iketw)! - Adds the ability to login with any arbitrary login payload
```typescript
await embeddedWallet.authenticate({
strategy: "auth_endpoint",
payload: "SOME_STRING",
encryptionKey: "",
});
```
- [#2082](https://github.com/thirdweb-dev/js/pull/2082) [`699f31c2`](https://github.com/thirdweb-dev/js/commit/699f31c20a76cd284dbed1629c4a19d93aca7b7f) Thanks [@iketw](https://github.com/iketw)! - Better comments
- [#2086](https://github.com/thirdweb-dev/js/pull/2086) [`328ef5dc`](https://github.com/thirdweb-dev/js/commit/328ef5dc9c628a89a022a559852dfa2a788f70cb) Thanks [@iketw](https://github.com/iketw)! - Hide WC modal back button when only WC is defined as a supportedWallet
- Updated dependencies [[`c701c388`](https://github.com/thirdweb-dev/js/commit/c701c388c65a1e531b88991d8fd67d25f153992e), [`699f31c2`](https://github.com/thirdweb-dev/js/commit/699f31c20a76cd284dbed1629c4a19d93aca7b7f)]:
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
## 0.5.0
### Minor Changes
- [#2018](https://github.com/thirdweb-dev/js/pull/2018) [`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba) Thanks [@iketw](https://github.com/iketw)! - Enforces passing an encryption key for custom jwt auth
```typescript
const embedded = useEmbeddedWallet();
embedded.connect({
jwt: "<token>",
encryptionKey: "<my-key>",
strategy: "jwt",
});
```
### Patch Changes
- [#2072](https://github.com/thirdweb-dev/js/pull/2072) [`2346396b`](https://github.com/thirdweb-dev/js/commit/2346396bdffeed169cdfc15839bfb42d87f24303) Thanks [@iketw](https://github.com/iketw)! - Adds analytics nonce to embedded wallet
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
## 0.4.14
### Patch Changes
- Updated dependencies [[`bcfa9463`](https://github.com/thirdweb-dev/js/commit/bcfa9463bbae6bf1d3b6389b7a141f65ef3e1173)]:
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
## 0.4.13
### Patch Changes
- Updated dependencies [[`d2001ca4`](https://github.com/thirdweb-dev/js/commit/d2001ca464aa699ac821c97eb37de7409ba865f3), [`85842c15`](https://github.com/thirdweb-dev/js/commit/85842c1596c901e228be1894b6702a8871d9e794), [`e595d4d9`](https://github.com/thirdweb-dev/js/commit/e595d4d92f03e36cbe61e1f00a366e37ede5d814), [`497677f3`](https://github.com/thirdweb-dev/js/commit/497677f3596977fa90ebc0fa76cb5842d46d8dcf), [`94966069`](https://github.com/thirdweb-dev/js/commit/9496606964d65268f8ee6bf9f78b2786e99d33ac), [`15ae5e7f`](https://github.com/thirdweb-dev/js/commit/15ae5e7f95a482a9736923c0e10916a0a6115c3d)]:
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
## 0.4.12
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-native",
"version": "0.4.12",
"version": "0.5.1",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -12,17 +12,16 @@ import { DEFAULT_WALLETS } from "../constants/wallets";
import { DappContextProvider } from "./context-provider";
import { UIContextProvider } from "./ui-context-provider";
import { MainModal } from "../components/MainModal";
import { ThemeProvider } from "../styles/ThemeProvider";
import { ThemeProvider, ThemeType } from "../styles/ThemeProvider";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { walletIds } from "@thirdweb-dev/wallets";
import { ThirdwebStorage } from "../../core/storage/storage";
import { useColorScheme } from "react-native";
import type { Locale } from "../i18n/types";
interface ThirdwebProviderProps<TChains extends Chain[]>
extends Omit<
ThirdwebProviderCoreProps<TChains>,
"supportedWallets" | "secretKey" | "signer"
"supportedWallets" | "secretKey" | "signer" | "theme"
> {
/**
* Wallets that will be supported by the dApp
@@ -47,6 +46,27 @@ interface ThirdwebProviderProps<TChains extends Chain[]>
*/
supportedWallets?: WalletConfig<any>[];
/**
* Set the theme for all thirdweb components
*
* By default it is set to "dark".
*
* theme can be set to either "dark" or "light" or a custom theme object.
*
* You can also import `lightTheme` or `darkTheme` functions from `@thirdweb-dev/react-native` to use the default themes as base and overrides parts of it.
*
* @example
* ```ts
* import { darkTheme } from "@thirdweb-dev/react-native";
* const customTheme = darkTheme({
* colors: {
* accentButtonColor: 'black',
* },
* })
* ```
*/
theme?: ThemeType;
/**
* Locale that the app will be displayed in
*
@@ -87,10 +107,15 @@ interface ThirdwebProviderProps<TChains extends Chain[]>
locale?: Locale;
}
/**
* Array of default supported chains by the thirdweb SDK
*/
export type DefaultChains = typeof defaultChains;
/**
*
* The `<ThirdwebProvider />` component lets you control what networks you want users to connect to,
* what types of wallets can connect to your app, and the settings for the [Thirdweb SDK](https://docs.thirdweb.com/typescript).
* what types of wallets can connect to your app, and the settings for the Thirdweb SDK.
*
* @example
* You can wrap your application with the provider as follows:
@@ -107,21 +132,21 @@ interface ThirdwebProviderProps<TChains extends Chain[]>
* };
* ```
*/
export const ThirdwebProvider = <
TChains extends Chain[] = typeof defaultChains,
>({
children,
createWalletStorage = createAsyncLocalStorage,
supportedWallets = DEFAULT_WALLETS,
authConfig,
theme,
storageInterface,
clientId,
sdkOptions,
locale = "en",
...restProps
}: PropsWithChildren<ThirdwebProviderProps<TChains>>) => {
const colorScheme = useColorScheme();
export const ThirdwebProvider = <TChains extends Chain[] = DefaultChains>(
props: PropsWithChildren<ThirdwebProviderProps<TChains>>,
) => {
const {
children,
createWalletStorage = createAsyncLocalStorage,
supportedWallets = DEFAULT_WALLETS,
authConfig,
theme,
storageInterface,
clientId,
sdkOptions,
locale = "en",
...restProps
} = props;
const coinbaseWalletObj = supportedWallets.find(
(w) => w.id === walletIds.coinbase,
@@ -161,9 +186,7 @@ export const ThirdwebProvider = <
{...sdkOptions}
{...restProps}
>
<ThemeProvider
theme={theme ? theme : colorScheme === "dark" ? "dark" : "light"}
>
<ThemeProvider theme={theme ? theme : "dark"}>
<UIContextProvider locale={locale}>
{hasMagicConfig ? (
<SafeAreaProvider>
@@ -5,8 +5,10 @@ import { PropsWithChildren, useContext } from "react";
import { useColorScheme } from "react-native";
import { useUIContext } from "../providers/ui-context-provider";
export type ThemeType = "dark" | "light" | Theme;
export type ThemeProviderProps = {
theme?: Theme | "light" | "dark";
theme?: ThemeType;
};
export function ThemeProvider({
@@ -1,4 +1,5 @@
import {
AuthEndpointOptions,
AuthOptions,
AuthParams,
AuthResult,
@@ -11,6 +12,7 @@ import type { Chain } from "@thirdweb-dev/chains";
import { providers, Signer } from "ethers";
import { utils } from "ethers";
import {
authEndpoint,
customJwt,
sendVerificationEmail,
socialLogin,
@@ -101,7 +103,13 @@ export class EmbeddedWalletConnector extends Connector<EmbeddedWalletConnectionA
case "jwt": {
return this.customJwt({
jwt: params.jwt,
password: params.encryptionKey || "",
password: params.encryptionKey,
});
}
case "auth_endpoint": {
return this.authEndpoint({
payload: params.payload,
encryptionKey: params.encryptionKey,
});
}
default:
@@ -230,6 +238,33 @@ export class EmbeddedWalletConnector extends Connector<EmbeddedWalletConnectionA
}
}
private async authEndpoint(
authOptions: AuthEndpointOptions,
): Promise<AuthResult> {
try {
const { verifiedToken, email } = await authEndpoint(
authOptions,
this.options.clientId,
);
this.email = email;
return {
user: {
status: UserWalletStatus.LOGGED_IN_WALLET_INITIALIZED,
recoveryShareManagement:
verifiedToken.authDetails.recoveryShareManagement,
},
isNewUser: verifiedToken.isNewUser,
needsRecoveryCode:
verifiedToken.authDetails.recoveryShareManagement ===
RecoveryShareManagement.USER_MANAGED,
};
} catch (error) {
console.error(`Error while verifying auth_endpoint auth: ${error}`);
this.disconnect();
throw error;
}
}
async disconnect(): Promise<void> {
clearConnectedEmail();
clearConnectedAuthStrategy();
@@ -27,10 +27,17 @@ import { Auth } from "aws-amplify";
import {
DOMAIN_URL_2023,
EWS_VERSION_HEADER,
ROUTE_AUTH_ENDPOINT_CALLBACK,
ROUTE_AUTH_JWT_CALLBACK,
ROUTE_HEADLESS_OAUTH_LOGIN,
THIRDWEB_SESSION_NONCE_HEADER,
} from "./helpers/constants";
import { AuthOptions, OauthOption, VerifiedTokenResponse } from "../types";
import {
AuthEndpointOptions,
AuthOptions,
OauthOption,
VerifiedTokenResponse,
} from "../types";
import { InAppBrowser } from "react-native-inappbrowser-reborn";
import { createErrorMessage } from "./helpers/errors";
import {
@@ -38,6 +45,7 @@ import {
reactNativePackageVersion,
} from "../../../../utils/version";
import { BUNDLE_ID_HEADER } from "../../../../constants/headers";
import { ANALYTICS } from "./helpers/analytics";
export async function sendVerificationEmail(options: {
email: string;
@@ -189,6 +197,7 @@ export async function socialLogin(oauthOptions: OauthOption, clientId: string) {
headers: {
[EWS_VERSION_HEADER]: reactNativePackageVersion,
[BUNDLE_ID_HEADER]: appBundleId,
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
},
});
@@ -271,6 +280,7 @@ export async function customJwt(authOptions: AuthOptions, clientId: string) {
"Content-Type": "application/json",
[EWS_VERSION_HEADER]: reactNativePackageVersion,
[BUNDLE_ID_HEADER]: appBundleId,
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
},
body: JSON.stringify({
jwt: jwt,
@@ -303,7 +313,62 @@ export async function customJwt(authOptions: AuthOptions, clientId: string) {
return { verifiedToken, email: verifiedToken.authDetails.email };
} catch (e) {
throw new Error(
createErrorMessage("Malformed response from post authentication", e),
createErrorMessage("Malformed response from post jwt authentication", e),
);
}
}
export async function authEndpoint(
authOptions: AuthEndpointOptions,
clientId: string,
) {
const { payload, encryptionKey } = authOptions;
const resp = await fetch(ROUTE_AUTH_ENDPOINT_CALLBACK, {
method: "POST",
headers: {
"Content-Type": "application/json",
[EWS_VERSION_HEADER]: reactNativePackageVersion,
[BUNDLE_ID_HEADER]: appBundleId,
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
},
body: JSON.stringify({
payload: payload,
developerClientId: clientId,
}),
});
if (!resp.ok) {
const error = await resp.json();
throw new Error(
`Custom auth endpoint authentication error: ${error.message}`,
);
}
try {
const { verifiedToken, verifiedTokenJwtString } = await resp.json();
const toStoreToken: AuthStoredTokenWithCookieReturnType["storedToken"] = {
jwtToken: verifiedToken.jwtToken,
authProvider: verifiedToken.authProvider,
authDetails: {
...verifiedToken.authDetails,
email: verifiedToken.authDetails.email,
},
developerClientId: verifiedToken.developerClientId,
cookieString: verifiedTokenJwtString,
shouldStoreCookieString: true,
isNewUser: verifiedToken.isNewUser,
};
await postPaperAuthUserManaged(toStoreToken, clientId, encryptionKey);
return { verifiedToken, email: verifiedToken.authDetails.email };
} catch (e) {
throw new Error(
createErrorMessage(
"Malformed response from post auth_endpoint authentication",
e,
),
);
}
}
@@ -0,0 +1,5 @@
import { getRandomString } from "./getRandomValues";
export const ANALYTICS = {
nonce: getRandomString(16),
};
@@ -8,6 +8,7 @@ import {
ROUTE_VALIDATE_USER_MANAGED_OTP,
ROUTE_IS_VALID_USER_MANAGED_OTP,
EWS_VERSION_HEADER,
THIRDWEB_SESSION_NONCE_HEADER,
} from "../constants";
import { getAuthTokenClient } from "../storage/local";
import {
@@ -24,6 +25,7 @@ import {
reactNativePackageVersion,
} from "../../../../../../utils/version";
import { BUNDLE_ID_HEADER } from "../../../../../../constants/headers";
import { ANALYTICS } from "../analytics";
const EMBEDDED_WALLET_TOKEN_HEADER = "embedded-wallet-token";
const PAPER_CLIENT_ID_HEADER = "x-thirdweb-client-id";
@@ -31,6 +33,7 @@ const HEADERS = {
"Content-Type": "application/json",
[BUNDLE_ID_HEADER]: appBundleId,
[EWS_VERSION_HEADER]: reactNativePackageVersion,
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
};
export const verifyClientId = async (clientId: string) => {
@@ -68,6 +71,7 @@ export const authFetchEmbeddedWalletUser = async (
[BUNDLE_ID_HEADER]: appBundleId,
[PAPER_CLIENT_ID_HEADER]: clientId,
[EWS_VERSION_HEADER]: reactNativePackageVersion,
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
}
: {
Authorization: `Bearer ${EMBEDDED_WALLET_TOKEN_HEADER}:${
@@ -76,6 +80,7 @@ export const authFetchEmbeddedWalletUser = async (
[BUNDLE_ID_HEADER]: appBundleId,
[PAPER_CLIENT_ID_HEADER]: clientId,
[EWS_VERSION_HEADER]: reactNativePackageVersion,
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
};
return fetch(url, params);
};
@@ -4,7 +4,7 @@ import {
COGNITO_APP_CLIENT_ID,
COGNITO_USER_POOL_ID,
} from "../constants";
import { getRandomValues } from "../getRandomValues";
import { getRandomString } from "../getRandomValues";
Amplify.configure({
Auth: {
@@ -25,13 +25,6 @@ export async function cognitoEmailSignUp(email: string, clientId: string) {
await Auth.signOut();
}
function getRandomString(bytes: number) {
const randomValues = getRandomValues(new Uint8Array(bytes));
return Array.from(randomValues)
.map((nr) => nr.toString(16).padStart(2, "0"))
.join("");
}
export async function cognitoEmailSignIn(email: string, clientId: string) {
const cognitoUser = await Auth.signIn(`${email}:email:${clientId}`);
return cognitoUser;
@@ -127,15 +127,16 @@ async function getRecoveryCode(
storedToken.authDetails.recoveryShareManagement ===
RecoveryShareManagement.CLOUD_MANAGED
) {
if (storedToken.authProvider === AuthProvider.CUSTOM_JWT) {
// derive sub here
const code = extractSubFromJwt(storedToken.jwtToken);
if (!code) {
if (
storedToken.authProvider === AuthProvider.CUSTOM_JWT ||
storedToken.authProvider === AuthProvider.CUSTOM_AUTH_ENDPOINT
) {
if (!recoveryCode) {
throw new Error(
`GetRecoveryCode error: ${ErrorMessages.missingRecoveryCode}`,
);
}
return code;
return recoveryCode;
} else {
try {
const code = await getCognitoRecoveryPassword(clientId);
@@ -156,25 +157,3 @@ async function getRecoveryCode(
throw new Error("Invalid recovery share management option");
}
}
function extractSubFromJwt(jwtToken: string): string | undefined {
const parts = jwtToken.split(".");
if (parts.length !== 3) {
throw new Error("Invalid JWT format.");
}
const encodedPayload = parts[1];
if (!encodedPayload) {
throw new Error("Invalid JWT format.");
}
const decodedPayload = Buffer.from(encodedPayload, "base64").toString("utf8");
try {
const payloadObject = JSON.parse(decodedPayload);
if (payloadObject && payloadObject.sub) {
return payloadObject.sub;
}
} catch (error) {
throw new Error("Error parsing JWT payload as JSON.");
}
}
@@ -13,6 +13,7 @@ export const RECOVERY_SHARE_INDEX = RECOVERY_SHARE_ID - 1;
export const AWS_REGION = "us-west-2";
export const EWS_VERSION_HEADER = "x-embedded-wallet-version";
export const THIRDWEB_SESSION_NONCE_HEADER = "x-session-nonce";
export const COGNITO_USER_POOL_ID = "us-west-2_UFwLcZIpq";
export const COGNITO_APP_CLIENT_ID = "2e02ha2ce6du13ldk8pai4h3d0";
@@ -33,6 +34,7 @@ export const ROUTE_STORE_USER_SHARES = `${ROUTE_2023_10_20_API_BASE_PATH}/embedd
export const ROUTE_GET_USER_SHARES = `${ROUTE_2023_10_20_API_BASE_PATH}/embedded-wallet/embedded-wallet-shares`;
export const ROUTE_VERIFY_THIRDWEB_CLIENT_ID = `${ROUTE_2023_10_20_API_BASE_PATH}/embedded-wallet/verify-thirdweb-client-id`;
export const ROUTE_AUTH_JWT_CALLBACK = `${ROUTE_2023_10_20_API_BASE_PATH}/embedded-wallet/validate-custom-jwt`;
export const ROUTE_AUTH_ENDPOINT_CALLBACK = `${ROUTE_2023_10_20_API_BASE_PATH}/embedded-wallet/validate-custom-auth-endpoint`;
export const ROUTE_USER_MANAGED_OTP = `${ROUTE_2023_10_20_API_BASE_PATH}/embedded-wallet/send-user-managed-email-otp`;
export const ROUTE_VALIDATE_USER_MANAGED_OTP = `${ROUTE_2023_10_20_API_BASE_PATH}/embedded-wallet/validate-thirdweb-email-otp`;
@@ -11,3 +11,10 @@ export function getRandomValues<T extends IntArrayBufferView>(array: T): T {
// @ts-ignore getRandomValues is polyfilled
return crypto.getRandomValues(array);
}
export function getRandomString(bytes: number) {
const randomValues = getRandomValues(new Uint8Array(bytes));
return Array.from(randomValues)
.map((nr) => nr.toString(16).padStart(2, "0"))
.join("");
}
@@ -44,6 +44,11 @@ export interface AuthOptions {
password: string;
}
export interface AuthEndpointOptions {
payload: string;
encryptionKey: string;
}
export type SendEmailOtpReturnType = {
isNewUser: boolean;
isNewDevice: boolean;
@@ -70,14 +75,21 @@ type SocialAuthParams = {
type JwtAuthParams = {
strategy: "jwt";
jwt: string;
encryptionKey?: string;
encryptionKey: string;
};
type AuthEndpointParams = {
strategy: "auth_endpoint";
payload: string;
encryptionKey: string;
};
// this is the input to 'authenticate'
export type AuthParams =
| EmailVerificationAuthParams
| SocialAuthParams
| JwtAuthParams;
| JwtAuthParams
| AuthEndpointParams;
// TODO typed based off AuthParams["strategy"]
export type AuthResult = {
@@ -66,6 +66,26 @@ export class CoinbaseWallet extends AbstractClientWallet<CoinbaseWalletConnector
}
}
/**
* Wallet config for the Coinbase Wallet.
*
* @param config - The config for the Coinbase Wallet
* @returns The wallet config to be used by the ThirdwebProvider
*
* @example
* ```jsx
* import { ThirdwebProvider, coinbaseWallet } from "@thirdweb-dev/react-native";
*
* <ThirdwebProvider
* supportedWallets={[
* coinbaseWallet({
* callbackURL: new URL('app-redirect-url://'),
* }),
* ]}>
* <YourApp />
* </ThirdwebProvider>
* ```
*/
export const coinbaseWallet = (config?: {
callbackURL?: URL;
recommended?: boolean;
@@ -13,6 +13,8 @@ import {
import { EMAIL_WALLET_ICON } from "../../../assets/svgs";
import { WalletMeta } from "@thirdweb-dev/wallets/dist/declarations/src/evm/wallets/base";
import { AUTH_OPTIONS_ICONS } from "../../types/embedded-wallet";
import { getRandomString } from "../../connectors/embedded-wallet/embedded/helpers/getRandomValues";
import { ANALYTICS } from "../../connectors/embedded-wallet/embedded/helpers/analytics";
export type EmbeddedWalletOptions = WalletOptions<
EmbeddedWalletAdditionalOptions & WalletConnectReceiverConfig
@@ -103,6 +105,7 @@ export class EmbeddedWallet extends AbstractClientWallet<
onDisconnect = () => {
this.removeListeners();
ANALYTICS.nonce = getRandomString(16);
};
onChange = async (payload: any) => {
@@ -3,6 +3,24 @@ import { WalletOptions, walletIds } from "@thirdweb-dev/wallets";
import { createSecureStorage } from "../../../core/SecureStorage";
import { createAsyncLocalStorage } from "../../../core/AsyncStorage";
/**
* Wallet config for a Local Wallet
*
* @param config - The config for the Local Wallet
* @returns The wallet config to be used by the ThirdwebProvider
*
* @example
* ```jsx
* import { ThirdwebProvider, localWallet } from "@thirdweb-dev/react-native";
*
* <ThirdwebProvider
* supportedWallets={[
* localWallet(),
* ]}>
* <YourApp />
* </ThirdwebProvider>
* ```
*/
export const localWallet = () => {
const secureStorage = createSecureStorage(walletIds.localWallet);
const asyncStorage = createAsyncLocalStorage(walletIds.localWallet);
@@ -21,6 +21,22 @@ export class MetaMaskWallet extends WalletConnectBase {
}
}
/**
* Wallet config for MetaMask Wallet.
*
* @param config - The config for MetamaskWallet
* @returns The wallet config to be used by the ThirdwebProvider
*
* @example
* ```jsx
* import { ThirdwebProvider, metamaskWallet } from "@thirdweb-dev/react-native";
*
* <ThirdwebProvider
* supportedWallets={[metamaskWallet()]}>
* <YourApp />
* </ThirdwebProvider>
* ```
*/
export const metamaskWallet = (config?: WalletConnectConfig) => {
return {
id: MetaMaskWallet.id,
@@ -22,6 +22,22 @@ export class RainbowWallet extends WalletConnectBase {
}
}
/**
* Wallet config for Rainbow Wallet.
*
* @param config - The config for RainbowWallet
* @returns The wallet config to be used by the ThirdwebProvider
*
* @example
* ```jsx
* import { ThirdwebProvider, rainbowWallet } from "@thirdweb-dev/react-native";
*
* <ThirdwebProvider
* supportedWallets={[rainbowWallet()]}>
* <YourApp />
* </ThirdwebProvider>
* ```
*/
export const rainbowWallet = (config?: WalletConnectConfig) => {
return {
id: RainbowWallet.id,
@@ -3,6 +3,28 @@ import { SmartWallet, createAsyncLocalStorage } from "@thirdweb-dev/wallets";
import { SmartWalletConfig } from "../types/smart-wallet";
import { SmartWalletFlow } from "../../components/ConnectWalletFlow/SmartWallet/SmartWalletFlow";
/**
* Wallet config for Smart Wallet.
*
* @param wallet - The EOA wallet config to be connected to the SmartWallet
* @param config - The config for SmartWallet
* @returns The wallet config to be used by the ThirdwebProvider
*
* @example
* ```jsx
* import { ThirdwebProvider, smartWallet, metamaskWallet } from "@thirdweb-dev/react-native";
*
* <ThirdwebProvider
* supportedWallets={[
* smartWallet(metamaskWallet(), {
* factoryAddress: 'factory-address',
* gasless: true,
* }),
* ]}>
* <YourApp />
* </ThirdwebProvider>
* ```
*/
export const smartWallet = (
wallet: WalletConfig<any>,
config: SmartWalletConfig,
@@ -20,6 +20,22 @@ export class TrustWallet extends WalletConnectBase {
}
}
/**
* Wallet config for Trust Wallet.
*
* @param config - The config for TrustWallet
* @returns The wallet config to be used by the ThirdwebProvider
*
* @example
* ```jsx
* import { ThirdwebProvider, trustWallet } from "@thirdweb-dev/react-native";
*
* <ThirdwebProvider
* supportedWallets={[trustWallet()]}>
* <YourApp />
* </ThirdwebProvider>
* ```
*/
export const trustWallet = (config?: WalletConnectConfig) => {
return {
id: TrustWallet.id,
@@ -41,8 +41,9 @@ const MODAL_HEIGHT = Dimensions.get("window").height * 0.5;
export function WalletConnectUI({
connected,
walletConfig,
goBack,
projectId,
goBack,
supportedWallets,
}: ConnectUIProps<WalletConnect> & { projectId: string }) {
const l = useLocale();
const theme = useGlobalTheme();
@@ -163,7 +164,7 @@ export function WalletConnectUI({
style={[styles.modal, { backgroundColor: theme.colors.background }]}
>
<ModalHeaderTextClose
onBackPress={goBack}
onBackPress={supportedWallets.length === 1 ? undefined : goBack}
headerText="WalletConnect"
onClose={onClosePress}
paddingHorizontal="md"
@@ -9,6 +9,22 @@ export type WalletConnectConfig = {
recommended?: boolean;
};
/**
* Wallet config for WalletConnect.
*
* @param config - The config for WalletConnect
* @returns The wallet config to be used by the ThirdwebProvider
*
* @example
* ```jsx
* import { ThirdwebProvider, walletConnect } from "@thirdweb-dev/react-native";
*
* <ThirdwebProvider
* supportedWallets={[walletConnect()]}>
* <YourApp />
* </ThirdwebProvider>
* ```
*/
export const walletConnect = (
config?: WalletConnectConfig,
): WalletConfig<WalletConnect> => {
+94
View File
@@ -1,5 +1,99 @@
# @thirdweb-dev/react
## 4.1.16
### Patch Changes
- Updated dependencies [[`c701c388`](https://github.com/thirdweb-dev/js/commit/c701c388c65a1e531b88991d8fd67d25f153992e), [`699f31c2`](https://github.com/thirdweb-dev/js/commit/699f31c20a76cd284dbed1629c4a19d93aca7b7f)]:
- @thirdweb-dev/sdk@4.0.22
- @thirdweb-dev/react-core@4.1.16
- @thirdweb-dev/wallets@2.3.1
## 4.1.15
### Patch Changes
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
- @thirdweb-dev/wallets@2.3.0
- @thirdweb-dev/react-core@4.1.15
## 4.1.14
### Patch Changes
- Updated dependencies [[`bcfa9463`](https://github.com/thirdweb-dev/js/commit/bcfa9463bbae6bf1d3b6389b7a141f65ef3e1173)]:
- @thirdweb-dev/sdk@4.0.21
- @thirdweb-dev/react-core@4.1.14
- @thirdweb-dev/wallets@2.2.1
## 4.1.13
### Patch Changes
- [#2029](https://github.com/thirdweb-dev/js/pull/2029) [`b50e4a41`](https://github.com/thirdweb-dev/js/commit/b50e4a41b560eb647fec1224d6b6782be7132034) Thanks [@MananTank](https://github.com/MananTank)! - Connect to MetaMask on mobile device using WalletConnect instead of opening the web app in MetaMask browser by default
This behavior can be changed by setting `connectionMethod` option to `metamaskWallet`
```tsx
<ThirdwebProvider
supportedWallets={[
metamaskWallet({
connectionMethod: "walletConnect", // default
}),
]}
>
<App />
</ThirdwebProvider>
```
this is same as not setting `connectionMethod` option:
```tsx
<ThirdwebProvider supportedWallets={[metamaskWallet()]}>
<App />
</ThirdwebProvider>
```
If you want to revert to old behavior of opening the web app in Metamask browser, set `connectionMethod` to `metamaskBrowser`
```tsx
<ThirdwebProvider
supportedWallets={[
metamaskWallet({
connectionMethod: "metamaskBrowser",
}),
]}
>
<App />
</ThirdwebProvider>
```
- [#2063](https://github.com/thirdweb-dev/js/pull/2063) [`c8ba5cf8`](https://github.com/thirdweb-dev/js/commit/c8ba5cf863b7b2a92e0cb2c50776511782d4e2b6) Thanks [@MananTank](https://github.com/MananTank)! - - Add option to only show the Official WalletConnect Modal for `walletConnect` in ConnectWallet Modal
```ts
walletConnect({
qrModal: "walletConnect", // hide the ConnectWallet Modal and only show the WalletConnect Modal
});
```
If no, `qrModal` is set, it defaults to `"custom"` as shown below:
```ts
walletConnect({
qrModal: "custom", // render QR code in ConnectWallet Modal
});
```
- Stop Focus trapping the ConnectWallet Modal when it is rendered but hidden
- [#2058](https://github.com/thirdweb-dev/js/pull/2058) [`15ae5e7f`](https://github.com/thirdweb-dev/js/commit/15ae5e7f95a482a9736923c0e10916a0a6115c3d) Thanks [@MananTank](https://github.com/MananTank)! - Add option to open the official wallet connect modal in ConnectWallet
- Updated dependencies [[`d2001ca4`](https://github.com/thirdweb-dev/js/commit/d2001ca464aa699ac821c97eb37de7409ba865f3), [`85842c15`](https://github.com/thirdweb-dev/js/commit/85842c1596c901e228be1894b6702a8871d9e794), [`e595d4d9`](https://github.com/thirdweb-dev/js/commit/e595d4d92f03e36cbe61e1f00a366e37ede5d814), [`497677f3`](https://github.com/thirdweb-dev/js/commit/497677f3596977fa90ebc0fa76cb5842d46d8dcf), [`94966069`](https://github.com/thirdweb-dev/js/commit/9496606964d65268f8ee6bf9f78b2786e99d33ac), [`15ae5e7f`](https://github.com/thirdweb-dev/js/commit/15ae5e7f95a482a9736923c0e10916a0a6115c3d)]:
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
## 4.1.12
### Patch Changes
+5 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
"version": "4.1.12",
"version": "4.1.16",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -104,16 +104,17 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"stream": "npm:stream-browserify@^3.0.0",
"typescript": "^5.1.6",
"typedoc-gen": "workspace:*"
"typedoc-gen": "workspace:*",
"typescript": "^5.1.6"
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@google/model-viewer": "^2.1.1",
"@radix-ui/colors": "^0.1.9",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.5",
"@radix-ui/react-focus-scope": "^1.0.4",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-popover": "^1.0.6",
"@radix-ui/react-tabs": "^1.0.4",
+44 -41
View File
@@ -16,6 +16,7 @@ import { DynamicHeight } from "./DynamicHeight";
import { useEffect, useRef, useState } from "react";
import { useCustomTheme } from "../design-system/CustomThemeProvider";
import { StyledDiv } from "../design-system/elements";
import { FocusScope } from "@radix-ui/react-focus-scope";
export const Modal: React.FC<{
trigger?: React.ReactNode;
@@ -74,48 +75,50 @@ export const Modal: React.FC<{
</Dialog.Overlay>
)}
<Dialog.Content asChild>
<DialogContent
ref={contentRef}
style={
props.hide
? { width: 0, height: 0, overflow: "hidden", opacity: 0 }
: {
height:
props.size === "compact" ? "auto" : wideModalMaxHeight,
maxWidth:
props.size === "compact"
? modalMaxWidthCompact
: modalMaxWidthWide,
}
}
>
{props.size === "compact" ? (
<DynamicHeight maxHeight={compactModalMaxHeight}>
{props.children}{" "}
</DynamicHeight>
) : (
props.children
)}
<FocusScope trapped={!props.hide}>
<Dialog.Content asChild>
<DialogContent
ref={contentRef}
style={
props.hide
? { width: 0, height: 0, overflow: "hidden", opacity: 0 }
: {
height:
props.size === "compact" ? "auto" : wideModalMaxHeight,
maxWidth:
props.size === "compact"
? modalMaxWidthCompact
: modalMaxWidthWide,
}
}
>
{props.size === "compact" ? (
<DynamicHeight maxHeight={compactModalMaxHeight}>
{props.children}{" "}
</DynamicHeight>
) : (
props.children
)}
{/* Close Icon */}
{!props.hideCloseIcon && (
<CrossContainer>
<Dialog.Close asChild>
<IconButton type="button" aria-label="Close">
<Cross2Icon
width={iconSize.md}
height={iconSize.md}
style={{
color: "inherit",
}}
/>
</IconButton>
</Dialog.Close>
</CrossContainer>
)}
</DialogContent>
</Dialog.Content>
{/* Close Icon */}
{!props.hideCloseIcon && (
<CrossContainer>
<Dialog.Close asChild>
<IconButton type="button" aria-label="Close">
<Cross2Icon
width={iconSize.md}
height={iconSize.md}
style={{
color: "inherit",
}}
/>
</IconButton>
</Dialog.Close>
</CrossContainer>
)}
</DialogContent>
</Dialog.Content>
</FocusScope>
</Dialog.Portal>
</Dialog.Root>
);
@@ -71,7 +71,9 @@ export const ConnectModalContent = (props: {
? false
: !!authConfig?.authUrl && !user?.address;
setHideModal(false);
onModalUnmount(() => {
setHideModal(false);
});
// show sign in screen if required
if (requiresSignIn) {
@@ -242,7 +244,9 @@ export const ConnectModal = () => {
useEffect(() => {
if (!isWalletModalOpen) {
setHideModal(false);
onModalUnmount(() => {
setHideModal(false);
});
}
}, [isWalletModalOpen, setIsWalletModalOpen, screen]);
@@ -268,6 +272,10 @@ export const ConnectModal = () => {
size={modalSize}
open={isWalletModalOpen}
setOpen={(value) => {
if (hideModal) {
return;
}
setIsWalletModalOpen(value);
if (!value) {
const requiresSignIn = auth?.loginOptional
@@ -29,10 +29,11 @@ export const HeadlessConnectUI = ({
} catch (e) {
if (!singleWallet) {
goBack();
show();
}
console.error(e);
}
show();
})();
}, [walletConfig, connect, singleWallet, connected, hide, show, goBack]);
@@ -7,16 +7,30 @@ import { GetStartedScreen } from "../../ConnectWallet/screens/GetStartedScreen";
import { MetaMaskWallet } from "@thirdweb-dev/wallets";
import { wait } from "../../../utils/wait";
import { useTWLocale } from "../../../evm/providers/locale-provider";
import { metamaskUris } from "./metamaskUris";
import { WCOpenURI } from "../../ConnectWallet/screens/WCOpenUri";
export const MetamaskConnectUI = (props: ConnectUIProps<MetaMaskWallet>) => {
export const MetamaskConnectUI = (
props: ConnectUIProps<MetaMaskWallet> & {
connectionMethod: "walletConnect" | "metamaskBrowser";
},
) => {
const [screen, setScreen] = useState<
"connecting" | "scanning" | "get-started"
"connecting" | "scanning" | "get-started" | "open-wc-uri"
>("connecting");
const locale = useTWLocale().wallets.metamaskWallet;
const { walletConfig, connected } = props;
const connect = useConnect();
const [errorConnecting, setErrorConnecting] = useState(false);
const connectingLocale = {
getStartedLink: locale.getStartedLink,
instruction: locale.connectionScreen.instruction,
tryAgain: locale.connectionScreen.retry,
inProgress: locale.connectionScreen.inProgress,
failed: locale.connectionScreen.failed,
};
const hideBackButton = props.supportedWallets.length === 1;
const connectToExtension = useCallback(async () => {
@@ -53,27 +67,25 @@ export const MetamaskConnectUI = (props: ConnectUIProps<MetaMaskWallet>) => {
else {
// on mobile, open metamask app link
if (isMobile()) {
window.open(
`https://metamask.app.link/dapp/${window.location.toString()}`,
);
if (props.connectionMethod === "walletConnect") {
setScreen("open-wc-uri");
} else {
window.open(
`https://metamask.app.link/dapp/${window.location.toString()}`,
);
}
} else {
// on desktop, show the metamask scan qr code
setScreen("scanning");
}
}
})();
}, [connectToExtension, walletConfig]);
}, [connectToExtension, props.connectionMethod, walletConfig]);
if (screen === "connecting") {
return (
<ConnectingScreen
locale={{
getStartedLink: locale.getStartedLink,
instruction: locale.connectionScreen.instruction,
tryAgain: locale.connectionScreen.retry,
inProgress: locale.connectionScreen.inProgress,
failed: locale.connectionScreen.failed,
}}
locale={connectingLocale}
errorConnecting={errorConnecting}
onGetStarted={() => {
setScreen("get-started");
@@ -103,6 +115,26 @@ export const MetamaskConnectUI = (props: ConnectUIProps<MetaMaskWallet>) => {
);
}
if (screen === "open-wc-uri") {
return (
<WCOpenURI
locale={connectingLocale}
onRetry={() => {
// NOOP - TODO make onRetry optional
}}
errorConnecting={errorConnecting}
onGetStarted={() => {
setScreen("get-started");
}}
hideBackButton={hideBackButton}
onBack={props.goBack}
onConnected={connected}
walletConfig={walletConfig}
appUriPrefix={metamaskUris}
/>
);
}
if (screen === "scanning") {
return (
<MetamaskScan

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