Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
27 KiB
@thirdweb-dev/react-native
0.2.8
Patch Changes
-
#874
49922de9Thanks @iketw! - [RN] Adds Auth to React Native- Adds an optional
secureStorageto authConfig - Adds
expo-secure-storeto store the JWT token securely in React Native, passing a default value - Stores the token in secure storage to be accessed by subsequent calls
- Returns the token in
useLoginto be used by the user
How I tested:
- Tested in Android/iOS/Web
Usage:
<ThirdwebProvider activeChain="ethereum" supportedWallets={[metamaskWallet(), rainbowWallet()]} authConfig={{ domain: https://your-domain.com, authUrl: '/api/auth', }}> <AppInner /> </ThirdwebProvider>const { login } = useLogin(); const { logout } = useLogout(); const { user, isLoggedIn } = useUser(); ... const token = await login(); - Adds an optional
-
#886
51e6b414Thanks @iketw! - [ReactNative] Fixes Coinbase wallet on iOS- Adds connect wallet hooks for the supported wallets:
- useMetaMaskWallet
- useCoinbaseWallet
- useRainbowWallet
- useTrustWallet
Usage:
const connect = useMetaMaskWallet(); connect(); -
#916
0b1f5229Thanks @iketw! - [ReactNative] Improve customization of buttons background and text colorsYou can now pass custom background and text colors without having to create the full theme object. Alternatively, you can complete customize the theme:
import { ConnectWallet, darkTheme } from '@thirdweb-dev/react-native'; <ConnectWallet theme={darkTheme({ buttonBackgroundColor: '#new-color', buttonTextColor: '#another-color' })} />import { Web3Button, lightTheme } from '@thirdweb-dev/react-native'; <Web3Button theme={lightTheme({ buttonBackgroundColor: '#new-color', buttonTextColor: '#another-color' })} />Customizing theme beyond the button:
import { ConnectWallet, darkTheme } from '@thirdweb-dev/react-native'; const darkThemeCustom = darkTheme(); <ConnectWallet theme={{ ...darkThemeCustom, colors: { ...darkThemeCustom.colors, backgroundHighlight: 'blue', }, }} /> -
Updated dependencies [
abe88599,49922de9,4acb2b55,82bea3fa,ea04edf4,77224646,c9ee9b32,00f4355f,a6610f12,06cc1df3,29146e00,77224646,430a5f79,664d1cd0,bfdd8493,c2fec930,477324ec]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected].8
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.2.7
Patch Changes
- Updated dependencies [
ac8fa0b3,b616dca7,2545a440,b75bcef5,229a4741,c9027fce,0db0cc75]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected].7
0.2.6
Patch Changes
0.2.5
Patch Changes
- Updated dependencies [
1547d76c,235eb046,b5648aee,1b8f812f,235eb046]:- @thirdweb-dev/[email protected].8
- @thirdweb-dev/[email protected].5
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.2.4
Patch Changes
- Updated dependencies [
c5c2d947,2dd192a5]:- @thirdweb-dev/[email protected].4
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected].7
0.2.3
Patch Changes
- Updated dependencies [
1137a20d,1137a20d]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected].3
- @thirdweb-dev/[email protected].7
- @thirdweb-dev/[email protected]
0.2.2
Patch Changes
- Updated dependencies [
b7fcae6e,b7fcae6e,1f2df55b,839fce1f,839fce1f,839fce1f]:- @thirdweb-dev/[email protected].2
- @thirdweb-dev/[email protected].6
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.2.1
Patch Changes
- Updated dependencies [
e2581f21,9b303829]:- @thirdweb-dev/[email protected].1
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected].5
- @thirdweb-dev/[email protected]
0.2.0
Minor Changes
-
#584
d01b135dThanks @MananTank! - [Wallets, RN, React, ReactCore] New Wallets SDK implementationBreaking changes:
React and React Native
- Replaced
walletConnectorswithsupportedWalletsin the ThirdwebProvider.
import { coinbaseWallet, metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react"; const App = () => { - return <ThirdwebProvider walletConnectors={["metamask", "coinbaseWallet"]}>{...}</ThirdwebProvider> + return <ThirdwebProvider supportedWallets={[metamaskWallet(), coinbaseWallet()]}>{...}</ThirdwebProvider> }-
magicLinkConnectornot yet implemented in this version -
Removed
desiredChainId, useactiveChaininstead -
DAppMetaDatatype now requires theurlfield to be passed in -
Removed
chainRpcprop from the ThirdwebProvider. You can pass custom rpcs in the Chain object through theactiveChainandsupportedChainsprops. -
Replaced the
useNetworkhook foruseChainanduseSwitchChain -
Updated
ConnectWalletbutton in React:
- Removed
accentColorandcolorMode - Added a
themeprop withdarkandlightvalues
- Updated the
Web3Buttonbutton in React:
- Removed
accentColorandcolorMode - Added a
themeprop withdarkandlightvalues
Patch Changes
- You can now pass a
themeprop to the ThirdwebProvider. Values arelightanddark
import { ThirdwebProvider } from "@thirdweb-dev/react"; const App = () => { return <ThirdwebProvider theme='light'>{...}</ThirdwebProvider> }-
New wallet hooks added
- useWallet()
- useConenct()
- useConnectionStatus()
- useSwitchChain()
-
Removed
wagmidependency from thereact-native-compatpackage and updated shims -
New
ConnectWalletandWeb3Buttoncomponents in React Native -
New wallets package with support for the most common wallets. MetaMask, Coinbase, WalletConnect V1 and V2 and PaperWallet
-
Added
autoSwitchprop to the ThirdwebProvider to control whether or not to automatically switch to wallet's network to active chain
import { ThirdwebProvider } from "@thirdweb-dev/react"; const App = () => { return <ThirdwebProvider autoSwitch>{...}</ThirdwebProvider> } - Replaced
-
#584
d01b135dThanks @MananTank! - [Wallets] New and updated wallets. [RN] UI Components and Wallets support.
Patch Changes
-
#757
9ea43969Thanks @iketw! - switch tothirdwebcdn.comfor default IPFS gateway -
#813
b97cf2e5Thanks @iketw! - [ReactNative] Fix react-native-modal ios flicker -
#825
4bdeefe6Thanks @iketw! - [Core,React,RN,Wallets] Allow for wallets to be created without props where possibleYou can now create wallets without having to worry about it's params. We provide sensible defaults.
const w = new WalletConnectV1(); w.connect(); const w1 = new WalletConnect(); w1.connect(); const cb = new CoinbaseWallet() w1.connect(); const safe = new SafeWallet(); const device = new DeviceBrowserWallet(); -
#771
e3161e59Thanks @iketw! - [ReactNativeSDK] Use wallet metadata from the wallet class -
#800
d6ae520aThanks @iketw! - [ReactCore/RN] Fix useActiveChain hook -
#735
ba9f593bThanks @jnsdls! -New Hooks
useWatchTransactions()- watch for transactions on the blockchain (real-time)
Example: Listen to all transactions on USD Coin (USDC) contract address.
import { useWatchTransactions } from "@thirdweb-dev/react"; const MyComponent = () => { const transactions = useWatchTransactions({ network: "ethereum", contractAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", }); if (!transactions.length) { return <div>No transactions, yet.</div>; } return ( <div> {transactions.map((transaction) => ( <div key={transaction.hash}> <div>Hash: {transaction.hash}</div> <div>From: {transaction.from}</div> <div>To: {transaction.to}</div> <div>Value: {transaction.value}</div> </div> ))} </div> ); };Note
This hook is available in
@thirdweb-dev/react,@thirdweb-dev/react-nativeand@thirdweb-dev/react-corepackages, the usage is the same. (The only difference is the import path.) -
#807
79768d4cThanks @iketw! - [ReactNative] Updated code comments for supportedWallets -
Updated dependencies [
d01b135d,6e9b9dba,93eca1de,a6fce0f6,9ea43969,3ff8eecf,2ec28021,4bdeefe6,805896c7,b56511e2,8ef5a6f2,4cbbad98,e3161e59,d6ae520a,5f0493d0,71532e5a,33d1cc7f,de7b6196,6b145d4b,83e99dbf,1baed0b1,52d37f01,485abd06,95bcfa6d,682f1c67,4d07b4b4,4d5fdda9,d8c1c943,08507611,e2ec70c4,ba9f593b,6b31a9bc,04775954,4b77bc9b,d01b135d,1baed0b1,8463a176,e47ceafe,4d5fdda9,6c0c6538,208d97e6,ddc1c33a,49eceaa0,5c7c0923,ba9f593b,2221f97d,9fa628f8,5c7c0923,abf609a4,9a4a542c,b2d0ffb0,bd40bc2e]:- @thirdweb-dev/[email protected].0
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected].4
- @thirdweb-dev/[email protected]
0.1.9
Patch Changes
- Updated dependencies [
713d3187]:
0.1.8
Patch Changes
0.1.7
Patch Changes
0.1.6
Patch Changes
-
#665
6ef52dc9Thanks @shift4id! - Fix spelling throughout all packages -
Updated dependencies [
a7e908b5,61ef6964,2f4cd928,6ae39277,8a8a37f6,8f46a2ee,8d5b418e,63f552d7,fb346ffd,e081075b,7832041c,d8dec9fc,478780f6,b83ea525,541dfeea,6ef52dc9,0c883044,85250cf7,2676fc01,0666f37c,85250cf7,e33bd2a8,b80024c6,8845bf96,2335f000,696c384a,4355518a,3740a0bf,cc7ce8b1,91f5a2fd,23cd88ec,87a101ad,537785fe,29c1cf7e,b6b0855b,2a8cc289,1e1a3912,dc08aa73,bd6be0ba]:- @thirdweb-dev/[email protected].0
- @thirdweb-dev/[email protected].0
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.1.5
Patch Changes
- Updated dependencies [
d7deaa4,b7a5b45]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.1.4
Patch Changes
- Updated dependencies [
a3472a1,5712650,5712650]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.1.3
Patch Changes
- Updated dependencies [
3d644fb]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.1.2
Patch Changes
-
Updated dependencies [
f3408d0,66cf1fb]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
0.1.1
Patch Changes
- Updated dependencies [
f0de81d,300fe4a,f580b8a]:- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]
- @thirdweb-dev/[email protected]