Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
736b45ac8e | ||
|
|
b5e1d3bb2b | ||
|
|
6816219ac1 | ||
|
|
48065bcd91 | ||
|
|
a388d07a3d | ||
|
|
483e2b9109 | ||
|
|
f7f4f20737 | ||
|
|
6aa6f7e0bd | ||
|
|
d4d9550713 | ||
|
|
3cb298ac4b | ||
|
|
c747670b98 | ||
|
|
c08e6ba988 | ||
|
|
60fb188943 | ||
|
|
1ce8558df4 | ||
|
|
3ce5f9a0c3 | ||
|
|
3d615a62d0 | ||
|
|
6ce366f59e | ||
|
|
8a2d92046a | ||
|
|
45ae105ed3 | ||
|
|
23d61cfeff | ||
|
|
990c665de9 | ||
|
|
08eaefcf0b | ||
|
|
3d62278aba | ||
|
|
3ab7d1e975 | ||
|
|
c6f44722f9 | ||
|
|
e0ce4a3759 | ||
|
|
04416e7c93 | ||
|
|
5166b24a48 | ||
|
|
bb7ca20e49 | ||
|
|
f41f1a2958 | ||
|
|
d9b7360d1d | ||
|
|
8941b22682 |
@@ -59,9 +59,15 @@ To begin:
|
|||||||
```
|
```
|
||||||
pnpm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
If you are on windows, use the `--ignore-scripts` flag
|
||||||
|
```
|
||||||
|
pnpm install --ignore-scripts
|
||||||
|
```
|
||||||
|
|
||||||
Now you have got the repo on your local machine, and you're ready to start making your changes!
|
Now you have got the repo on your local machine, and you're ready to start making your changes!
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
### Test Your Changes
|
### Test Your Changes
|
||||||
|
|
||||||
We use [yalc](https://github.com/wclr/yalc) to test changes locally.
|
We use [yalc](https://github.com/wclr/yalc) to test changes locally.
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
# @thirdweb-dev/auth
|
# @thirdweb-dev/auth
|
||||||
|
|
||||||
|
## 3.2.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`3cb298ac`](https://github.com/thirdweb-dev/js/commit/3cb298ac4b04d295899b5ac77c7fc5869ec2f5f2), [`3ce5f9a0`](https://github.com/thirdweb-dev/js/commit/3ce5f9a0c3fc7e99b5abf691a87048ab8475f6b1), [`a388d07a`](https://github.com/thirdweb-dev/js/commit/a388d07a3d449e56dc53fed9600931022f4a15e1), [`1ce8558d`](https://github.com/thirdweb-dev/js/commit/1ce8558df47186bcba5ee8564fdb04583bf115dd), [`60fb1889`](https://github.com/thirdweb-dev/js/commit/60fb18894372f14d9cd815fa9a239926d31bb273)]:
|
||||||
|
- @thirdweb-dev/wallets@0.3.2
|
||||||
|
|
||||||
|
## 3.2.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`3d62278a`](https://github.com/thirdweb-dev/js/commit/3d62278aba79101ae1158fb726d6ddfed505c939)]:
|
||||||
|
- @thirdweb-dev/wallets@0.3.1
|
||||||
|
|
||||||
## 3.2.0
|
## 3.2.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/auth",
|
"name": "@thirdweb-dev/auth",
|
||||||
"version": "3.2.0",
|
"version": "3.2.2",
|
||||||
"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,17 @@
|
|||||||
# @thirdweb-dev/chains
|
# @thirdweb-dev/chains
|
||||||
|
|
||||||
|
## 0.1.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1229](https://github.com/thirdweb-dev/js/pull/1229) [`6816219a`](https://github.com/thirdweb-dev/js/commit/6816219ac13ae571a0c90db6ab389c319bc1f052) Thanks [@jnsdls](https://github.com/jnsdls)! - add/update chains
|
||||||
|
|
||||||
|
## 0.1.22
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1192](https://github.com/thirdweb-dev/js/pull/1192) [`f41f1a29`](https://github.com/thirdweb-dev/js/commit/f41f1a2958a2cedcf0496c9a3ca284d0b98f1b89) Thanks [@jnsdls](https://github.com/jnsdls)! - fix arbitrum goerli infura url
|
||||||
|
|
||||||
## 0.1.21
|
## 0.1.21
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "BRC Chain Mainnet",
|
||||||
|
"chain": "BRC",
|
||||||
|
"rpc": [
|
||||||
|
"https://brc-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://rpc.brcchain.io"
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://faucet.brcchain.io"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "BRC Chain mainnet native token",
|
||||||
|
"symbol": "BRC",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"infoURL": "https://bridge.brcchain.io",
|
||||||
|
"shortName": "BRC",
|
||||||
|
"chainId": 12123,
|
||||||
|
"networkId": 12123,
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmX8qGX7xoZqYUpHxA85uZwQX2fgbTHvmddE1NfseDyBED",
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "BRC Chain Explorer",
|
||||||
|
"url": "https://scan.brcchain.io",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"testnet": false,
|
||||||
|
"slug": "brc-chain"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -4,7 +4,7 @@ export default {
|
|||||||
"chain": "ATH",
|
"chain": "ATH",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://atheios.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://atheios.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://wallet.atheios.com:8797"
|
"https://rpc.atheios.org/"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
@@ -12,7 +12,7 @@ export default {
|
|||||||
"symbol": "ATH",
|
"symbol": "ATH",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://atheios.com",
|
"infoURL": "https://atheios.org",
|
||||||
"shortName": "ath",
|
"shortName": "ath",
|
||||||
"chainId": 1620,
|
"chainId": 1620,
|
||||||
"networkId": 11235813,
|
"networkId": 11235813,
|
||||||
|
|||||||
@@ -11,7 +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-testnet.horizenlabs.io/ethv1",
|
||||||
|
"https://rpc.ankr.com/horizen_testnet_evm"
|
||||||
],
|
],
|
||||||
"features": [
|
"features": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ export default {
|
|||||||
"networkId": 1,
|
"networkId": 1,
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://QmT7PSXBiVBma6E15hNkivmstqLu3JSnG1jXN5pTmcCGRC",
|
"url": "ipfs://QmT7PSXBiVBma6E15hNkivmstqLu3JSnG1jXN5pTmcCGRC",
|
||||||
"width": 200,
|
"width": 180,
|
||||||
"height": 200,
|
"height": 180,
|
||||||
"format": "png"
|
"format": "png"
|
||||||
},
|
},
|
||||||
"explorers": [
|
"explorers": [
|
||||||
|
|||||||
@@ -2,12 +2,6 @@ import type { Chain } from "../src/types";
|
|||||||
export default {
|
export default {
|
||||||
"name": "Metaplayerone Dubai Testnet",
|
"name": "Metaplayerone Dubai Testnet",
|
||||||
"chain": "MP1 Dubai-Testnet",
|
"chain": "MP1 Dubai-Testnet",
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://QmfJKxmubJrqYWDcR2PnPvmpukxPz4fYDu3hqTaSnpJDxC",
|
|
||||||
"width": 42,
|
|
||||||
"height": 23,
|
|
||||||
"format": "svg"
|
|
||||||
},
|
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://metaplayerone-dubai-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://metaplayerone-dubai-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://rpc-dubai.mp1network.com/"
|
"https://rpc-dubai.mp1network.com/"
|
||||||
@@ -26,12 +20,6 @@ export default {
|
|||||||
{
|
{
|
||||||
"name": "MP1Scan",
|
"name": "MP1Scan",
|
||||||
"url": "https://dubai.mp1scan.io",
|
"url": "https://dubai.mp1scan.io",
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://QmfJKxmubJrqYWDcR2PnPvmpukxPz4fYDu3hqTaSnpJDxC",
|
|
||||||
"width": 42,
|
|
||||||
"height": 23,
|
|
||||||
"format": "svg"
|
|
||||||
},
|
|
||||||
"standard": "EIP3091"
|
"standard": "EIP3091"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ export default {
|
|||||||
"networkId": 1,
|
"networkId": 1,
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://QmT7PSXBiVBma6E15hNkivmstqLu3JSnG1jXN5pTmcCGRC",
|
"url": "ipfs://QmT7PSXBiVBma6E15hNkivmstqLu3JSnG1jXN5pTmcCGRC",
|
||||||
"width": 200,
|
"width": 180,
|
||||||
"height": 200,
|
"height": 180,
|
||||||
"format": "png"
|
"format": "png"
|
||||||
},
|
},
|
||||||
"explorers": [
|
"explorers": [
|
||||||
|
|||||||
@@ -24,22 +24,10 @@ export default {
|
|||||||
"shortName": "ncnt",
|
"shortName": "ncnt",
|
||||||
"chainId": 303,
|
"chainId": 303,
|
||||||
"networkId": 303,
|
"networkId": 303,
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://Qmc9zDWXar67cMUodp28mbN5pnwbVibxGXhwa8YCDvxmTR",
|
|
||||||
"width": 62,
|
|
||||||
"height": 59,
|
|
||||||
"format": "svg"
|
|
||||||
},
|
|
||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "neuroscan",
|
"name": "neuroscan",
|
||||||
"url": "https://testnet.ncnscan.com",
|
"url": "https://testnet.ncnscan.com",
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://Qmc9zDWXar67cMUodp28mbN5pnwbVibxGXhwa8YCDvxmTR",
|
|
||||||
"width": 62,
|
|
||||||
"height": 59,
|
|
||||||
"format": "svg"
|
|
||||||
},
|
|
||||||
"standard": "EIP3091"
|
"standard": "EIP3091"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -25,22 +25,10 @@ export default {
|
|||||||
"shortName": "ncn",
|
"shortName": "ncn",
|
||||||
"chainId": 313,
|
"chainId": 313,
|
||||||
"networkId": 313,
|
"networkId": 313,
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://Qmc9zDWXar67cMUodp28mbN5pnwbVibxGXhwa8YCDvxmTR",
|
|
||||||
"width": 62,
|
|
||||||
"height": 59,
|
|
||||||
"format": "svg"
|
|
||||||
},
|
|
||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "neuroscan",
|
"name": "neuroscan",
|
||||||
"url": "https://ncnscan.com",
|
"url": "https://ncnscan.com",
|
||||||
"icon": {
|
|
||||||
"url": "ipfs://Qmc9zDWXar67cMUodp28mbN5pnwbVibxGXhwa8YCDvxmTR",
|
|
||||||
"width": 62,
|
|
||||||
"height": 59,
|
|
||||||
"format": "svg"
|
|
||||||
},
|
|
||||||
"standard": "EIP3091"
|
"standard": "EIP3091"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "Omega Mainnet",
|
||||||
|
"chain": "OmegaNetwork",
|
||||||
|
"shortName": "OmegaNetwork",
|
||||||
|
"chainId": 408,
|
||||||
|
"testnet": false,
|
||||||
|
"icon": {
|
||||||
|
"format": "png",
|
||||||
|
"url": "ipfs://bafkreig676zxfhwhcx5bvvvjxedx6ftr2wq4iiznrwm3c6ozrprbc4oxwm",
|
||||||
|
"height": 512,
|
||||||
|
"width": 512
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://omega.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://mainnet-rpc.omtch.com"
|
||||||
|
],
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Omega Network Coin",
|
||||||
|
"symbol": "OMN",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"slug": "omega"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -14,7 +14,7 @@ export default {
|
|||||||
"rpc": [
|
"rpc": [
|
||||||
"https://arbitrum-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://arbitrum-goerli.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
"https://abritrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
"https://arbitrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
"https://goerli-rollup.arbitrum.io/rpc/"
|
"https://goerli-rollup.arbitrum.io/rpc/"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import type { Chain } from "../src/types";
|
||||||
|
export default {
|
||||||
|
"name": "opBNB",
|
||||||
|
"chain": "opBNB",
|
||||||
|
"shortName": "opBNB",
|
||||||
|
"chainId": 5611,
|
||||||
|
"testnet": true,
|
||||||
|
"nativeCurrency": {
|
||||||
|
"name": "Testnet bnb",
|
||||||
|
"symbol": "Tbnb",
|
||||||
|
"decimals": 18
|
||||||
|
},
|
||||||
|
"rpc": [
|
||||||
|
"https://opbnb.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
|
"https://opbnb-testnet-rpc.bnbchain.org"
|
||||||
|
],
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "opBNB Scan",
|
||||||
|
"url": "https://opbnbscan.com/",
|
||||||
|
"standard": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"faucets": [
|
||||||
|
"https://opbnb-testnet-bridge.bnbchain.org/"
|
||||||
|
],
|
||||||
|
"infoURL": "https://docs.bnbchain.org/",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmfFvfFsQKby3M32uqr8T55ENBnTHL8bkdeeu6rYVL2n4z/opbnblogo.svg",
|
||||||
|
"height": 512,
|
||||||
|
"width": 512,
|
||||||
|
"format": "svg"
|
||||||
|
},
|
||||||
|
"slug": "opbnb"
|
||||||
|
} as const satisfies Chain;
|
||||||
@@ -4,7 +4,7 @@ export default {
|
|||||||
"chain": "ETH",
|
"chain": "ETH",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://zora.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://zora.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://rpc.zora.co/"
|
"https://rpc.zora.energy/"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
@@ -12,23 +12,23 @@ export default {
|
|||||||
"symbol": "ETH",
|
"symbol": "ETH",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://zora.co",
|
|
||||||
"shortName": "zora",
|
|
||||||
"chainId": 7777777,
|
|
||||||
"networkId": 7777777,
|
|
||||||
"explorers": [
|
|
||||||
{
|
|
||||||
"name": "Zora Network Explorer",
|
|
||||||
"url": "https://explorer.zora.co",
|
|
||||||
"standard": "EIP3091"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://QmZ6qaRwTPFEZUspwMUjaxC6KhmzcELdRQcQzS3P72Dzts/Vector.svg",
|
"url": "ipfs://QmZ6qaRwTPFEZUspwMUjaxC6KhmzcELdRQcQzS3P72Dzts/Vector.svg",
|
||||||
"height": 512,
|
"height": 512,
|
||||||
"width": 512,
|
"width": 512,
|
||||||
"format": "svg"
|
"format": "svg"
|
||||||
},
|
},
|
||||||
|
"infoURL": "https://zora.energy",
|
||||||
|
"shortName": "zora",
|
||||||
|
"chainId": 7777777,
|
||||||
|
"networkId": 7777777,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "Zora Network Explorer",
|
||||||
|
"url": "https://explorer.zora.energy",
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
"testnet": false,
|
"testnet": false,
|
||||||
"slug": "zora"
|
"slug": "zora"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -2,6 +2,12 @@ import type { Chain } from "../src/types";
|
|||||||
export default {
|
export default {
|
||||||
"name": "Patex",
|
"name": "Patex",
|
||||||
"chain": "ETH",
|
"chain": "ETH",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmTNTSNn3t5WpSEzQmUYbkxYkBKaH6QahyVdVrRKyPHChr",
|
||||||
|
"width": 800,
|
||||||
|
"height": 800,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://patex.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://patex.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://rpc.patex.io/"
|
"https://rpc.patex.io/"
|
||||||
@@ -12,10 +18,31 @@ export default {
|
|||||||
"symbol": "ETH",
|
"symbol": "ETH",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
|
"features": [
|
||||||
|
{
|
||||||
|
"name": "EIP155"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "EIP1559"
|
||||||
|
}
|
||||||
|
],
|
||||||
"infoURL": "https://patex.io/",
|
"infoURL": "https://patex.io/",
|
||||||
"shortName": "peth",
|
"shortName": "peth",
|
||||||
"chainId": 789,
|
"chainId": 789,
|
||||||
"networkId": 789,
|
"networkId": 789,
|
||||||
|
"explorers": [
|
||||||
|
{
|
||||||
|
"name": "patexscan",
|
||||||
|
"url": "https://patexscan.io",
|
||||||
|
"icon": {
|
||||||
|
"url": "ipfs://QmTNTSNn3t5WpSEzQmUYbkxYkBKaH6QahyVdVrRKyPHChr",
|
||||||
|
"width": 800,
|
||||||
|
"height": 800,
|
||||||
|
"format": "png"
|
||||||
|
},
|
||||||
|
"standard": "EIP3091"
|
||||||
|
}
|
||||||
|
],
|
||||||
"testnet": false,
|
"testnet": false,
|
||||||
"slug": "patex"
|
"slug": "patex"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -1,39 +1,35 @@
|
|||||||
import type { Chain } from "../src/types";
|
import type { Chain } from "../src/types";
|
||||||
export default {
|
export default {
|
||||||
"name": "Shardeum Liberty 2.X",
|
"name": "Shardeum Sphinx DApp 1.X",
|
||||||
|
"shortName": "Sphinx",
|
||||||
"chain": "Shardeum",
|
"chain": "Shardeum",
|
||||||
|
"chainId": 8081,
|
||||||
"icon": {
|
"icon": {
|
||||||
"url": "ipfs://Qma1bfuubpepKn7DLDy4NPSKDeT3S4VPCNhu6UmdGrb6YD",
|
"height": 1200,
|
||||||
"width": 609,
|
"width": 1200,
|
||||||
"height": 533,
|
"url": "ipfs://QmQWzHUy4kmk1eGksDREGQL3GWrssdAPBxHt4aKGAFHSfJ",
|
||||||
"format": "png"
|
"format": "png"
|
||||||
},
|
},
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://shardeum-liberty-2-x.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://shardeum-sphinx-dapp-1-x.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://liberty20.shardeum.org/"
|
"https://dapps.shardeum.org/sphinx"
|
||||||
],
|
|
||||||
"faucets": [
|
|
||||||
"https://faucet.liberty20.shardeum.org"
|
|
||||||
],
|
],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"name": "Shardeum SHM",
|
"name": "Shardeum",
|
||||||
"symbol": "SHM",
|
"symbol": "SHM",
|
||||||
"decimals": 18
|
"decimals": 18
|
||||||
},
|
},
|
||||||
"infoURL": "https://docs.shardeum.org/",
|
|
||||||
"shortName": "Liberty20",
|
|
||||||
"chainId": 8081,
|
|
||||||
"networkId": 8081,
|
|
||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "Shardeum Scan",
|
"name": "Shardeum Scan",
|
||||||
"url": "https://explorer-liberty20.shardeum.org",
|
"url": "https://explorer-dapps.shardeum.org",
|
||||||
"standard": "EIP3091"
|
"standard": "EIP3091"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"redFlags": [
|
"faucets": [
|
||||||
"reusedChainId"
|
"https://faucet-dapps.shardeum.org/"
|
||||||
],
|
],
|
||||||
"testnet": false,
|
"infoURL": "https://docs.shardeum.org/",
|
||||||
"slug": "shardeum-liberty-2-x"
|
"testnet": true,
|
||||||
|
"slug": "shardeum-sphinx-dapp-1-x"
|
||||||
} as const satisfies Chain;
|
} as const satisfies Chain;
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// @ts-check
|
||||||
|
/** @typedef { import("../../src/types").Chain } Chain */
|
||||||
|
|
||||||
|
/** @type {Omit<Chain, "slug">} */
|
||||||
|
export default {
|
||||||
|
name: "Omega Mainnet",
|
||||||
|
chain: "OmegaNetwork",
|
||||||
|
shortName: "OmegaNetwork",
|
||||||
|
chainId: 408,
|
||||||
|
testnet: false,
|
||||||
|
icon: {
|
||||||
|
format: "png",
|
||||||
|
url: "ipfs://bafkreig676zxfhwhcx5bvvvjxedx6ftr2wq4iiznrwm3c6ozrprbc4oxwm",
|
||||||
|
height: 512,
|
||||||
|
width: 512,
|
||||||
|
},
|
||||||
|
rpc: ["https://mainnet-rpc.omtch.com"],
|
||||||
|
nativeCurrency: {
|
||||||
|
name: "Omega Network Coin",
|
||||||
|
symbol: "OMN",
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
// @ts-check
|
||||||
|
/** @typedef { import("../../src/types").Chain } Chain */
|
||||||
|
|
||||||
|
/** @type {Omit<Chain, "slug">} */
|
||||||
|
export default {
|
||||||
|
name: "opBNB",
|
||||||
|
chain: "opBNB",
|
||||||
|
shortName: "opBNB",
|
||||||
|
chainId: 5611,
|
||||||
|
testnet: true,
|
||||||
|
nativeCurrency: {
|
||||||
|
name: "Testnet bnb",
|
||||||
|
symbol: "Tbnb",
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
rpc: ["https://opbnb-testnet-rpc.bnbchain.org"],
|
||||||
|
explorers: [
|
||||||
|
{
|
||||||
|
name: "opBNB Scan",
|
||||||
|
url: "https://opbnbscan.com/",
|
||||||
|
standard: "",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
faucets: ["https://opbnb-testnet-bridge.bnbchain.org/"],
|
||||||
|
infoURL: "https://docs.bnbchain.org/",
|
||||||
|
icon: {
|
||||||
|
url: "ipfs://QmfFvfFsQKby3M32uqr8T55ENBnTHL8bkdeeu6rYVL2n4z/opbnblogo.svg",
|
||||||
|
height: 512,
|
||||||
|
width: 512,
|
||||||
|
format: "svg",
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
// @ts-check
|
||||||
|
/** @typedef { import("../../src/types").Chain } Chain */
|
||||||
|
|
||||||
|
/** @type {Omit<Chain, "slug">} */
|
||||||
|
export default {
|
||||||
|
name: "Shardeum Sphinx DApp 1.X",
|
||||||
|
shortName: "Sphinx",
|
||||||
|
chain: "Shardeum",
|
||||||
|
chainId: 8081,
|
||||||
|
icon: {
|
||||||
|
height: 1200,
|
||||||
|
width: 1200,
|
||||||
|
url: "ipfs://QmQWzHUy4kmk1eGksDREGQL3GWrssdAPBxHt4aKGAFHSfJ",
|
||||||
|
format: "png",
|
||||||
|
},
|
||||||
|
rpc: ["https://dapps.shardeum.org/sphinx"],
|
||||||
|
nativeCurrency: {
|
||||||
|
name: "Shardeum",
|
||||||
|
symbol: "SHM",
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
explorers: [
|
||||||
|
{
|
||||||
|
name: "Shardeum Scan",
|
||||||
|
url: "https://explorer-dapps.shardeum.org",
|
||||||
|
standard: "EIP3091",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
faucets: ["https://faucet-dapps.shardeum.org/"],
|
||||||
|
infoURL: "https://docs.shardeum.org/",
|
||||||
|
testnet: true,
|
||||||
|
};
|
||||||
@@ -10,7 +10,7 @@ export default {
|
|||||||
format: "png",
|
format: "png",
|
||||||
},
|
},
|
||||||
rpc: [
|
rpc: [
|
||||||
"https://abritrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
"https://arbitrum-goerli.infura.io/v3/${INFURA_API_KEY}",
|
||||||
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
"https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/chains",
|
"name": "@thirdweb-dev/chains",
|
||||||
"version": "0.1.21",
|
"version": "0.1.23",
|
||||||
"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": {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,21 @@
|
|||||||
# thirdweb
|
# thirdweb
|
||||||
|
|
||||||
|
## 0.10.25
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`6816219a`](https://github.com/thirdweb-dev/js/commit/6816219ac13ae571a0c90db6ab389c319bc1f052), [`48065bcd`](https://github.com/thirdweb-dev/js/commit/48065bcd91c13e1f44d54343b5c6c2646b9e86e4), [`6aa6f7e0`](https://github.com/thirdweb-dev/js/commit/6aa6f7e0bd2313e2e1ad96dd41aad91e6694d380), [`f7f4f207`](https://github.com/thirdweb-dev/js/commit/f7f4f20737ac5d78424ca9c91220f00b85adde6b), [`d4d95507`](https://github.com/thirdweb-dev/js/commit/d4d95507130b2b5408bfaa73ef3b708ca00c773e), [`483e2b91`](https://github.com/thirdweb-dev/js/commit/483e2b910934d75276a68bae64d04c47cd7d57e3), [`c08e6ba9`](https://github.com/thirdweb-dev/js/commit/c08e6ba988ad97aa27d5868cec8abe3498d07a0a), [`3d615a62`](https://github.com/thirdweb-dev/js/commit/3d615a62d0a6801f6fb0e63f9b95c2f98446add1)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.23
|
||||||
|
- @thirdweb-dev/sdk@3.10.24
|
||||||
|
|
||||||
|
## 0.10.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`d9b7360d`](https://github.com/thirdweb-dev/js/commit/d9b7360d1d78abcdaca89aa35e66388cbc5eb26c), [`8a2d9204`](https://github.com/thirdweb-dev/js/commit/8a2d92046a416c99c6bfecf63a6fdb6cc02ea175), [`990c665d`](https://github.com/thirdweb-dev/js/commit/990c665de9e5c1070dc80fe0f1b434e251f70a94), [`c6f44722`](https://github.com/thirdweb-dev/js/commit/c6f44722f9d123db4e7c4c799fe8e0374a02107c), [`45ae105e`](https://github.com/thirdweb-dev/js/commit/45ae105ed3e48bfbf6be84aa12ecb0fb55a917b7), [`f41f1a29`](https://github.com/thirdweb-dev/js/commit/f41f1a2958a2cedcf0496c9a3ca284d0b98f1b89), [`bb7ca20e`](https://github.com/thirdweb-dev/js/commit/bb7ca20e49c5c374b12a4ed746a2ac3db488abd9), [`23d61cfe`](https://github.com/thirdweb-dev/js/commit/23d61cfeff2e5a885c511416d7491e7933ed404a), [`8941b226`](https://github.com/thirdweb-dev/js/commit/8941b22682d1b15a6e0d311b1e8548b95d6cfadf), [`e0ce4a37`](https://github.com/thirdweb-dev/js/commit/e0ce4a37596a91a072f8551e323fce6723113dcb)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.23
|
||||||
|
- @thirdweb-dev/chains@0.1.22
|
||||||
|
|
||||||
## 0.10.23
|
## 0.10.23
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "thirdweb",
|
"name": "thirdweb",
|
||||||
"main": "dist/cli/index.js",
|
"main": "dist/cli/index.js",
|
||||||
"version": "0.10.23",
|
"version": "0.10.25",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# @thirdweb-dev/contracts-js
|
# @thirdweb-dev/contracts-js
|
||||||
|
|
||||||
|
## 1.3.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1197](https://github.com/thirdweb-dev/js/pull/1197) [`e0ce4a37`](https://github.com/thirdweb-dev/js/commit/e0ce4a37596a91a072f8551e323fce6723113dcb) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Added Zora drop ABI
|
||||||
|
|
||||||
|
- [#1134](https://github.com/thirdweb-dev/js/pull/1134) [`990c665d`](https://github.com/thirdweb-dev/js/commit/990c665de9e5c1070dc80fe0f1b434e251f70a94) Thanks [@nkrishang](https://github.com/nkrishang)! - Introduce SmartWallet sdk class
|
||||||
|
|
||||||
## 1.3.5
|
## 1.3.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/contracts-js",
|
"name": "@thirdweb-dev/contracts-js",
|
||||||
"version": "1.3.5",
|
"version": "1.3.6",
|
||||||
"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.5.5"
|
"@thirdweb-dev/contracts": "3.5.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/preset-env": "^7.18.10",
|
"@babel/preset-env": "^7.18.10",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf dist/",
|
"clean": "rm -rf dist/",
|
||||||
"typechain": "rm -rf ./src && typechain --target ethers-v5 --out-dir src './node_modules/@thirdweb-dev/contracts/abi/*.json'",
|
"typechain": "rm -rf ./src && cp ./external_abis/*.json ./node_modules/@thirdweb-dev/contracts/abi && typechain --target ethers-v5 --out-dir src './node_modules/@thirdweb-dev/contracts/abi/*.json'",
|
||||||
"extract-abi": "node ./scripts/extract-abis.mjs",
|
"extract-abi": "node ./scripts/extract-abis.mjs",
|
||||||
"build": "pnpm typechain && tsc && pnpm preconstruct build && pnpm extract-abi",
|
"build": "pnpm typechain && tsc && pnpm preconstruct build && pnpm extract-abi",
|
||||||
"push": "yalc push"
|
"push": "yalc push"
|
||||||
|
|||||||
@@ -9,15 +9,20 @@ import {
|
|||||||
import { basename, join, resolve } from "path";
|
import { basename, join, resolve } from "path";
|
||||||
|
|
||||||
const main = () => {
|
const main = () => {
|
||||||
const libFolder = resolve(
|
const sourceFolders = [];
|
||||||
|
sourceFolders.push(resolve(
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"@thirdweb-dev/contracts/abi",
|
"@thirdweb-dev/contracts/abi",
|
||||||
);
|
));
|
||||||
|
sourceFolders.push(resolve(
|
||||||
|
"external_abis",
|
||||||
|
));
|
||||||
const destinationFolder = "./dist/abis";
|
const destinationFolder = "./dist/abis";
|
||||||
if (existsSync(destinationFolder)) {
|
if (existsSync(destinationFolder)) {
|
||||||
rmSync(destinationFolder, { recursive: true });
|
rmSync(destinationFolder, { recursive: true });
|
||||||
}
|
}
|
||||||
mkdirSync(destinationFolder);
|
mkdirSync(destinationFolder);
|
||||||
|
for(const libFolder of sourceFolders) {
|
||||||
const abiFiles = readdirSync(libFolder);
|
const abiFiles = readdirSync(libFolder);
|
||||||
for (const abiFile of abiFiles) {
|
for (const abiFile of abiFiles) {
|
||||||
const contractJsonFile = readFileSync(join(libFolder, abiFile), "utf-8");
|
const contractJsonFile = readFileSync(join(libFolder, abiFile), "utf-8");
|
||||||
@@ -28,6 +33,7 @@ const main = () => {
|
|||||||
JSON.stringify(abi, null, 2),
|
JSON.stringify(abi, null, 2),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = {
|
|||||||
// import rules
|
// import rules
|
||||||
"import/first": "error",
|
"import/first": "error",
|
||||||
"import/newline-after-import": "error",
|
"import/newline-after-import": "error",
|
||||||
"import/no-cycle": "warn",
|
"import/no-cycle": "error",
|
||||||
"import/no-useless-path-segments": "error",
|
"import/no-useless-path-segments": "error",
|
||||||
|
|
||||||
//eslint
|
//eslint
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: ["thirdweb"],
|
extends: ["thirdweb"],
|
||||||
|
plugins: ["better-tree-shaking"],
|
||||||
|
rules: {
|
||||||
|
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,35 @@
|
|||||||
# @thirdweb-dev/react-core
|
# @thirdweb-dev/react-core
|
||||||
|
|
||||||
|
## 3.14.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1230](https://github.com/thirdweb-dev/js/pull/1230) [`b5e1d3bb`](https://github.com/thirdweb-dev/js/commit/b5e1d3bb2b82785d6d3e5c899d27691bdb638625) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Add useSmartWalletsForAddress hook
|
||||||
|
|
||||||
|
- [#1224](https://github.com/thirdweb-dev/js/pull/1224) [`f7f4f207`](https://github.com/thirdweb-dev/js/commit/f7f4f20737ac5d78424ca9c91220f00b85adde6b) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Better return type for get shared metadata
|
||||||
|
|
||||||
|
- [#1213](https://github.com/thirdweb-dev/js/pull/1213) [`3ce5f9a0`](https://github.com/thirdweb-dev/js/commit/3ce5f9a0c3fc7e99b5abf691a87048ab8475f6b1) Thanks [@iketw](https://github.com/iketw)! - [ReactCore/Wallets] Improve error messages for wc and auth
|
||||||
|
|
||||||
|
- [#1218](https://github.com/thirdweb-dev/js/pull/1218) [`d4d95507`](https://github.com/thirdweb-dev/js/commit/d4d95507130b2b5408bfaa73ef3b708ca00c773e) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Add get for shared metadata
|
||||||
|
|
||||||
|
- Updated dependencies [[`6816219a`](https://github.com/thirdweb-dev/js/commit/6816219ac13ae571a0c90db6ab389c319bc1f052), [`48065bcd`](https://github.com/thirdweb-dev/js/commit/48065bcd91c13e1f44d54343b5c6c2646b9e86e4), [`3cb298ac`](https://github.com/thirdweb-dev/js/commit/3cb298ac4b04d295899b5ac77c7fc5869ec2f5f2), [`6aa6f7e0`](https://github.com/thirdweb-dev/js/commit/6aa6f7e0bd2313e2e1ad96dd41aad91e6694d380), [`f7f4f207`](https://github.com/thirdweb-dev/js/commit/f7f4f20737ac5d78424ca9c91220f00b85adde6b), [`3ce5f9a0`](https://github.com/thirdweb-dev/js/commit/3ce5f9a0c3fc7e99b5abf691a87048ab8475f6b1), [`d4d95507`](https://github.com/thirdweb-dev/js/commit/d4d95507130b2b5408bfaa73ef3b708ca00c773e), [`a388d07a`](https://github.com/thirdweb-dev/js/commit/a388d07a3d449e56dc53fed9600931022f4a15e1), [`1ce8558d`](https://github.com/thirdweb-dev/js/commit/1ce8558df47186bcba5ee8564fdb04583bf115dd), [`483e2b91`](https://github.com/thirdweb-dev/js/commit/483e2b910934d75276a68bae64d04c47cd7d57e3), [`c08e6ba9`](https://github.com/thirdweb-dev/js/commit/c08e6ba988ad97aa27d5868cec8abe3498d07a0a), [`60fb1889`](https://github.com/thirdweb-dev/js/commit/60fb18894372f14d9cd815fa9a239926d31bb273), [`3d615a62`](https://github.com/thirdweb-dev/js/commit/3d615a62d0a6801f6fb0e63f9b95c2f98446add1)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.23
|
||||||
|
- @thirdweb-dev/sdk@3.10.24
|
||||||
|
- @thirdweb-dev/wallets@0.3.2
|
||||||
|
|
||||||
|
## 3.14.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1206](https://github.com/thirdweb-dev/js/pull/1206) [`3d62278a`](https://github.com/thirdweb-dev/js/commit/3d62278aba79101ae1158fb726d6ddfed505c939) Thanks [@MananTank](https://github.com/MananTank)! - Add eslint-plugin-better-tree-shaking
|
||||||
|
|
||||||
|
- [#1193](https://github.com/thirdweb-dev/js/pull/1193) [`23d61cfe`](https://github.com/thirdweb-dev/js/commit/23d61cfeff2e5a885c511416d7491e7933ed404a) Thanks [@jnsdls](https://github.com/jnsdls)! - add shared metadata extension (open edition)
|
||||||
|
|
||||||
|
- Updated dependencies [[`d9b7360d`](https://github.com/thirdweb-dev/js/commit/d9b7360d1d78abcdaca89aa35e66388cbc5eb26c), [`8a2d9204`](https://github.com/thirdweb-dev/js/commit/8a2d92046a416c99c6bfecf63a6fdb6cc02ea175), [`990c665d`](https://github.com/thirdweb-dev/js/commit/990c665de9e5c1070dc80fe0f1b434e251f70a94), [`3d62278a`](https://github.com/thirdweb-dev/js/commit/3d62278aba79101ae1158fb726d6ddfed505c939), [`c6f44722`](https://github.com/thirdweb-dev/js/commit/c6f44722f9d123db4e7c4c799fe8e0374a02107c), [`45ae105e`](https://github.com/thirdweb-dev/js/commit/45ae105ed3e48bfbf6be84aa12ecb0fb55a917b7), [`f41f1a29`](https://github.com/thirdweb-dev/js/commit/f41f1a2958a2cedcf0496c9a3ca284d0b98f1b89), [`bb7ca20e`](https://github.com/thirdweb-dev/js/commit/bb7ca20e49c5c374b12a4ed746a2ac3db488abd9), [`23d61cfe`](https://github.com/thirdweb-dev/js/commit/23d61cfeff2e5a885c511416d7491e7933ed404a), [`8941b226`](https://github.com/thirdweb-dev/js/commit/8941b22682d1b15a6e0d311b1e8548b95d6cfadf), [`e0ce4a37`](https://github.com/thirdweb-dev/js/commit/e0ce4a37596a91a072f8551e323fce6723113dcb)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.23
|
||||||
|
- @thirdweb-dev/wallets@0.3.1
|
||||||
|
- @thirdweb-dev/chains@0.1.22
|
||||||
|
|
||||||
## 3.14.0
|
## 3.14.0
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-core",
|
"name": "@thirdweb-dev/react-core",
|
||||||
"version": "3.14.0",
|
"version": "3.14.2",
|
||||||
"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",
|
||||||
@@ -87,6 +87,7 @@
|
|||||||
"eslint": "^8.42.0",
|
"eslint": "^8.42.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
|
"eslint-plugin-better-tree-shaking": "0.0.3",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
// eslint-disable-next-line turbo/no-undeclared-env-vars, better-tree-shaking/no-top-level-side-effects
|
||||||
export const __DEV__ = process.env.NODE_ENV !== "production";
|
export const __DEV__ = process.env.NODE_ENV !== "production";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createContext } from "react";
|
import { createContext } from "react";
|
||||||
|
|
||||||
export const ThirdwebThemeContext = createContext<"light" | "dark" | undefined>(
|
export const ThirdwebThemeContext = /* @__PURE__ */ createContext<
|
||||||
undefined,
|
"light" | "dark" | undefined
|
||||||
);
|
>(undefined);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ type ThirdwebWalletContextData = {
|
|||||||
getWalletConfig: (walletInstance: WalletInstance) => WalletConfig | undefined;
|
getWalletConfig: (walletInstance: WalletInstance) => WalletConfig | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ThirdwebWalletContext = createContext<
|
const ThirdwebWalletContext = /* @__PURE__ */ createContext<
|
||||||
ThirdwebWalletContextData | undefined
|
ThirdwebWalletContextData | undefined
|
||||||
>(undefined);
|
>(undefined);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function ChangeActiveWalletOnAccountSwitch() {
|
|||||||
try {
|
try {
|
||||||
await switchAccount(data.address);
|
await switchAccount(data.address);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(
|
console.debug(
|
||||||
`[Auth] Failed to switch account to ${data.address} with error:\n`,
|
`[Auth] Failed to switch account to ${data.address} with error:\n`,
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
@@ -63,7 +63,7 @@ function ChangeActiveWalletOnAccountSwitch() {
|
|||||||
try {
|
try {
|
||||||
await logout();
|
await logout();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(`[Auth] Failed to logout with error:\n`, err);
|
console.debug(`[Auth] Failed to logout with error:\n`, err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export interface ThirdwebAuthConfig {
|
|||||||
|
|
||||||
export interface ThirdwebAuthContext extends ThirdwebAuthConfig {}
|
export interface ThirdwebAuthContext extends ThirdwebAuthConfig {}
|
||||||
|
|
||||||
export const ThirdwebAuthContext = createContext<
|
export const ThirdwebAuthContext = /* @__PURE__ */ createContext<
|
||||||
ThirdwebAuthContext | undefined
|
ThirdwebAuthContext | undefined
|
||||||
>(undefined);
|
>(undefined);
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ interface ThirdwebConfigContext {
|
|||||||
infuraApiKey?: string;
|
infuraApiKey?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ThirdwebConfigContext = createContext<ThirdwebConfigContext>({
|
const ThirdwebConfigContext =
|
||||||
chains: defaultChains,
|
/* @__PURE__ */ createContext<ThirdwebConfigContext>({
|
||||||
});
|
chains: defaultChains,
|
||||||
|
});
|
||||||
|
|
||||||
export const ThirdwebConfigProvider: React.FC<
|
export const ThirdwebConfigProvider: React.FC<
|
||||||
PropsWithChildren<{
|
PropsWithChildren<{
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ const INITIAL_CONTEXT_VALUE: ThirdwebConnectedWalletContext = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ThirdwebConnectedWalletContext =
|
const ThirdwebConnectedWalletContext =
|
||||||
createContext<ThirdwebConnectedWalletContext>(INITIAL_CONTEXT_VALUE);
|
/* @__PURE__ */ createContext<ThirdwebConnectedWalletContext>(
|
||||||
|
INITIAL_CONTEXT_VALUE,
|
||||||
|
);
|
||||||
|
|
||||||
export const ThirdwebConnectedWalletProvider: React.FC<
|
export const ThirdwebConnectedWalletProvider: React.FC<
|
||||||
PropsWithChildren<{ signer?: Signer }>
|
PropsWithChildren<{ signer?: Signer }>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { BasicNFTInput } from "@thirdweb-dev/sdk/dist/declarations/src/core/schema/nft";
|
||||||
import {
|
import {
|
||||||
requiredParamInvariant,
|
requiredParamInvariant,
|
||||||
RequiredParam,
|
RequiredParam,
|
||||||
@@ -23,6 +24,7 @@ import {
|
|||||||
useMutation,
|
useMutation,
|
||||||
UseMutationResult,
|
UseMutationResult,
|
||||||
useQueryClient,
|
useQueryClient,
|
||||||
|
UseQueryResult,
|
||||||
} from "@tanstack/react-query";
|
} from "@tanstack/react-query";
|
||||||
import { Erc1155, QueryAllParams, NFT } from "@thirdweb-dev/sdk";
|
import { Erc1155, QueryAllParams, NFT } from "@thirdweb-dev/sdk";
|
||||||
import { BigNumber, BigNumberish, providers } from "ethers";
|
import { BigNumber, BigNumberish, providers } from "ethers";
|
||||||
@@ -318,6 +320,44 @@ export function useNFTBalance(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the shared metadata of an Open Edition NFT contract
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```javascript
|
||||||
|
* const { data: sharedMetadata, isLoading, error } = useSharedMetadata(contract);
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @param contract - an instance of a {@link NFTContract}
|
||||||
|
* @returns a response object that includes the shared metadata of the contract
|
||||||
|
* @twfeature ERC721SharedMetadata
|
||||||
|
* @see {@link https://portal.thirdweb.com/react/react.usesharedmetadata?utm_source=sdk | Documentation}
|
||||||
|
* @beta
|
||||||
|
*/
|
||||||
|
export function useSharedMetadata(
|
||||||
|
contract: RequiredParam<NFTContract>,
|
||||||
|
): UseQueryResult<BasicNFTInput | undefined> {
|
||||||
|
const contractAddress = contract?.getAddress();
|
||||||
|
const { erc721 } = getErcs(contract);
|
||||||
|
return useQueryWithNetwork(
|
||||||
|
cacheKeys.contract.nft.sharedMetadata.get(contractAddress),
|
||||||
|
() => {
|
||||||
|
requiredParamInvariant(contract, "No Contract instance provided");
|
||||||
|
if (erc721) {
|
||||||
|
invariant(
|
||||||
|
erc721.sharedMetadata.get,
|
||||||
|
"Contract instance does not support sharedMetadata.get",
|
||||||
|
);
|
||||||
|
return erc721.sharedMetadata.get();
|
||||||
|
}
|
||||||
|
invariant(false, "Unknown NFT type");
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enabled: !!contract,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** **********************/
|
/** **********************/
|
||||||
/** WRITE HOOKS **/
|
/** WRITE HOOKS **/
|
||||||
/** **********************/
|
/** **********************/
|
||||||
@@ -604,10 +644,6 @@ export function useAirdropNFT(contract: Erc1155) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** **********************/
|
|
||||||
/** WRITE HOOKS **/
|
|
||||||
/** **********************/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Burn an NFT
|
* Burn an NFT
|
||||||
*
|
*
|
||||||
@@ -676,3 +712,34 @@ export function useBurnNFT<TContract extends NFTContract>(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set shared metadata
|
||||||
|
* TODO add docs
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
export function useSetSharedMetadata<TContract extends NFTContract>(
|
||||||
|
contract: RequiredParam<TContract>,
|
||||||
|
) {
|
||||||
|
const activeChainId = useSDKChainId();
|
||||||
|
const contractAddress = contract?.getAddress();
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
const { erc721 } = getErcs(contract);
|
||||||
|
|
||||||
|
return useMutation(
|
||||||
|
async (data: BasicNFTInput) => {
|
||||||
|
if (erc721) {
|
||||||
|
return await erc721.sharedMetadata.set(data);
|
||||||
|
}
|
||||||
|
invariant(false, "Unknown NFT type");
|
||||||
|
},
|
||||||
|
{
|
||||||
|
onSettled: () =>
|
||||||
|
invalidateContractAndBalances(
|
||||||
|
queryClient,
|
||||||
|
contractAddress,
|
||||||
|
activeChainId,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
UseQueryResult,
|
UseQueryResult,
|
||||||
} from "@tanstack/react-query";
|
} from "@tanstack/react-query";
|
||||||
import type {
|
import type {
|
||||||
AccountEvent, SmartContract,
|
AccountEvent, AddressOrEns, SmartContract,
|
||||||
} from "@thirdweb-dev/sdk";
|
} from "@thirdweb-dev/sdk";
|
||||||
import type { BytesLike } from "ethers";
|
import type { BytesLike } from "ethers";
|
||||||
import invariant from "tiny-invariant";
|
import invariant from "tiny-invariant";
|
||||||
@@ -58,6 +58,39 @@ export function useSmartWallets(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all wallets associated with the provided address
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```javascript
|
||||||
|
* const { data: smartWalletsForAddress, isLoading, error } = useSmartWalletsForAddress(contract, "{{wallet_address}}");
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @param contract - an instance of a smart wallet factory contract
|
||||||
|
* @returns a response object that includes an array of all smart wallets associated with the adress
|
||||||
|
* @twfeature SmartWalletFactory
|
||||||
|
* @see {@link https://portal.thirdweb.com/react/react.usesmartwalletsforaddress?utm_source=sdk | Documentation}
|
||||||
|
* @beta
|
||||||
|
*/
|
||||||
|
export function useSmartWalletsForAddress(
|
||||||
|
contract: RequiredParam<SmartContract>,
|
||||||
|
address: AddressOrEns,
|
||||||
|
): UseQueryResult<string[]> {
|
||||||
|
const contractAddress = contract?.getAddress();
|
||||||
|
return useQueryWithNetwork(
|
||||||
|
cacheKeys.contract.smartWalletFactory.getAllForAddress(contractAddress, address),
|
||||||
|
() => {
|
||||||
|
requiredParamInvariant(contract, "No Contract instance provided");
|
||||||
|
invariant(
|
||||||
|
contract.smartWalletFactory.getAssociatedWallets,
|
||||||
|
"Contract instance does not support contract.smartWalletFactory.getAssociatedWallets",
|
||||||
|
);
|
||||||
|
return contract.smartWalletFactory.getAssociatedWallets(address);
|
||||||
|
},
|
||||||
|
{ enabled: !!contract },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a smart wallet has been deployed for the given admin
|
* Check if a smart wallet has been deployed for the given admin
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ export {
|
|||||||
useTransferNFT,
|
useTransferNFT,
|
||||||
useAirdropNFT,
|
useAirdropNFT,
|
||||||
useBurnNFT,
|
useBurnNFT,
|
||||||
|
useSharedMetadata,
|
||||||
|
useSetSharedMetadata,
|
||||||
} from "./hooks/async/nft";
|
} from "./hooks/async/nft";
|
||||||
|
|
||||||
// roles
|
// roles
|
||||||
@@ -197,6 +199,7 @@ export {
|
|||||||
useIsSmartWalletDeployed,
|
useIsSmartWalletDeployed,
|
||||||
useSmartWallets,
|
useSmartWallets,
|
||||||
useCreateSmartWallet,
|
useCreateSmartWallet,
|
||||||
|
useSmartWalletsForAddress,
|
||||||
} from "./hooks/async/smart-wallet-factory";
|
} from "./hooks/async/smart-wallet-factory";
|
||||||
|
|
||||||
// thirdweb hooks (work as long as at least `<ThirdwebSdkProvider>` is used)
|
// thirdweb hooks (work as long as at least `<ThirdwebSdkProvider>` is used)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ interface TWSDKContext {
|
|||||||
_inProvider?: true;
|
_inProvider?: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ThirdwebSDKContext = createContext<TWSDKContext>({});
|
const ThirdwebSDKContext = /* @__PURE__ */ createContext<TWSDKContext>({});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ export const cacheKeys = {
|
|||||||
createContractCacheKey(contractAddress, ["smartWalletFactory"]),
|
createContractCacheKey(contractAddress, ["smartWalletFactory"]),
|
||||||
isSmartWalletDeployed: (contractAdress: RequiredParam<ContractAddress>, admin: RequiredParam<string>) =>
|
isSmartWalletDeployed: (contractAdress: RequiredParam<ContractAddress>, admin: RequiredParam<string>) =>
|
||||||
createContractCacheKey(contractAdress, ["isSmartWalletDeployed", admin]),
|
createContractCacheKey(contractAdress, ["isSmartWalletDeployed", admin]),
|
||||||
|
getAllForAddress: (contractAdress: RequiredParam<ContractAddress>, address: RequiredParam<string>) =>
|
||||||
|
createContractCacheKey(contractAdress, ["getAllForAddress", address]),
|
||||||
},
|
},
|
||||||
|
|
||||||
app: {
|
app: {
|
||||||
@@ -190,6 +192,14 @@ export const cacheKeys = {
|
|||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
sharedMetadata: {
|
||||||
|
get: (
|
||||||
|
contractAddress: RequiredParam<ContractAddress>,
|
||||||
|
) =>
|
||||||
|
createContractCacheKey(
|
||||||
|
contractAddress
|
||||||
|
),
|
||||||
|
},
|
||||||
drop: {
|
drop: {
|
||||||
getAllUnclaimed: (
|
getAllUnclaimed: (
|
||||||
contractAddress: RequiredParam<ContractAddress>,
|
contractAddress: RequiredParam<ContractAddress>,
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ export interface ThirdwebAuthConfig {
|
|||||||
|
|
||||||
interface ThirdwebAuthContext extends ThirdwebAuthConfig {}
|
interface ThirdwebAuthContext extends ThirdwebAuthConfig {}
|
||||||
|
|
||||||
const ThirdwebAuthContext = createContext<ThirdwebAuthContext | undefined>(
|
const ThirdwebAuthContext = /* @__PURE__ */ createContext<
|
||||||
undefined,
|
ThirdwebAuthContext | undefined
|
||||||
);
|
>(undefined);
|
||||||
|
|
||||||
export const ThirdwebAuthProvider: React.FC<
|
export const ThirdwebAuthProvider: React.FC<
|
||||||
PropsWithChildren<{ value?: ThirdwebAuthConfig }>
|
PropsWithChildren<{ value?: ThirdwebAuthConfig }>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ interface ThirdwebSDKContext {
|
|||||||
desiredNetwork: string;
|
desiredNetwork: string;
|
||||||
_inProvider?: true;
|
_inProvider?: true;
|
||||||
}
|
}
|
||||||
const ThirdwebSDKContext = createContext<ThirdwebSDKContext>({
|
const ThirdwebSDKContext = /* @__PURE__ */ createContext<ThirdwebSDKContext>({
|
||||||
sdk: null,
|
sdk: null,
|
||||||
desiredNetwork: "unknown",
|
desiredNetwork: "unknown",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# @thirdweb-dev/react-native-compat
|
# @thirdweb-dev/react-native-compat
|
||||||
|
|
||||||
|
## 0.2.21
|
||||||
|
|
||||||
|
## 0.2.20
|
||||||
|
|
||||||
## 0.2.19
|
## 0.2.19
|
||||||
|
|
||||||
## 0.2.18
|
## 0.2.18
|
||||||
|
|||||||
@@ -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.19",
|
"version": "0.2.21",
|
||||||
"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,59 @@
|
|||||||
# @thirdweb-dev/react-native
|
# @thirdweb-dev/react-native
|
||||||
|
|
||||||
|
## 0.2.21
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1220](https://github.com/thirdweb-dev/js/pull/1220) [`3cb298ac`](https://github.com/thirdweb-dev/js/commit/3cb298ac4b04d295899b5ac77c7fc5869ec2f5f2) Thanks [@iketw](https://github.com/iketw)! - [RN/Wallets] Fix Coinbase wallet connection rejection error
|
||||||
|
|
||||||
|
Unhandled Rejections: We were rethrowing an error in an async function (connect) without any catch block to handle it. We were getting an Unhandled Promise Rejection, which lead to a crash in React Native when rejecting a connection from the Coinbase Wallet.
|
||||||
|
|
||||||
|
- Updated dependencies [[`6816219a`](https://github.com/thirdweb-dev/js/commit/6816219ac13ae571a0c90db6ab389c319bc1f052), [`48065bcd`](https://github.com/thirdweb-dev/js/commit/48065bcd91c13e1f44d54343b5c6c2646b9e86e4), [`3cb298ac`](https://github.com/thirdweb-dev/js/commit/3cb298ac4b04d295899b5ac77c7fc5869ec2f5f2), [`b5e1d3bb`](https://github.com/thirdweb-dev/js/commit/b5e1d3bb2b82785d6d3e5c899d27691bdb638625), [`6aa6f7e0`](https://github.com/thirdweb-dev/js/commit/6aa6f7e0bd2313e2e1ad96dd41aad91e6694d380), [`f7f4f207`](https://github.com/thirdweb-dev/js/commit/f7f4f20737ac5d78424ca9c91220f00b85adde6b), [`3ce5f9a0`](https://github.com/thirdweb-dev/js/commit/3ce5f9a0c3fc7e99b5abf691a87048ab8475f6b1), [`d4d95507`](https://github.com/thirdweb-dev/js/commit/d4d95507130b2b5408bfaa73ef3b708ca00c773e), [`a388d07a`](https://github.com/thirdweb-dev/js/commit/a388d07a3d449e56dc53fed9600931022f4a15e1), [`1ce8558d`](https://github.com/thirdweb-dev/js/commit/1ce8558df47186bcba5ee8564fdb04583bf115dd), [`483e2b91`](https://github.com/thirdweb-dev/js/commit/483e2b910934d75276a68bae64d04c47cd7d57e3), [`c08e6ba9`](https://github.com/thirdweb-dev/js/commit/c08e6ba988ad97aa27d5868cec8abe3498d07a0a), [`60fb1889`](https://github.com/thirdweb-dev/js/commit/60fb18894372f14d9cd815fa9a239926d31bb273), [`3d615a62`](https://github.com/thirdweb-dev/js/commit/3d615a62d0a6801f6fb0e63f9b95c2f98446add1)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.23
|
||||||
|
- @thirdweb-dev/sdk@3.10.24
|
||||||
|
- @thirdweb-dev/wallets@0.3.2
|
||||||
|
- @thirdweb-dev/react-core@3.14.2
|
||||||
|
|
||||||
|
## 0.2.20
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1202](https://github.com/thirdweb-dev/js/pull/1202) [`04416e7c`](https://github.com/thirdweb-dev/js/commit/04416e7c93d3b090fe0145ada6de5dbec211e29d) Thanks [@iketw](https://github.com/iketw)! - [RN] Return connection Promise in wallets hooks for better error handling
|
||||||
|
|
||||||
|
- [#1205](https://github.com/thirdweb-dev/js/pull/1205) [`3ab7d1e9`](https://github.com/thirdweb-dev/js/commit/3ab7d1e97541ad5ff4f58ec2885fda9f9ab1a7c6) Thanks [@iketw](https://github.com/iketw)! - [RN] Added the option to import a new wallet in guest mode
|
||||||
|
|
||||||
|
- [#1205](https://github.com/thirdweb-dev/js/pull/1205) [`3ab7d1e9`](https://github.com/thirdweb-dev/js/commit/3ab7d1e97541ad5ff4f58ec2885fda9f9ab1a7c6) Thanks [@iketw](https://github.com/iketw)! - [ReactNative] Export more components for easy development
|
||||||
|
|
||||||
|
- IconTextButton
|
||||||
|
Component that renders an icon and a text inside a button with border:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
<IconTextButton
|
||||||
|
mt="xs"
|
||||||
|
text="Switch Accounts"
|
||||||
|
icon={<SwitchIcon height={10} width={10} />}
|
||||||
|
onPress={() => {}}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
- NetworkButton: Used to render a Network
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
<NetworkButton
|
||||||
|
chainIconUrl={chain?.icon?.url || ""}
|
||||||
|
chainName={chain?.name || "Unknown Network"}
|
||||||
|
onPress={onChangeNetworkPress}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
- Exported all icons from the assets folder for external use
|
||||||
|
|
||||||
|
- Updated dependencies [[`d9b7360d`](https://github.com/thirdweb-dev/js/commit/d9b7360d1d78abcdaca89aa35e66388cbc5eb26c), [`8a2d9204`](https://github.com/thirdweb-dev/js/commit/8a2d92046a416c99c6bfecf63a6fdb6cc02ea175), [`990c665d`](https://github.com/thirdweb-dev/js/commit/990c665de9e5c1070dc80fe0f1b434e251f70a94), [`3d62278a`](https://github.com/thirdweb-dev/js/commit/3d62278aba79101ae1158fb726d6ddfed505c939), [`c6f44722`](https://github.com/thirdweb-dev/js/commit/c6f44722f9d123db4e7c4c799fe8e0374a02107c), [`45ae105e`](https://github.com/thirdweb-dev/js/commit/45ae105ed3e48bfbf6be84aa12ecb0fb55a917b7), [`f41f1a29`](https://github.com/thirdweb-dev/js/commit/f41f1a2958a2cedcf0496c9a3ca284d0b98f1b89), [`bb7ca20e`](https://github.com/thirdweb-dev/js/commit/bb7ca20e49c5c374b12a4ed746a2ac3db488abd9), [`23d61cfe`](https://github.com/thirdweb-dev/js/commit/23d61cfeff2e5a885c511416d7491e7933ed404a), [`8941b226`](https://github.com/thirdweb-dev/js/commit/8941b22682d1b15a6e0d311b1e8548b95d6cfadf), [`e0ce4a37`](https://github.com/thirdweb-dev/js/commit/e0ce4a37596a91a072f8551e323fce6723113dcb)]:
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
- @thirdweb-dev/[email protected]
|
||||||
|
|
||||||
## 0.2.19
|
## 0.2.19
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native",
|
"name": "@thirdweb-dev/react-native",
|
||||||
"version": "0.2.19",
|
"version": "0.2.21",
|
||||||
"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",
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
"android"
|
"android"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coinbase/wallet-mobile-sdk": "^1.0.4",
|
"@coinbase/wallet-mobile-sdk": "1.0.6",
|
||||||
"@magic-sdk/provider": "17.2.0",
|
"@magic-sdk/provider": "17.2.0",
|
||||||
"@magic-sdk/react-native-bare": "^18.3.0",
|
"@magic-sdk/react-native-bare": "^18.3.0",
|
||||||
"@shopify/restyle": "^2.4.1",
|
"@shopify/restyle": "^2.4.1",
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
export * from "./back";
|
||||||
|
export * from "./close";
|
||||||
|
export * from "./copy";
|
||||||
|
export * from "./disconnect";
|
||||||
|
export * from "./down-arrow";
|
||||||
|
export * from "./eye-closed";
|
||||||
|
export * from "./eye-opened";
|
||||||
|
export * from "./qr-code";
|
||||||
|
export * from "./right-arrow";
|
||||||
|
export * from "./wallet";
|
||||||
|
export * from "./money";
|
||||||
|
export * from "./switch";
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import Svg, { Circle, Path } from "react-native-svg";
|
||||||
|
import { IconStyleProp } from "./types";
|
||||||
|
|
||||||
|
const MoneyIcon = ({ width, height, color }: IconStyleProp) => {
|
||||||
|
return (
|
||||||
|
<Svg width={width} height={height} viewBox="0 0 16 16" fill="none">
|
||||||
|
<Circle
|
||||||
|
cx="8"
|
||||||
|
cy="8"
|
||||||
|
r="6.335"
|
||||||
|
stroke={color || "#646D7A"}
|
||||||
|
stroke-width="1.33"
|
||||||
|
/>
|
||||||
|
<Path
|
||||||
|
d="M7.82244 11.7273V4.45455H8.28835V11.7273H7.82244ZM8.9446 6.92614C8.92566 6.7178 8.84138 6.55587 8.69176 6.44034C8.54403 6.32292 8.33286 6.2642 8.05824 6.2642C7.87642 6.2642 7.72491 6.28788 7.60369 6.33523C7.48248 6.38258 7.39157 6.44792 7.33097 6.53125C7.27036 6.61269 7.23911 6.70644 7.23722 6.8125C7.23343 6.89962 7.25047 6.97633 7.28835 7.04261C7.32813 7.1089 7.38494 7.16761 7.45881 7.21875C7.53456 7.26799 7.62547 7.31155 7.73153 7.34943C7.83759 7.38731 7.95691 7.42045 8.08949 7.44886L8.58949 7.5625C8.87737 7.625 9.13116 7.70833 9.35085 7.8125C9.57244 7.91667 9.75805 8.04072 9.90767 8.18466C10.0592 8.3286 10.1738 8.49432 10.2514 8.68182C10.3291 8.86932 10.3688 9.07955 10.3707 9.3125C10.3688 9.67992 10.276 9.99527 10.0923 10.2585C9.90862 10.5218 9.64441 10.7235 9.29972 10.8636C8.95691 11.0038 8.54309 11.0739 8.05824 11.0739C7.5715 11.0739 7.14725 11.0009 6.78551 10.8551C6.42377 10.7093 6.14252 10.4877 5.94176 10.1903C5.741 9.89299 5.63778 9.51705 5.6321 9.0625H6.97869C6.99006 9.25 7.04025 9.40625 7.12926 9.53125C7.21828 9.65625 7.34044 9.75095 7.49574 9.81534C7.65294 9.87973 7.83475 9.91193 8.04119 9.91193C8.23059 9.91193 8.39157 9.88636 8.52415 9.83523C8.65862 9.78409 8.76184 9.71307 8.83381 9.62216C8.90578 9.53125 8.94271 9.42708 8.9446 9.30966C8.94271 9.19981 8.90862 9.10606 8.84233 9.02841C8.77604 8.94886 8.67377 8.88068 8.53551 8.82386C8.39915 8.76515 8.22491 8.71117 8.01278 8.66193L7.40483 8.51989C6.90104 8.40436 6.50426 8.2178 6.21449 7.96023C5.92472 7.70076 5.78078 7.35038 5.78267 6.90909C5.78078 6.54924 5.87737 6.2339 6.07244 5.96307C6.26752 5.69223 6.53741 5.48106 6.8821 5.32955C7.2268 5.17803 7.61979 5.10227 8.06108 5.10227C8.51184 5.10227 8.90294 5.17898 9.23438 5.33239C9.56771 5.4839 9.82623 5.69697 10.0099 5.97159C10.1937 6.24621 10.2874 6.56439 10.2912 6.92614H8.9446Z"
|
||||||
|
fill={color || "#646D7A"}
|
||||||
|
/>
|
||||||
|
</Svg>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MoneyIcon;
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import Svg, { Path } from "react-native-svg";
|
||||||
|
import { IconStyleProp } from "./types";
|
||||||
|
|
||||||
|
const SwitchIcon = ({ width, height, color }: IconStyleProp) => {
|
||||||
|
return (
|
||||||
|
<Svg width={width} height={height} viewBox="0 0 12 12" fill="none">
|
||||||
|
<Path
|
||||||
|
d="M7.99967 0.666626H10.6663M10.6663 0.666626V3.33329M10.6663 0.666626L7.83301 4.16663M1.33301 10.6666L3.99967 7.99996M7.99967 10.6666H10.6663M10.6663 10.6666V7.99996M10.6663 10.6666L1.33301 1.33329"
|
||||||
|
stroke={color || "#646D7A"}
|
||||||
|
stroke-width="1.33333"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
/>
|
||||||
|
</Svg>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SwitchIcon;
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import Svg, { Path } from "react-native-svg";
|
import Svg, { Path } from "react-native-svg";
|
||||||
|
import { IconStyleProp } from "./types";
|
||||||
|
|
||||||
const PocketWalletIcon = ({ size }: { size: number }) => {
|
const PocketWalletIcon = ({ width, height }: IconStyleProp) => {
|
||||||
return (
|
return (
|
||||||
<Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
|
<Svg width={width} height={height} viewBox="0 0 16 16" fill="none">
|
||||||
<Path
|
<Path
|
||||||
d="M13.3337 7.99996V5.33329H4.00033C3.6467 5.33329 3.30756 5.19282 3.05752 4.94277C2.80747 4.69272 2.66699 4.35358 2.66699 3.99996C2.66699 3.26663 3.26699 2.66663 4.00033 2.66663H12.0003V5.33329"
|
d="M13.3337 7.99996V5.33329H4.00033C3.6467 5.33329 3.30756 5.19282 3.05752 4.94277C2.80747 4.69272 2.66699 4.35358 2.66699 3.99996C2.66699 3.26663 3.26699 2.66663 4.00033 2.66663H12.0003V5.33329"
|
||||||
stroke="#646D7A"
|
stroke="#646D7A"
|
||||||
|
|||||||
+3
-3
@@ -2,7 +2,7 @@ import { StyleSheet, View } from "react-native";
|
|||||||
import Box from "../base/Box";
|
import Box from "../base/Box";
|
||||||
import { Toast } from "../base/Toast";
|
import { Toast } from "../base/Toast";
|
||||||
import { ExportLocalWalletModal } from "./ExportLocalWalletModal";
|
import { ExportLocalWalletModal } from "./ExportLocalWalletModal";
|
||||||
import { NetworkButton } from "./NetworkButton";
|
import { NetworkButton } from "../base/NetworkButton";
|
||||||
import { WalletDetailsModalHeader } from "./WalletDetailsModalHeader";
|
import { WalletDetailsModalHeader } from "./WalletDetailsModalHeader";
|
||||||
import {
|
import {
|
||||||
useActiveChain,
|
useActiveChain,
|
||||||
@@ -113,7 +113,7 @@ export const ConnectWalletDetailsModal = () => {
|
|||||||
onPress={onExportLocalWalletPress}
|
onPress={onExportLocalWalletPress}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<PocketWalletIcon size={16} />
|
<PocketWalletIcon width={16} height={16} />
|
||||||
<View style={styles.exportWalletInfo}>
|
<View style={styles.exportWalletInfo}>
|
||||||
<Text variant="bodySmall">Backup wallet</Text>
|
<Text variant="bodySmall">Backup wallet</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -134,7 +134,7 @@ export const ConnectWalletDetailsModal = () => {
|
|||||||
onPress={onImportLocalWalletPress}
|
onPress={onImportLocalWalletPress}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<PocketWalletIcon size={16} />
|
<PocketWalletIcon width={16} height={16} />
|
||||||
<View style={styles.exportWalletInfo}>
|
<View style={styles.exportWalletInfo}>
|
||||||
<Text variant="bodySmall">Import wallet</Text>
|
<Text variant="bodySmall">Import wallet</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
+1
-1
@@ -109,7 +109,7 @@ export const SmartWalletAdditionalActions = ({
|
|||||||
onPress={onExportPress}
|
onPress={onExportPress}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<PocketWalletIcon size={16} />
|
<PocketWalletIcon width={16} height={16} />
|
||||||
<View style={styles.exportWalletInfo}>
|
<View style={styles.exportWalletInfo}>
|
||||||
<Text variant="bodySmall">
|
<Text variant="bodySmall">
|
||||||
{wallet?.walletId === walletIds.localWallet
|
{wallet?.walletId === walletIds.localWallet
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ export const ConnectWalletFlow = () => {
|
|||||||
const connectActiveWallet = useCallback(
|
const connectActiveWallet = useCallback(
|
||||||
async (wallet: WalletConfig, data?: any) => {
|
async (wallet: WalletConfig, data?: any) => {
|
||||||
setIsConnecting(true);
|
setIsConnecting(true);
|
||||||
connect(wallet, { ...data })
|
try {
|
||||||
.catch((error) => {
|
await connect(wallet, { ...data });
|
||||||
console.error("Error connecting to the wallet", error);
|
} catch (error) {
|
||||||
})
|
console.error("Error connecting to the wallet", error);
|
||||||
.finally(() => {
|
} finally {
|
||||||
onClose(true);
|
onClose(true);
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
[connect, onClose],
|
[connect, onClose],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
import { ReactNode } from "react";
|
||||||
|
import { Theme } from "../../styles/theme";
|
||||||
|
import BaseButton from "./BaseButton";
|
||||||
|
import ImageSvgUri from "./ImageSvgUri";
|
||||||
|
import Text from "./Text";
|
||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
type IconTextProps = {
|
||||||
|
icon?:
|
||||||
|
| { iconUrl?: string; iconWidth?: number; iconHeight?: number }
|
||||||
|
| ReactNode;
|
||||||
|
text: string;
|
||||||
|
padding?: keyof Theme["spacing"];
|
||||||
|
onPress: () => void;
|
||||||
|
} & (typeof BaseButton)["arguments"];
|
||||||
|
|
||||||
|
export const IconTextButton = ({
|
||||||
|
icon,
|
||||||
|
onPress,
|
||||||
|
text,
|
||||||
|
p,
|
||||||
|
...args
|
||||||
|
}: IconTextProps) => {
|
||||||
|
return (
|
||||||
|
<BaseButton
|
||||||
|
p={p || "md"}
|
||||||
|
backgroundColor="background"
|
||||||
|
style={styles.networkContainer}
|
||||||
|
onPress={onPress}
|
||||||
|
borderColor="border"
|
||||||
|
{...args}
|
||||||
|
>
|
||||||
|
{icon && icon.iconUrl ? (
|
||||||
|
<ImageSvgUri
|
||||||
|
imageUrl={icon.iconUrl}
|
||||||
|
height={icon.iconHeight}
|
||||||
|
width={icon.iconWidth}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
icon
|
||||||
|
)}
|
||||||
|
<Text variant="bodySmall" style={styles.networkText}>
|
||||||
|
{text}
|
||||||
|
</Text>
|
||||||
|
{/* <RightArrowIcon size={10} /> */}
|
||||||
|
</BaseButton>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
networkText: {
|
||||||
|
marginLeft: 16,
|
||||||
|
},
|
||||||
|
networkContainer: {
|
||||||
|
borderRadius: 8,
|
||||||
|
borderWidth: 0.5,
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "flex-start",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
});
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
import { Theme } from "../../styles/theme";
|
import { Theme } from "../../styles/theme";
|
||||||
import BaseButton from "../base/BaseButton";
|
import BaseButton from "./BaseButton";
|
||||||
import { ChainIcon } from "../base/ChainIcon";
|
import { ChainIcon } from "./ChainIcon";
|
||||||
import Text from "../base/Text";
|
import Text from "./Text";
|
||||||
import { StyleSheet } from "react-native";
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
interface NetworkButtonProps {
|
interface NetworkButtonProps {
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
export { IconTextButton } from "./IconTextButton";
|
||||||
export { ActiveDot } from "./ActiveDot";
|
export { ActiveDot } from "./ActiveDot";
|
||||||
export { AddressDisplay } from "./AddressDisplay";
|
export { AddressDisplay } from "./AddressDisplay";
|
||||||
export { default as BaseButton } from "./BaseButton";
|
export { default as BaseButton } from "./BaseButton";
|
||||||
@@ -11,3 +12,7 @@ export { TextInput } from "./TextInput";
|
|||||||
export { Toast } from "./Toast";
|
export { Toast } from "./Toast";
|
||||||
export { WalletButton } from "./WalletButton";
|
export { WalletButton } from "./WalletButton";
|
||||||
export { WalletIcon } from "./WalletIcon";
|
export { WalletIcon } from "./WalletIcon";
|
||||||
|
export { NetworkButton } from "./NetworkButton";
|
||||||
|
export { TWModal } from "./modal/TWModal";
|
||||||
|
export { ModalFooter } from "./modal/ModalFooter";
|
||||||
|
export { ModalHeaderTextClose } from "./modal/ModalHeaderTextClose";
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ export { createSecureStorage } from "../core/SecureStorage";
|
|||||||
// ui components
|
// ui components
|
||||||
export * from "./components/base";
|
export * from "./components/base";
|
||||||
|
|
||||||
|
// assets / icons
|
||||||
|
export * from "./assets";
|
||||||
|
|
||||||
// providers
|
// providers
|
||||||
// export * from "./providers/full";
|
// export * from "./providers/full";
|
||||||
export * from "./providers/thirdweb-provider";
|
export * from "./providers/thirdweb-provider";
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ export class CoinbaseWalletConnector extends WagmiConnector<
|
|||||||
|
|
||||||
this.emit("message", { type: "connecting" });
|
this.emit("message", { type: "connecting" });
|
||||||
|
|
||||||
const account = (await provider.request({
|
const accounts: string[] = await provider.request({
|
||||||
method: "eth_requestAccounts",
|
method: "eth_requestAccounts",
|
||||||
params: [],
|
params: [],
|
||||||
})) as Address;
|
});
|
||||||
// Switch to chain if provided
|
// Switch to chain if provided
|
||||||
let id = await this.getChainId();
|
let id = await this.getChainId();
|
||||||
let unsupported = this.isChainUnsupported(id);
|
let unsupported = this.isChainUnsupported(id);
|
||||||
@@ -93,7 +93,7 @@ export class CoinbaseWalletConnector extends WagmiConnector<
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
account,
|
account: accounts[0],
|
||||||
chain: { id, unsupported },
|
chain: { id, unsupported },
|
||||||
provider: new providers.Web3Provider(
|
provider: new providers.Web3Provider(
|
||||||
provider as unknown as providers.ExternalProvider,
|
provider as unknown as providers.ExternalProvider,
|
||||||
|
|||||||
@@ -18,8 +18,11 @@ export function useCoinbaseWallet(callbackURL: string) {
|
|||||||
return useCallback(
|
return useCallback(
|
||||||
async (connectOptions?: { chainId?: number; callbackURL: string }) => {
|
async (connectOptions?: { chainId?: number; callbackURL: string }) => {
|
||||||
const { coinbaseWallet } = await import("../wallets/coinbase-wallet");
|
const { coinbaseWallet } = await import("../wallets/coinbase-wallet");
|
||||||
// @ts-ignore
|
return connect(
|
||||||
connect(coinbaseWallet({ callbackURL: callbackURL }), connectOptions);
|
// @ts-ignore
|
||||||
|
coinbaseWallet({ callbackURL: callbackURL }),
|
||||||
|
connectOptions,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
[connect, callbackURL],
|
[connect, callbackURL],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useMetaMaskWallet() {
|
|||||||
return useCallback(
|
return useCallback(
|
||||||
async (connectOptions?: { chainId?: number }) => {
|
async (connectOptions?: { chainId?: number }) => {
|
||||||
const { metamaskWallet } = await import("../wallets/metamask-wallet");
|
const { metamaskWallet } = await import("../wallets/metamask-wallet");
|
||||||
connect(metamaskWallet(), connectOptions);
|
return connect(metamaskWallet(), connectOptions);
|
||||||
},
|
},
|
||||||
[connect],
|
[connect],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useRainbowWallet() {
|
|||||||
return useCallback(
|
return useCallback(
|
||||||
async (connectOptions?: { chainId?: number }) => {
|
async (connectOptions?: { chainId?: number }) => {
|
||||||
const { rainbowWallet } = await import("../wallets/rainbow-wallet");
|
const { rainbowWallet } = await import("../wallets/rainbow-wallet");
|
||||||
connect(rainbowWallet(), connectOptions);
|
return connect(rainbowWallet(), connectOptions);
|
||||||
},
|
},
|
||||||
[connect],
|
[connect],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export function useTrustWallet() {
|
|||||||
return useCallback(
|
return useCallback(
|
||||||
async (connectOptions?: { chainId?: number }) => {
|
async (connectOptions?: { chainId?: number }) => {
|
||||||
const { trustWallet } = await import("../wallets/trust-wallet");
|
const { trustWallet } = await import("../wallets/trust-wallet");
|
||||||
connect(trustWallet(), connectOptions);
|
return connect(trustWallet(), connectOptions);
|
||||||
},
|
},
|
||||||
[connect],
|
[connect],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: ["thirdweb"],
|
extends: ["thirdweb"],
|
||||||
|
plugins: ["better-tree-shaking"],
|
||||||
rules: {
|
rules: {
|
||||||
"@next/next/no-img-element": "off",
|
"@next/next/no-img-element": "off",
|
||||||
|
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
# @thirdweb-dev/react
|
# @thirdweb-dev/react
|
||||||
|
|
||||||
|
## 3.14.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1226](https://github.com/thirdweb-dev/js/pull/1226) [`a388d07a`](https://github.com/thirdweb-dev/js/commit/a388d07a3d449e56dc53fed9600931022f4a15e1) Thanks [@MananTank](https://github.com/MananTank)! - Add Magic Connect support
|
||||||
|
|
||||||
|
- Updated dependencies [[`6816219a`](https://github.com/thirdweb-dev/js/commit/6816219ac13ae571a0c90db6ab389c319bc1f052), [`48065bcd`](https://github.com/thirdweb-dev/js/commit/48065bcd91c13e1f44d54343b5c6c2646b9e86e4), [`3cb298ac`](https://github.com/thirdweb-dev/js/commit/3cb298ac4b04d295899b5ac77c7fc5869ec2f5f2), [`b5e1d3bb`](https://github.com/thirdweb-dev/js/commit/b5e1d3bb2b82785d6d3e5c899d27691bdb638625), [`6aa6f7e0`](https://github.com/thirdweb-dev/js/commit/6aa6f7e0bd2313e2e1ad96dd41aad91e6694d380), [`f7f4f207`](https://github.com/thirdweb-dev/js/commit/f7f4f20737ac5d78424ca9c91220f00b85adde6b), [`3ce5f9a0`](https://github.com/thirdweb-dev/js/commit/3ce5f9a0c3fc7e99b5abf691a87048ab8475f6b1), [`d4d95507`](https://github.com/thirdweb-dev/js/commit/d4d95507130b2b5408bfaa73ef3b708ca00c773e), [`a388d07a`](https://github.com/thirdweb-dev/js/commit/a388d07a3d449e56dc53fed9600931022f4a15e1), [`1ce8558d`](https://github.com/thirdweb-dev/js/commit/1ce8558df47186bcba5ee8564fdb04583bf115dd), [`483e2b91`](https://github.com/thirdweb-dev/js/commit/483e2b910934d75276a68bae64d04c47cd7d57e3), [`c08e6ba9`](https://github.com/thirdweb-dev/js/commit/c08e6ba988ad97aa27d5868cec8abe3498d07a0a), [`60fb1889`](https://github.com/thirdweb-dev/js/commit/60fb18894372f14d9cd815fa9a239926d31bb273), [`3d615a62`](https://github.com/thirdweb-dev/js/commit/3d615a62d0a6801f6fb0e63f9b95c2f98446add1)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.23
|
||||||
|
- @thirdweb-dev/sdk@3.10.24
|
||||||
|
- @thirdweb-dev/wallets@0.3.2
|
||||||
|
- @thirdweb-dev/react-core@3.14.2
|
||||||
|
|
||||||
|
## 3.14.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1206](https://github.com/thirdweb-dev/js/pull/1206) [`3d62278a`](https://github.com/thirdweb-dev/js/commit/3d62278aba79101ae1158fb726d6ddfed505c939) Thanks [@MananTank](https://github.com/MananTank)! - Add eslint-plugin-better-tree-shaking
|
||||||
|
|
||||||
|
- Updated dependencies [[`d9b7360d`](https://github.com/thirdweb-dev/js/commit/d9b7360d1d78abcdaca89aa35e66388cbc5eb26c), [`8a2d9204`](https://github.com/thirdweb-dev/js/commit/8a2d92046a416c99c6bfecf63a6fdb6cc02ea175), [`990c665d`](https://github.com/thirdweb-dev/js/commit/990c665de9e5c1070dc80fe0f1b434e251f70a94), [`3d62278a`](https://github.com/thirdweb-dev/js/commit/3d62278aba79101ae1158fb726d6ddfed505c939), [`c6f44722`](https://github.com/thirdweb-dev/js/commit/c6f44722f9d123db4e7c4c799fe8e0374a02107c), [`45ae105e`](https://github.com/thirdweb-dev/js/commit/45ae105ed3e48bfbf6be84aa12ecb0fb55a917b7), [`f41f1a29`](https://github.com/thirdweb-dev/js/commit/f41f1a2958a2cedcf0496c9a3ca284d0b98f1b89), [`bb7ca20e`](https://github.com/thirdweb-dev/js/commit/bb7ca20e49c5c374b12a4ed746a2ac3db488abd9), [`23d61cfe`](https://github.com/thirdweb-dev/js/commit/23d61cfeff2e5a885c511416d7491e7933ed404a), [`8941b226`](https://github.com/thirdweb-dev/js/commit/8941b22682d1b15a6e0d311b1e8548b95d6cfadf), [`e0ce4a37`](https://github.com/thirdweb-dev/js/commit/e0ce4a37596a91a072f8551e323fce6723113dcb)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.23
|
||||||
|
- @thirdweb-dev/react-core@3.14.1
|
||||||
|
- @thirdweb-dev/wallets@0.3.1
|
||||||
|
- @thirdweb-dev/chains@0.1.22
|
||||||
|
|
||||||
## 3.14.0
|
## 3.14.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react",
|
"name": "@thirdweb-dev/react",
|
||||||
"version": "3.14.0",
|
"version": "3.14.2",
|
||||||
"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",
|
||||||
@@ -107,6 +107,7 @@
|
|||||||
"eslint": "^8.42.0",
|
"eslint": "^8.42.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
|
"eslint-plugin-better-tree-shaking": "0.0.3",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import styled from "@emotion/styled";
|
|||||||
import { Chain } from "@thirdweb-dev/chains";
|
import { Chain } from "@thirdweb-dev/chains";
|
||||||
import { resolveIpfsUri } from "@thirdweb-dev/react-core";
|
import { resolveIpfsUri } from "@thirdweb-dev/react-core";
|
||||||
|
|
||||||
const defaultChainIcon = resolveIpfsUri(
|
const defaultChainIcon = /* @__PURE__ */ resolveIpfsUri(
|
||||||
"ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
"ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ export const CopyIcon: React.FC<{
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const CheckIconStyled = styled(CheckIcon)<{ theme?: Theme }>`
|
const CheckIconStyled = /* @__PURE__ */ styled(CheckIcon)<{ theme?: Theme }>`
|
||||||
color: ${(p) => p.theme.icon.success};
|
color: ${(p) => p.theme.icon.success};
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -117,7 +117,9 @@ export const DragNDrop: React.FC<{
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const UploadIconSecondary = styled(UploadIcon)<{ theme?: Theme }>`
|
const UploadIconSecondary = /* @__PURE__ */ styled(UploadIcon)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
color: ${(props) => props.theme.text.secondary};
|
color: ${(props) => props.theme.text.secondary};
|
||||||
transition: transform 200ms ease, color 200ms ease;
|
transition: transform 200ms ease, color 200ms ease;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -152,7 +152,9 @@ const DialogContent = styled.div<{ theme?: Theme }>`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const DialogTitle = styled(Dialog.Title)<{ theme?: Theme }>`
|
const DialogTitle = /* @__PURE__ */ styled(/* @__PURE__ */ Dialog.Title)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: ${(p) => p.theme.text.neutral};
|
color: ${(p) => p.theme.text.neutral};
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
import { fontSize, radius, shadow, spacing, type Theme } from "../design-system";
|
import {
|
||||||
|
fontSize,
|
||||||
|
radius,
|
||||||
|
shadow,
|
||||||
|
spacing,
|
||||||
|
type Theme,
|
||||||
|
} from "../design-system";
|
||||||
import { keyframes } from "@emotion/react";
|
import { keyframes } from "@emotion/react";
|
||||||
import styled from "@emotion/styled";
|
import styled from "@emotion/styled";
|
||||||
import * as RXPopover from "@radix-ui/react-popover";
|
import * as RXPopover from "@radix-ui/react-popover";
|
||||||
@@ -35,7 +41,9 @@ from {
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const PopoverContent = styled(RXPopover.Content)<{ theme?: Theme }>`
|
const PopoverContent = /* @__PURE__ */ styled(
|
||||||
|
/* @__PURE__ */ RXPopover.Content,
|
||||||
|
)<{ theme?: Theme }>`
|
||||||
border-radius: ${radius.sm};
|
border-radius: ${radius.sm};
|
||||||
padding: ${spacing.sm} ${spacing.md};
|
padding: ${spacing.sm} ${spacing.md};
|
||||||
background-color: ${(p) => p.theme.bg.inverted};
|
background-color: ${(p) => p.theme.bg.inverted};
|
||||||
@@ -48,7 +56,9 @@ const PopoverContent = styled(RXPopover.Content)<{ theme?: Theme }>`
|
|||||||
font-size: ${fontSize.md};
|
font-size: ${fontSize.md};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const PopoverArrow = styled(RXPopover.Arrow)<{ theme?: Theme }>`
|
const PopoverArrow = /* @__PURE__ */ styled(/* @__PURE__ */ RXPopover.Arrow)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
fill: ${(p) => p.theme.bg.inverted};
|
fill: ${(p) => p.theme.bg.inverted};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const QRCodeContainer = styled.div`
|
|||||||
box-shadow: ${shadow.md};
|
box-shadow: ${shadow.md};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledReactQrCode = styled(ReactQrCode)`
|
const StyledReactQrCode = /* @__PURE__ */ styled(ReactQrCode)`
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
border-radius: ${radius.md};
|
border-radius: ${radius.md};
|
||||||
@@ -67,7 +67,7 @@ const StyledReactQrCode = styled(ReactQrCode)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const QRSkeleton = styled(Skeleton)`
|
const QRSkeleton = /* @__PURE__ */ styled(Skeleton)`
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
border-radius: ${radius.md};
|
border-radius: ${radius.md};
|
||||||
|
|||||||
@@ -40,7 +40,11 @@ to {
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TooltipContent = styled(RadixTooltip.Content)<{ theme?: Theme }>`
|
const TooltipContent = /* @__PURE__ */ styled(
|
||||||
|
/* @__PURE__ */ RadixTooltip.Content,
|
||||||
|
)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
background: ${(p) => p.theme.tooltip.bg};
|
background: ${(p) => p.theme.tooltip.bg};
|
||||||
color: ${(p) => p.theme.tooltip.text};
|
color: ${(p) => p.theme.tooltip.text};
|
||||||
border-radius: ${radius.sm};
|
border-radius: ${radius.sm};
|
||||||
@@ -56,6 +60,10 @@ const TooltipContent = styled(RadixTooltip.Content)<{ theme?: Theme }>`
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TooltipArrow = styled(RadixTooltip.Arrow)<{ theme?: Theme }>`
|
const TooltipArrow = /* @__PURE__ */ styled(
|
||||||
|
/* @__PURE__ */ RadixTooltip.Arrow,
|
||||||
|
)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
fill: ${(p) => p.theme.tooltip.bg};
|
fill: ${(p) => p.theme.tooltip.bg};
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import styled from "@emotion/styled";
|
|||||||
import { Title } from "@radix-ui/react-dialog";
|
import { Title } from "@radix-ui/react-dialog";
|
||||||
import { ChevronLeftIcon } from "@radix-ui/react-icons";
|
import { ChevronLeftIcon } from "@radix-ui/react-icons";
|
||||||
|
|
||||||
export const ModalTitle = styled(Title)<{
|
export const ModalTitle = /* @__PURE__ */ styled(Title)<{
|
||||||
theme?: Theme;
|
theme?: Theme;
|
||||||
centerOnMobile?: boolean;
|
centerOnMobile?: boolean;
|
||||||
}>`
|
}>`
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import React, {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import type { MediaRendererProps } from "./types";
|
import type { MediaRendererProps } from "./types";
|
||||||
|
|
||||||
const ModelViewer = lazy(() => import("./ModelViewer"));
|
const ModelViewer = /* @__PURE__ */ lazy(() => import("./ModelViewer"));
|
||||||
|
|
||||||
interface PlayButtonProps {
|
interface PlayButtonProps {
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
@@ -76,7 +76,10 @@ const PlayButton: React.FC<PlayButtonProps> = ({ onClick, isPlaying }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const VideoPlayer = React.forwardRef<HTMLVideoElement, MediaRendererProps>(
|
const VideoPlayer = /* @__PURE__ */ React.forwardRef<
|
||||||
|
HTMLVideoElement,
|
||||||
|
MediaRendererProps
|
||||||
|
>(
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
src,
|
src,
|
||||||
@@ -176,186 +179,189 @@ const VideoPlayer = React.forwardRef<HTMLVideoElement, MediaRendererProps>(
|
|||||||
|
|
||||||
VideoPlayer.displayName = "VideoPlayer";
|
VideoPlayer.displayName = "VideoPlayer";
|
||||||
|
|
||||||
const AudioPlayer = React.forwardRef<HTMLAudioElement, MediaRendererProps>(
|
const AudioPlayer = /* @__PURE__ */ React.forwardRef<
|
||||||
({ src, alt, poster, style, height, width, ...restProps }, ref) => {
|
HTMLAudioElement,
|
||||||
const audioRef = useRef<HTMLAudioElement>(null);
|
MediaRendererProps
|
||||||
const [playing, setPlaying] = useState(false);
|
>(({ src, alt, poster, style, height, width, ...restProps }, ref) => {
|
||||||
const [muted, setMuted] = useState(true);
|
const audioRef = useRef<HTMLAudioElement>(null);
|
||||||
|
const [playing, setPlaying] = useState(false);
|
||||||
|
const [muted, setMuted] = useState(true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (audioRef.current) {
|
if (audioRef.current) {
|
||||||
if (playing) {
|
if (playing) {
|
||||||
audioRef.current.play();
|
audioRef.current.play();
|
||||||
} else {
|
} else {
|
||||||
audioRef.current.pause();
|
audioRef.current.pause();
|
||||||
audioRef.current.currentTime = 0;
|
audioRef.current.currentTime = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, [playing]);
|
}
|
||||||
|
}, [playing]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ position: "relative", ...style }} {...restProps}>
|
<div style={{ position: "relative", ...style }} {...restProps}>
|
||||||
{poster ? (
|
{poster ? (
|
||||||
<img
|
<img
|
||||||
height={height}
|
height={height}
|
||||||
width={width}
|
width={width}
|
||||||
src={poster}
|
src={poster}
|
||||||
style={{
|
|
||||||
height: "100%",
|
|
||||||
width: "100%",
|
|
||||||
pointerEvents: "none",
|
|
||||||
objectFit: "contain",
|
|
||||||
}}
|
|
||||||
alt={alt}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
display: "grid",
|
|
||||||
placeItems: "center",
|
|
||||||
pointerEvents: "none",
|
|
||||||
backgroundColor: "#fff",
|
|
||||||
color: "rgb(138, 147, 155)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CarbonDocumentAudio style={{ height: "64px", width: "64px" }} />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<PlayButton
|
|
||||||
onClick={() => {
|
|
||||||
setPlaying((prev) => !prev);
|
|
||||||
setMuted(false);
|
|
||||||
}}
|
|
||||||
isPlaying={playing}
|
|
||||||
/>
|
|
||||||
<audio
|
|
||||||
ref={mergeRefs([audioRef, ref])}
|
|
||||||
src={src ?? undefined}
|
|
||||||
loop
|
|
||||||
playsInline
|
|
||||||
muted={muted}
|
|
||||||
preload="none"
|
|
||||||
controlsList="nodownload"
|
|
||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
|
||||||
opacity: 0,
|
|
||||||
pointerEvents: "none",
|
|
||||||
zIndex: -1,
|
|
||||||
visibility: "hidden",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
AudioPlayer.displayName = "AudioPlayer";
|
|
||||||
|
|
||||||
const IframePlayer = React.forwardRef<HTMLIFrameElement, MediaRendererProps>(
|
|
||||||
({ src, alt, poster, requireInteraction, style, ...restProps }, ref) => {
|
|
||||||
const [playing, setPlaying] = useState(!requireInteraction);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div style={{ position: "relative", ...style }} {...restProps}>
|
|
||||||
<iframe
|
|
||||||
src={playing ? src ?? undefined : undefined}
|
|
||||||
ref={ref}
|
|
||||||
style={{
|
|
||||||
objectFit: "contain",
|
|
||||||
zIndex: 1,
|
|
||||||
height: "100%",
|
height: "100%",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
transition: "opacity .5s",
|
pointerEvents: "none",
|
||||||
opacity: !poster ? 1 : playing ? 1 : 0,
|
objectFit: "contain",
|
||||||
}}
|
}}
|
||||||
sandbox="allow-scripts"
|
alt={alt}
|
||||||
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
||||||
/>
|
/>
|
||||||
{poster && (
|
) : (
|
||||||
<img
|
|
||||||
src={poster}
|
|
||||||
style={{
|
|
||||||
objectFit: "contain",
|
|
||||||
pointerEvents: "none",
|
|
||||||
position: "absolute",
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
zIndex: 2,
|
|
||||||
transition: "opacity .5s",
|
|
||||||
opacity: playing ? 0 : 1,
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
}}
|
|
||||||
alt={alt}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<PlayButton
|
|
||||||
onClick={() => {
|
|
||||||
setPlaying((prev) => !prev);
|
|
||||||
}}
|
|
||||||
isPlaying={playing}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
IframePlayer.displayName = "IframePlayer";
|
|
||||||
|
|
||||||
const LinkPlayer = React.forwardRef<HTMLAnchorElement, MediaRendererProps>(
|
|
||||||
({ src, alt, style, ...restProps }, ref) => {
|
|
||||||
return (
|
|
||||||
<div style={{ position: "relative", ...style }} {...restProps}>
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
display: "grid",
|
display: "grid",
|
||||||
placeItems: "center",
|
placeItems: "center",
|
||||||
|
pointerEvents: "none",
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
color: "rgb(138, 147, 155)",
|
color: "rgb(138, 147, 155)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<CarbonDocumentAudio style={{ height: "64px", width: "64px" }} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<PlayButton
|
||||||
|
onClick={() => {
|
||||||
|
setPlaying((prev) => !prev);
|
||||||
|
setMuted(false);
|
||||||
|
}}
|
||||||
|
isPlaying={playing}
|
||||||
|
/>
|
||||||
|
<audio
|
||||||
|
ref={mergeRefs([audioRef, ref])}
|
||||||
|
src={src ?? undefined}
|
||||||
|
loop
|
||||||
|
playsInline
|
||||||
|
muted={muted}
|
||||||
|
preload="none"
|
||||||
|
controlsList="nodownload"
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
opacity: 0,
|
||||||
|
pointerEvents: "none",
|
||||||
|
zIndex: -1,
|
||||||
|
visibility: "hidden",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
AudioPlayer.displayName = "AudioPlayer";
|
||||||
|
|
||||||
|
const IframePlayer = /* @__PURE__ */ React.forwardRef<
|
||||||
|
HTMLIFrameElement,
|
||||||
|
MediaRendererProps
|
||||||
|
>(({ src, alt, poster, requireInteraction, style, ...restProps }, ref) => {
|
||||||
|
const [playing, setPlaying] = useState(!requireInteraction);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ position: "relative", ...style }} {...restProps}>
|
||||||
|
<iframe
|
||||||
|
src={playing ? src ?? undefined : undefined}
|
||||||
|
ref={ref}
|
||||||
|
style={{
|
||||||
|
objectFit: "contain",
|
||||||
|
zIndex: 1,
|
||||||
|
height: "100%",
|
||||||
|
width: "100%",
|
||||||
|
transition: "opacity .5s",
|
||||||
|
opacity: !poster ? 1 : playing ? 1 : 0,
|
||||||
|
}}
|
||||||
|
sandbox="allow-scripts"
|
||||||
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
||||||
|
/>
|
||||||
|
{poster && (
|
||||||
|
<img
|
||||||
|
src={poster}
|
||||||
|
style={{
|
||||||
|
objectFit: "contain",
|
||||||
|
pointerEvents: "none",
|
||||||
|
position: "absolute",
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
zIndex: 2,
|
||||||
|
transition: "opacity .5s",
|
||||||
|
opacity: playing ? 0 : 1,
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
}}
|
||||||
|
alt={alt}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<PlayButton
|
||||||
|
onClick={() => {
|
||||||
|
setPlaying((prev) => !prev);
|
||||||
|
}}
|
||||||
|
isPlaying={playing}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
IframePlayer.displayName = "IframePlayer";
|
||||||
|
|
||||||
|
const LinkPlayer = /* @__PURE__ */ React.forwardRef<
|
||||||
|
HTMLAnchorElement,
|
||||||
|
MediaRendererProps
|
||||||
|
>(({ src, alt, style, ...restProps }, ref) => {
|
||||||
|
return (
|
||||||
|
<div style={{ position: "relative", ...style }} {...restProps}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
display: "grid",
|
||||||
|
placeItems: "center",
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
color: "rgb(138, 147, 155)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: "8px",
|
||||||
|
alignItems: "center",
|
||||||
|
flexWrap: "nowrap",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CarbonDocumentUnknown
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
maxWidth: "128px",
|
||||||
flexDirection: "column",
|
minWidth: "48px",
|
||||||
gap: "8px",
|
width: "50%",
|
||||||
alignItems: "center",
|
aspectRatio: "1",
|
||||||
flexWrap: "nowrap",
|
|
||||||
}}
|
}}
|
||||||
|
/>
|
||||||
|
<a
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
style={{
|
||||||
|
textDecoration: "underline",
|
||||||
|
color: "rgb(138, 147, 155)",
|
||||||
|
}}
|
||||||
|
href={src ?? undefined}
|
||||||
|
target="_blank"
|
||||||
|
ref={ref as unknown as React.LegacyRef<HTMLAnchorElement>}
|
||||||
>
|
>
|
||||||
<CarbonDocumentUnknown
|
{alt || "File"}
|
||||||
style={{
|
</a>
|
||||||
maxWidth: "128px",
|
|
||||||
minWidth: "48px",
|
|
||||||
width: "50%",
|
|
||||||
aspectRatio: "1",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<a
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
style={{
|
|
||||||
textDecoration: "underline",
|
|
||||||
color: "rgb(138, 147, 155)",
|
|
||||||
}}
|
|
||||||
href={src ?? undefined}
|
|
||||||
target="_blank"
|
|
||||||
ref={ref as unknown as React.LegacyRef<HTMLAnchorElement>}
|
|
||||||
>
|
|
||||||
{alt || "File"}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
</div>
|
||||||
},
|
);
|
||||||
);
|
});
|
||||||
|
|
||||||
LinkPlayer.displayName = "LinkPlayer";
|
LinkPlayer.displayName = "LinkPlayer";
|
||||||
|
|
||||||
@@ -380,7 +386,7 @@ LinkPlayer.displayName = "LinkPlayer";
|
|||||||
*
|
*
|
||||||
* You can try switching out the `src` prop to different types of URLs and media types to explore the possibilities.
|
* You can try switching out the `src` prop to different types of URLs and media types to explore the possibilities.
|
||||||
*/
|
*/
|
||||||
export const MediaRenderer = React.forwardRef<
|
export const MediaRenderer = /* @__PURE__ */ React.forwardRef<
|
||||||
HTMLMediaElement,
|
HTMLMediaElement,
|
||||||
MediaRendererProps
|
MediaRendererProps
|
||||||
>(
|
>(
|
||||||
|
|||||||
@@ -11,23 +11,24 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ModelViewer = React.forwardRef<HTMLDivElement, MediaRendererProps>(
|
export const ModelViewer = /* @__PURE__ */ React.forwardRef<
|
||||||
({ src, alt, poster, style }, ref) => {
|
HTMLDivElement,
|
||||||
return (
|
MediaRendererProps
|
||||||
<div style={{ ...style }} ref={ref}>
|
>(({ src, alt, poster, style }, ref) => {
|
||||||
{src ? (
|
return (
|
||||||
<model-viewer
|
<div style={{ ...style }} ref={ref}>
|
||||||
src={src}
|
{src ? (
|
||||||
alt={alt || "3D Model"}
|
<model-viewer
|
||||||
camera-controls
|
src={src}
|
||||||
poster={poster ? poster : null}
|
alt={alt || "3D Model"}
|
||||||
style={{ width: "100%", height: "100%" } as CSSStyleDeclaration}
|
camera-controls
|
||||||
/>
|
poster={poster ? poster : null}
|
||||||
) : null}
|
style={{ width: "100%", height: "100%" } as CSSStyleDeclaration}
|
||||||
</div>
|
/>
|
||||||
);
|
) : null}
|
||||||
},
|
</div>
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|
||||||
ModelViewer.displayName = "ModelViewer";
|
ModelViewer.displayName = "ModelViewer";
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export interface ThirdwebNftMediaProps extends SharedMediaProps {
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const ThirdwebNftMedia = React.forwardRef<
|
export const ThirdwebNftMedia = /* @__PURE__ */ React.forwardRef<
|
||||||
HTMLMediaElement,
|
HTMLMediaElement,
|
||||||
ThirdwebNftMediaProps
|
ThirdwebNftMediaProps
|
||||||
>(({ metadata, width = "300px", height = "300px", style, ...props }, ref) => {
|
>(({ metadata, width = "300px", height = "300px", style, ...props }, ref) => {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
// eslint-disable-next-line turbo/no-undeclared-env-vars, better-tree-shaking/no-top-level-side-effects
|
||||||
export const __DEV__ = process.env.NODE_ENV !== "production";
|
export const __DEV__ = process.env.NODE_ENV !== "production";
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ function useForceUpdate() {
|
|||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
const useIsomorphicLayoutEffect = canUseDOM() ? useLayoutEffect : useEffect;
|
const useIsomorphicLayoutEffect = /* @__PURE__ */ canUseDOM()
|
||||||
|
? useLayoutEffect
|
||||||
|
: useEffect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Portal from `@reach/portal`
|
* Portal from `@reach/portal`
|
||||||
|
|||||||
@@ -8,16 +8,18 @@ type ModalConfig = {
|
|||||||
data: any;
|
data: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
const WalletModalOpen = createContext(false);
|
const WalletModalOpen = /* @__PURE__ */ createContext(false);
|
||||||
const SetWalletModalOpen = createContext<BoolSetter | undefined>(undefined);
|
const SetWalletModalOpen = /* @__PURE__ */ createContext<
|
||||||
|
BoolSetter | undefined
|
||||||
|
>(undefined);
|
||||||
|
|
||||||
export const ModalConfigCtx = createContext<ModalConfig>({
|
export const ModalConfigCtx = /* @__PURE__ */ createContext<ModalConfig>({
|
||||||
title: "",
|
title: "",
|
||||||
theme: "dark",
|
theme: "dark",
|
||||||
data: undefined,
|
data: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const SetModalConfigCtx = createContext<
|
export const SetModalConfigCtx = /* @__PURE__ */ createContext<
|
||||||
React.Dispatch<React.SetStateAction<ModalConfig>>
|
React.Dispatch<React.SetStateAction<ModalConfig>>
|
||||||
>(() => {});
|
>(() => {});
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ export const ConnectWallet: React.FC<ConnectWalletProps> = (props) => {
|
|||||||
});
|
});
|
||||||
setIsWalletModalOpen(true);
|
setIsWalletModalOpen(true);
|
||||||
}}
|
}}
|
||||||
data-test="connect-wallet-button"
|
data-test="connect-wallet-button"
|
||||||
>
|
>
|
||||||
{isLoading ? <Spinner size="sm" color="inverted" /> : btnTitle}
|
{isLoading ? <Spinner size="sm" color="inverted" /> : btnTitle}
|
||||||
</AnimatedButton>
|
</AnimatedButton>
|
||||||
@@ -175,6 +175,6 @@ export const ConnectWallet: React.FC<ConnectWalletProps> = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const AnimatedButton = styled(Button)`
|
const AnimatedButton = /* @__PURE__ */ styled(Button)`
|
||||||
animation: ${fadeInAnimation} 300ms ease;
|
animation: ${fadeInAnimation} 300ms ease;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export const ConnectedWalletDetails: React.FC<{
|
|||||||
className={`${TW_CONNECTED_WALLET} ${props.className || ""}`}
|
className={`${TW_CONNECTED_WALLET} ${props.className || ""}`}
|
||||||
data-theme={props.theme}
|
data-theme={props.theme}
|
||||||
style={props.style}
|
style={props.style}
|
||||||
data-test="connected-wallet-details"
|
data-test="connected-wallet-details"
|
||||||
>
|
>
|
||||||
<ChainIcon
|
<ChainIcon
|
||||||
chain={chain}
|
chain={chain}
|
||||||
@@ -458,7 +458,9 @@ const dropdownContentFade = keyframes`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const DropDownContent = styled(DropdownMenu.Content)<{ theme?: Theme }>`
|
const DropDownContent = /* @__PURE__ */ styled(
|
||||||
|
/* @__PURE__ */ DropdownMenu.Content,
|
||||||
|
)<{ theme?: Theme }>`
|
||||||
width: 360px;
|
width: 360px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -576,19 +578,25 @@ const MenuButton = styled.button<{ theme?: Theme }>`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const MenuLink = MenuButton.withComponent("a");
|
const MenuLink = /* @__PURE__ */ MenuButton.withComponent("a");
|
||||||
|
|
||||||
export const DropdownMenuItem = styled(DropdownMenu.Item)<{ theme?: Theme }>`
|
export const DropdownMenuItem = /* @__PURE__ */ styled(
|
||||||
|
/* @__PURE__ */ DropdownMenu.Item,
|
||||||
|
)<{ theme?: Theme }>`
|
||||||
outline: none;
|
outline: none;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const StyledChevronRightIcon = styled(ChevronRightIcon)<{
|
export const StyledChevronRightIcon = /* @__PURE__ */ styled(
|
||||||
|
/* @__PURE__ */ ChevronRightIcon,
|
||||||
|
)<{
|
||||||
theme?: Theme;
|
theme?: Theme;
|
||||||
}>`
|
}>`
|
||||||
color: ${(props) => props.theme.text.secondary};
|
color: ${(props) => props.theme.text.secondary};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const DisconnectIconButton = styled(IconButton)<{ theme?: Theme }>`
|
const DisconnectIconButton = /* @__PURE__ */ styled(IconButton)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
margin-right: -${spacing.xxs};
|
margin-right: -${spacing.xxs};
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
color: ${(props) => props.theme.icon.secondary};
|
color: ${(props) => props.theme.icon.secondary};
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ const NetworkTab = (props: {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const NetworkList = memo(function NetworkList(props: {
|
const NetworkList = /* @__PURE__ */ memo(function NetworkList(props: {
|
||||||
chains: Chain[];
|
chains: Chain[];
|
||||||
onSwitch: (chain: Chain) => void;
|
onSwitch: (chain: Chain) => void;
|
||||||
renderChain?: RenderChain;
|
renderChain?: RenderChain;
|
||||||
@@ -503,7 +503,9 @@ const NetworkList = memo(function NetworkList(props: {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const TabButton = styled(Tabs.Trigger)<{ theme?: Theme }>`
|
const TabButton = /* @__PURE__ */ styled(/* @__PURE__ */ Tabs.Trigger)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
all: unset;
|
all: unset;
|
||||||
font-size: ${fontSize.md};
|
font-size: ${fontSize.md};
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -575,7 +577,7 @@ const NetworkButton = styled.button<{ theme?: Theme }>`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledMagnifyingGlassIcon = styled(MagnifyingGlassIcon)<{
|
const StyledMagnifyingGlassIcon = /* @__PURE__ */ styled(MagnifyingGlassIcon)<{
|
||||||
theme?: Theme;
|
theme?: Theme;
|
||||||
}>`
|
}>`
|
||||||
color: ${(p) => p.theme.text.secondary};
|
color: ${(p) => p.theme.text.secondary};
|
||||||
@@ -583,7 +585,7 @@ const StyledMagnifyingGlassIcon = styled(MagnifyingGlassIcon)<{
|
|||||||
left: 18px;
|
left: 18px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const SearchInput = styled(Input)<{ theme?: Theme }>`
|
const SearchInput = /* @__PURE__ */ styled(Input)<{ theme?: Theme }>`
|
||||||
padding: ${spacing.sm} ${spacing.md} ${spacing.sm} 60px;
|
padding: ${spacing.sm} ${spacing.md} ${spacing.sm} 60px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const TitleContainer = styled.div`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Desc = styled(ModalDescription)`
|
const Desc = /* @__PURE__ */ styled(ModalDescription)`
|
||||||
${media.mobile} {
|
${media.mobile} {
|
||||||
max-width: 240px;
|
max-width: 240px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const IconContainer = styled.div`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Desc = styled(ModalDescription)`
|
const Desc = /* @__PURE__ */ styled(ModalDescription)`
|
||||||
${media.mobile} {
|
${media.mobile} {
|
||||||
padding: 0 ${spacing.lg};
|
padding: 0 ${spacing.lg};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,9 @@ export function InputSelectionUI(props: {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const CircleInputButton = styled(InputButton)<{ theme?: Theme }>`
|
const CircleInputButton = /* @__PURE__ */ styled(InputButton)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
background: ${(p) => p.theme.bg.highlighted};
|
background: ${(p) => p.theme.bg.highlighted};
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
padding: ${spacing.xxs};
|
padding: ${spacing.xxs};
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { coinbaseWallet } from "./coinbase/coinbaseWallet";
|
|||||||
import { metamaskWallet } from "./metamask/metamaskWallet";
|
import { metamaskWallet } from "./metamask/metamaskWallet";
|
||||||
import { walletConnectV1 } from "./walletConnectV1";
|
import { walletConnectV1 } from "./walletConnectV1";
|
||||||
|
|
||||||
export const defaultWallets: WalletConfig<any>[] = [
|
export const defaultWallets: WalletConfig<any>[] = /* @__PURE__ */ (() => [
|
||||||
metamaskWallet(),
|
metamaskWallet(),
|
||||||
coinbaseWallet(),
|
coinbaseWallet(),
|
||||||
walletConnectV1(),
|
walletConnectV1(),
|
||||||
];
|
])();
|
||||||
|
|||||||
@@ -14,21 +14,24 @@ import { InputSelectionUI } from "../InputSelectionUI";
|
|||||||
export function magicLink(
|
export function magicLink(
|
||||||
config: MagicLinkAdditionalOptions,
|
config: MagicLinkAdditionalOptions,
|
||||||
): ConfiguredMagicLinkWallet {
|
): ConfiguredMagicLinkWallet {
|
||||||
|
const selectUI = (props: SelectUIProps<MagicLink>) => (
|
||||||
|
<MagicSelectionUI
|
||||||
|
{...props}
|
||||||
|
emailLogin={config.emailLogin !== false}
|
||||||
|
smsLogin={config.smsLogin !== false}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: MagicLink.id,
|
id: MagicLink.id,
|
||||||
meta: MagicLink.meta,
|
meta: MagicLink.meta,
|
||||||
create: (options: WalletOptions) =>
|
create: (options: WalletOptions) =>
|
||||||
new MagicLink({ ...options, ...config }),
|
new MagicLink({ ...options, ...config }),
|
||||||
connectUI: MagicConnectionUI,
|
connectUI(props) {
|
||||||
selectUI(props) {
|
return <MagicConnectionUI {...props} type={config.type || "auth"} />;
|
||||||
return (
|
|
||||||
<MagicSelectionUI
|
|
||||||
{...props}
|
|
||||||
emailLogin={config.emailLogin !== false}
|
|
||||||
smsLogin={config.smsLogin !== false}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
// select UI only for auth
|
||||||
|
selectUI: config.type === "connect" ? undefined : selectUI,
|
||||||
isInstalled() {
|
isInstalled() {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
@@ -101,13 +104,9 @@ const MagicSelectionUI: React.FC<
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const MagicConnectionUI: React.FC<ConnectUIProps<MagicLink>> = ({
|
const MagicConnectionUI: React.FC<
|
||||||
close,
|
ConnectUIProps<MagicLink> & { type: "auth" | "connect" }
|
||||||
walletConfig,
|
> = ({ close, walletConfig, open, selectionData, supportedWallets, type }) => {
|
||||||
open,
|
|
||||||
selectionData,
|
|
||||||
supportedWallets,
|
|
||||||
}) => {
|
|
||||||
const connectPrompted = useRef(false);
|
const connectPrompted = useRef(false);
|
||||||
const singleWallet = supportedWallets.length === 1;
|
const singleWallet = supportedWallets.length === 1;
|
||||||
const connect = useConnect();
|
const connect = useConnect();
|
||||||
@@ -117,14 +116,20 @@ const MagicConnectionUI: React.FC<ConnectUIProps<MagicLink>> = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
connectPrompted.current = true;
|
connectPrompted.current = true;
|
||||||
const isEmail = (selectionData as string).includes("@");
|
const isEmail = selectionData
|
||||||
|
? (selectionData as string).includes("@")
|
||||||
|
: false;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
close();
|
close();
|
||||||
try {
|
try {
|
||||||
await connect(
|
await connect(
|
||||||
walletConfig,
|
walletConfig,
|
||||||
isEmail ? { email: selectionData } : { phoneNumber: selectionData },
|
type === "connect"
|
||||||
|
? {}
|
||||||
|
: isEmail
|
||||||
|
? { email: selectionData }
|
||||||
|
: { phoneNumber: selectionData },
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!singleWallet) {
|
if (!singleWallet) {
|
||||||
@@ -133,7 +138,7 @@ const MagicConnectionUI: React.FC<ConnectUIProps<MagicLink>> = ({
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}, [connect, selectionData, walletConfig, close, open, singleWallet]);
|
}, [connect, selectionData, walletConfig, close, open, singleWallet, type]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
|
|||||||
@@ -395,6 +395,8 @@ const NetworkSelect = styled.select<{ theme?: Theme }>`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledChevronDownIcon = styled(ChevronDownIcon)<{ theme?: Theme }>`
|
const StyledChevronDownIcon = /* @__PURE__ */ styled(ChevronDownIcon)<{
|
||||||
|
theme?: Theme;
|
||||||
|
}>`
|
||||||
color: ${(p) => p.theme.icon.secondary};
|
color: ${(p) => p.theme.icon.secondary};
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -1,6 +1,23 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: ["thirdweb"],
|
extends: ["thirdweb"],
|
||||||
|
plugins: ["better-tree-shaking"],
|
||||||
|
rules: {
|
||||||
|
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||||
|
"no-restricted-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
paths: [
|
||||||
|
{
|
||||||
|
name: "ethers",
|
||||||
|
importNames: ["ethers"],
|
||||||
|
message:
|
||||||
|
"Do not import entire ethers object, Use named imports instead.",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
// allow all imports from within tests
|
// allow all imports from within tests
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,52 @@
|
|||||||
# @thirdweb-dev/sdk
|
# @thirdweb-dev/sdk
|
||||||
|
|
||||||
|
## 3.10.24
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1222](https://github.com/thirdweb-dev/js/pull/1222) [`48065bcd`](https://github.com/thirdweb-dev/js/commit/48065bcd91c13e1f44d54343b5c6c2646b9e86e4) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Accept string for image/animation_url on shared metadata
|
||||||
|
|
||||||
|
- [#1223](https://github.com/thirdweb-dev/js/pull/1223) [`6aa6f7e0`](https://github.com/thirdweb-dev/js/commit/6aa6f7e0bd2313e2e1ad96dd41aad91e6694d380) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - fix maxId in getAll for Open Edition contracts
|
||||||
|
|
||||||
|
- [#1224](https://github.com/thirdweb-dev/js/pull/1224) [`f7f4f207`](https://github.com/thirdweb-dev/js/commit/f7f4f20737ac5d78424ca9c91220f00b85adde6b) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Better return type for get shared metadata
|
||||||
|
|
||||||
|
- [#1218](https://github.com/thirdweb-dev/js/pull/1218) [`d4d95507`](https://github.com/thirdweb-dev/js/commit/d4d95507130b2b5408bfaa73ef3b708ca00c773e) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Add get for shared metadata
|
||||||
|
|
||||||
|
- [#1225](https://github.com/thirdweb-dev/js/pull/1225) [`483e2b91`](https://github.com/thirdweb-dev/js/commit/483e2b910934d75276a68bae64d04c47cd7d57e3) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Fix namespace for platform fees
|
||||||
|
|
||||||
|
- [#1216](https://github.com/thirdweb-dev/js/pull/1216) [`c08e6ba9`](https://github.com/thirdweb-dev/js/commit/c08e6ba988ad97aa27d5868cec8abe3498d07a0a) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Fix claim counts for Open Edition contracts
|
||||||
|
|
||||||
|
- [#1188](https://github.com/thirdweb-dev/js/pull/1188) [`3d615a62`](https://github.com/thirdweb-dev/js/commit/3d615a62d0a6801f6fb0e63f9b95c2f98446add1) Thanks [@kienngo98](https://github.com/kienngo98)! - Abstract duplicated code; treeshake ethers.js imports
|
||||||
|
|
||||||
|
- Updated dependencies [[`6816219a`](https://github.com/thirdweb-dev/js/commit/6816219ac13ae571a0c90db6ab389c319bc1f052)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.23
|
||||||
|
|
||||||
|
## 3.10.23
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1196](https://github.com/thirdweb-dev/js/pull/1196) [`d9b7360d`](https://github.com/thirdweb-dev/js/commit/d9b7360d1d78abcdaca89aa35e66388cbc5eb26c) Thanks [@MananTank](https://github.com/MananTank)! - refactor erc-721.ts, erc-1155.ts, erc-20.ts
|
||||||
|
|
||||||
|
- [#1208](https://github.com/thirdweb-dev/js/pull/1208) [`8a2d9204`](https://github.com/thirdweb-dev/js/commit/8a2d92046a416c99c6bfecf63a6fdb6cc02ea175) Thanks [@sebas5384](https://github.com/sebas5384)! - Updated gas station URL
|
||||||
|
|
||||||
|
- [#1134](https://github.com/thirdweb-dev/js/pull/1134) [`990c665d`](https://github.com/thirdweb-dev/js/commit/990c665de9e5c1070dc80fe0f1b434e251f70a94) Thanks [@nkrishang](https://github.com/nkrishang)! - Introduce SmartWallet sdk class
|
||||||
|
|
||||||
|
- [#1199](https://github.com/thirdweb-dev/js/pull/1199) [`c6f44722`](https://github.com/thirdweb-dev/js/commit/c6f44722f9d123db4e7c4c799fe8e0374a02107c) Thanks [@MananTank](https://github.com/MananTank)! - Add eslint-plugin-better-tree-shaking for improved tree-shaking
|
||||||
|
|
||||||
|
- [#1191](https://github.com/thirdweb-dev/js/pull/1191) [`45ae105e`](https://github.com/thirdweb-dev/js/commit/45ae105ed3e48bfbf6be84aa12ecb0fb55a917b7) Thanks [@kumaryash90](https://github.com/kumaryash90)! - OZ minimal forwarder addresses for zksync testnet and mainnet
|
||||||
|
|
||||||
|
- [#1198](https://github.com/thirdweb-dev/js/pull/1198) [`bb7ca20e`](https://github.com/thirdweb-dev/js/commit/bb7ca20e49c5c374b12a4ed746a2ac3db488abd9) Thanks [@MananTank](https://github.com/MananTank)! - Better PURE annotations for tree shaking
|
||||||
|
|
||||||
|
- [#1193](https://github.com/thirdweb-dev/js/pull/1193) [`23d61cfe`](https://github.com/thirdweb-dev/js/commit/23d61cfeff2e5a885c511416d7491e7933ed404a) Thanks [@jnsdls](https://github.com/jnsdls)! - add shared metadata extension (open edition)
|
||||||
|
|
||||||
|
- [#1189](https://github.com/thirdweb-dev/js/pull/1189) [`8941b226`](https://github.com/thirdweb-dev/js/commit/8941b22682d1b15a6e0d311b1e8548b95d6cfadf) Thanks [@MananTank](https://github.com/MananTank)! - Add PURE annotations to improve tree-shaking
|
||||||
|
|
||||||
|
- [#1197](https://github.com/thirdweb-dev/js/pull/1197) [`e0ce4a37`](https://github.com/thirdweb-dev/js/commit/e0ce4a37596a91a072f8551e323fce6723113dcb) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - contract.erc721.claim(quantity) now supports Zora contracts
|
||||||
|
|
||||||
|
- Updated dependencies [[`e0ce4a37`](https://github.com/thirdweb-dev/js/commit/e0ce4a37596a91a072f8551e323fce6723113dcb), [`990c665d`](https://github.com/thirdweb-dev/js/commit/990c665de9e5c1070dc80fe0f1b434e251f70a94), [`f41f1a29`](https://github.com/thirdweb-dev/js/commit/f41f1a2958a2cedcf0496c9a3ca284d0b98f1b89)]:
|
||||||
|
- @thirdweb-dev/contracts-js@1.3.6
|
||||||
|
- @thirdweb-dev/chains@0.1.22
|
||||||
|
|
||||||
## 3.10.22
|
## 3.10.22
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/sdk",
|
"name": "@thirdweb-dev/sdk",
|
||||||
"version": "3.10.22",
|
"version": "3.10.24",
|
||||||
"description": "The main thirdweb SDK.",
|
"description": "The main thirdweb SDK.",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -127,6 +127,7 @@
|
|||||||
"eslint": "^8.42.0",
|
"eslint": "^8.42.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-config-thirdweb": "workspace:*",
|
"eslint-config-thirdweb": "workspace:*",
|
||||||
|
"eslint-plugin-better-tree-shaking": "0.0.3",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
|||||||
@@ -5,15 +5,16 @@ import { z } from "zod";
|
|||||||
*/
|
*/
|
||||||
export const DEFAULT_QUERY_ALL_COUNT = 100;
|
export const DEFAULT_QUERY_ALL_COUNT = 100;
|
||||||
|
|
||||||
export const QueryAllParamsSchema = z
|
export const QueryAllParamsSchema = /* @__PURE__ */ (() =>
|
||||||
.object({
|
z
|
||||||
start: z.number().default(0),
|
.object({
|
||||||
count: z.number().default(DEFAULT_QUERY_ALL_COUNT),
|
start: z.number().default(0),
|
||||||
})
|
count: z.number().default(DEFAULT_QUERY_ALL_COUNT),
|
||||||
.default({
|
})
|
||||||
start: 0,
|
.default({
|
||||||
count: DEFAULT_QUERY_ALL_COUNT,
|
start: 0,
|
||||||
});
|
count: DEFAULT_QUERY_ALL_COUNT,
|
||||||
|
}))();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pagination Parameters
|
* Pagination Parameters
|
||||||
|
|||||||
@@ -9,47 +9,63 @@ import { z } from "zod";
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const CommonNFTInput = z
|
export const BasicNFTInput = /* @__PURE__ */ (() =>
|
||||||
.object({
|
z.object({
|
||||||
name: z.union([z.string(), z.number()]).optional().nullable(),
|
name: z.union([z.string(), z.number()]).optional().nullable(),
|
||||||
description: z.string().nullable().optional().nullable(),
|
description: z.string().nullable().optional().nullable(),
|
||||||
image: FileOrBufferOrStringSchema.nullable().optional(),
|
image: FileOrBufferOrStringSchema.nullable().optional(),
|
||||||
external_url: FileOrBufferOrStringSchema.nullable().optional(),
|
|
||||||
animation_url: FileOrBufferOrStringSchema.optional().nullable(),
|
animation_url: FileOrBufferOrStringSchema.optional().nullable(),
|
||||||
|
}))();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
export const CommonNFTInput = /* @__PURE__ */ (() =>
|
||||||
|
BasicNFTInput.extend({
|
||||||
|
external_url: FileOrBufferOrStringSchema.nullable().optional(),
|
||||||
background_color: HexColor.optional().nullable(),
|
background_color: HexColor.optional().nullable(),
|
||||||
properties: OptionalPropertiesInput,
|
properties: OptionalPropertiesInput,
|
||||||
attributes: OptionalPropertiesInput,
|
attributes: OptionalPropertiesInput,
|
||||||
})
|
}).catchall(z.union([BigNumberTransformSchema, z.unknown()])))();
|
||||||
.catchall(z.union([BigNumberTransformSchema, z.unknown()]));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const NFTInputOrUriSchema = z.union([CommonNFTInput, z.string()]);
|
export const NFTInputOrUriSchema = /* @__PURE__ */ (() =>
|
||||||
|
z.union([CommonNFTInput, z.string()]))();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const CommonNFTOutput = CommonNFTInput.extend({
|
export const CommonNFTOutput = /* @__PURE__ */ (() =>
|
||||||
id: z.string(),
|
CommonNFTInput.extend({
|
||||||
uri: z.string(),
|
id: z.string(),
|
||||||
image: z.string().nullable().optional(),
|
uri: z.string(),
|
||||||
external_url: z.string().nullable().optional(),
|
image: z.string().nullable().optional(),
|
||||||
animation_url: z.string().nullable().optional(),
|
external_url: z.string().nullable().optional(),
|
||||||
});
|
animation_url: z.string().nullable().optional(),
|
||||||
|
}))();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export type NFTMetadataInput = z.input<typeof CommonNFTInput>;
|
export type BasicNFTInput = /* @__PURE__ */ z.input<typeof BasicNFTInput>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export type NFTMetadataOrUri = z.input<typeof NFTInputOrUriSchema>;
|
export type NFTMetadataInput = /* @__PURE__ */ z.input<typeof CommonNFTInput>;
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export type NFTMetadata = z.output<typeof CommonNFTOutput>;
|
export type NFTMetadataOrUri = /* @__PURE__ */ z.input<
|
||||||
|
typeof NFTInputOrUriSchema
|
||||||
|
>;
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export type NFTMetadata = /* @__PURE__ */ z.output<typeof CommonNFTOutput>;
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { BigNumberTransformSchema } from "./shared";
|
import { BigNumberTransformSchema } from "./shared";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
const PropertiesInput = z
|
const PropertiesInput = /* @__PURE__ */ (() =>
|
||||||
.object({})
|
z.object({}).catchall(z.union([BigNumberTransformSchema, z.unknown()])))();
|
||||||
.catchall(z.union([BigNumberTransformSchema, z.unknown()]));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const OptionalPropertiesInput = z
|
export const OptionalPropertiesInput = /* @__PURE__ */ (() =>
|
||||||
.union([z.array(PropertiesInput), PropertiesInput])
|
z
|
||||||
.optional()
|
.union([z.array(PropertiesInput), PropertiesInput])
|
||||||
.nullable();
|
.optional()
|
||||||
|
.nullable())();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user