From da35951a07da42690dbbc879beffa28d57c280d7 Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Wed, 30 Aug 2023 10:50:20 -0400 Subject: [PATCH 01/18] squares and new to wallets --- .../src/evm/assets/thirdweb-logo.tsx | 35 ++++++ .../ChooseWallet/ChooseWallet.tsx | 38 +++++- .../ChooseWallet/ChooseWalletContent.tsx | 110 ++++++++++-------- .../components/base/WalletButtonSquare.tsx | 53 +++++++++ .../react-native/src/evm/styles/colors.ts | 3 + 5 files changed, 186 insertions(+), 53 deletions(-) create mode 100644 packages/react-native/src/evm/assets/thirdweb-logo.tsx create mode 100644 packages/react-native/src/evm/components/base/WalletButtonSquare.tsx diff --git a/packages/react-native/src/evm/assets/thirdweb-logo.tsx b/packages/react-native/src/evm/assets/thirdweb-logo.tsx new file mode 100644 index 00000000000..4af5d05da65 --- /dev/null +++ b/packages/react-native/src/evm/assets/thirdweb-logo.tsx @@ -0,0 +1,35 @@ +import { IconStyleProp } from "./types"; +import Svg, { ClipPath, Defs, G, Path, Rect } from "react-native-svg"; + +const ThirdwebLogo = ({ width, height, color }: IconStyleProp) => { + return ( + + + + + + + + + + + + + ); +}; + +export default ThirdwebLogo; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index 97e64a4ab7c..0e281c50938 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -5,7 +5,10 @@ import { ModalHeaderTextClose } from "../../base/modal/ModalHeaderTextClose"; import { ChooseWalletContent } from "./ChooseWalletContent"; import { WalletConfig } from "@thirdweb-dev/react-core"; import { ReactNode, useState } from "react"; -import { View } from "react-native"; +import Box from "../../base/Box"; +import Text from "../../base/Text"; +import ThirdwebLogo from "../../../assets/thirdweb-logo"; +import { useAppTheme } from "../../../styles/hooks"; export type ChooseWalletProps = { headerText?: ReactNode | string; @@ -26,6 +29,7 @@ export function ChooseWallet({ excludeWalletIds = [], showGuestWalletAsButton = false, }: ChooseWalletProps) { + const theme = useAppTheme(); const [isConnecting, setIsConnecting] = useState(false); const guestWallet = wallets.find((w) => w.id === walletIds.localWallet); @@ -36,10 +40,36 @@ export function ChooseWallet({ }; return ( - + + + + Connect + + + ) + } subHeaderText={subHeaderText} /> ) : null} - + ); } diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx index 446b6b7d973..02173b103e9 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx @@ -1,9 +1,16 @@ import { useMemo } from "react"; import type { WalletConfig } from "@thirdweb-dev/react-core"; -import { StyleSheet, View, FlatList } from "react-native"; -import { WalletButton } from "../../base/WalletButton"; +import { FlatList, Dimensions } from "react-native"; import Box from "../../base/Box"; import { useTheme } from "@shopify/restyle"; +import { WalletButtonSquare } from "../../base/WalletButtonSquare"; +import Text from "../../base/Text"; + +const SCREEN_WIDTH = Dimensions.get("screen").width; +const SCREEN_HEIGHT = Dimensions.get("screen").height; +const MAX_HEIGHT = SCREEN_HEIGHT * 0.4; +const NUM_COLUMNS = 3; +const TILE_SIZE = SCREEN_WIDTH / NUM_COLUMNS; interface ChooseWalletContentProps { wallets: WalletConfig[]; @@ -24,57 +31,62 @@ export const ChooseWalletContent = ({ const theme = useTheme(); return ( - + + {walletsToDisplay.map((wallet) => { + if (!wallet.selectUI) { + return null; + } + + return ( + + { + onChooseWallet(wallet, data); + }} + walletConfig={wallet} + /> + + ); + })} item.meta.name} data={walletsToDisplay} - renderItem={({ item, index }) => { - const marginBottom = - index === walletsToDisplay.length - 1 ? "none" : "xxs"; - - return ( - <> - {item.selectUI ? ( - - { - onChooseWallet(item, data); - }} - walletConfig={item} - /> - - ) : ( - onChooseWallet(item)} - mb={marginBottom} - /> - )} - - ); + numColumns={NUM_COLUMNS} + style={{ maxHeight: MAX_HEIGHT }} + fadingEdgeLength={10} + showsVerticalScrollIndicator={false} + renderItem={({ item }) => { + return !item.selectUI ? ( + onChooseWallet(item)} + /> + ) : null; }} /> - + + New to wallets? + Get started + + ); }; - -const styles = StyleSheet.create({ - explorerContainer: { - display: "flex", - flexDirection: "row", - flexWrap: "wrap", - justifyContent: "center", - alignItems: "center", - paddingHorizontal: 4, - marginTop: 25, - }, -}); diff --git a/packages/react-native/src/evm/components/base/WalletButtonSquare.tsx b/packages/react-native/src/evm/components/base/WalletButtonSquare.tsx new file mode 100644 index 00000000000..f878c25b3ba --- /dev/null +++ b/packages/react-native/src/evm/components/base/WalletButtonSquare.tsx @@ -0,0 +1,53 @@ +import { useAppTheme } from "../../styles/hooks"; +import BaseButton from "./BaseButton"; +import Box from "./Box"; +import ImageSvgUri from "./ImageSvgUri"; +import Text from "./Text"; + +type WalletButtonSquareProps = { + onPress: () => void; + walletIconUrl: string; + size: number; + name: string; +} & (typeof BaseButton)["arguments"]; + +export const WalletButtonSquare = ({ + onPress, + walletIconUrl, + name, + size, +}: WalletButtonSquareProps) => { + const theme = useAppTheme(); + + const marginVertical = theme.spacing.xs; + return ( + + + + + + {name} + + + ); +}; diff --git a/packages/react-native/src/evm/styles/colors.ts b/packages/react-native/src/evm/styles/colors.ts index 0fb6ed503a0..b45b0e6c5f1 100644 --- a/packages/react-native/src/evm/styles/colors.ts +++ b/packages/react-native/src/evm/styles/colors.ts @@ -2,6 +2,7 @@ export type Palette = { buttonBackgroundColor: string; buttonTextColor: string; + backgroundInverted: string; background: string; backgroundHighlight: string; @@ -39,6 +40,7 @@ export const paletteLight: Palette = { buttonBackgroundColor: "white", buttonTextColor: "black", + backgroundInverted: "#131417", background: "#F7F7F9", backgroundHighlight: "#FFFFFF", @@ -61,6 +63,7 @@ export const paletteDark: Palette = { buttonBackgroundColor: "white", buttonTextColor: "black", + backgroundInverted: "white", background: "#131417", backgroundHighlight: "#232429", From 21e808295a968cd29b6866a1dce70b74d26a4143 Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Tue, 5 Sep 2023 21:10:25 -0400 Subject: [PATCH 02/18] rows --- .../react-native/src/evm/assets/email.tsx | 33 ++++ .../ChooseWallet/ChooseWallet.tsx | 90 +++++++++-- .../ChooseWallet/ChooseWalletContent.tsx | 151 ++++++++++-------- .../ChooseWalletContentSquare.tsx | 92 +++++++++++ .../ConnectingWallet/ConnectingWallet.tsx | 5 +- .../ConnectWalletFlow/LocalWalletFlow.tsx | 2 +- .../src/evm/components/MainModal.tsx | 6 +- .../src/evm/components/base/WalletButton.tsx | 6 +- 8 files changed, 296 insertions(+), 89 deletions(-) create mode 100644 packages/react-native/src/evm/assets/email.tsx create mode 100644 packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContentSquare.tsx diff --git a/packages/react-native/src/evm/assets/email.tsx b/packages/react-native/src/evm/assets/email.tsx new file mode 100644 index 00000000000..feff66d90d1 --- /dev/null +++ b/packages/react-native/src/evm/assets/email.tsx @@ -0,0 +1,33 @@ +import { IconStyleProp } from "./types"; +import Svg, { Path, Rect } from "react-native-svg"; + +const Email = ({ width, height }: IconStyleProp) => { + return ( + + + + + + + ); +}; + +export default Email; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index 0e281c50938..d0cc600747c 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -1,14 +1,16 @@ import { walletIds } from "@thirdweb-dev/wallets"; import { localWallet } from "../../../wallets/wallets/local-wallet"; -import { ModalFooter } from "../../base/modal/ModalFooter"; import { ModalHeaderTextClose } from "../../base/modal/ModalHeaderTextClose"; -import { ChooseWalletContent } from "./ChooseWalletContent"; import { WalletConfig } from "@thirdweb-dev/react-core"; import { ReactNode, useState } from "react"; import Box from "../../base/Box"; import Text from "../../base/Text"; import ThirdwebLogo from "../../../assets/thirdweb-logo"; import { useAppTheme } from "../../../styles/hooks"; +import { ChooseWalletContent } from "./ChooseWalletContent"; +import { BaseButton } from "../../base"; +import { ActivityIndicator } from "react-native"; +import Email from "../../../assets/email"; export type ChooseWalletProps = { headerText?: ReactNode | string; @@ -17,7 +19,6 @@ export type ChooseWalletProps = { onClose: () => void; wallets: WalletConfig[]; excludeWalletIds?: string[]; - showGuestWalletAsButton?: boolean; }; export function ChooseWallet({ @@ -27,27 +28,31 @@ export function ChooseWallet({ onChooseWallet, onClose, excludeWalletIds = [], - showGuestWalletAsButton = false, }: ChooseWalletProps) { const theme = useAppTheme(); const [isConnecting, setIsConnecting] = useState(false); const guestWallet = wallets.find((w) => w.id === walletIds.localWallet); + const emailWallet = wallets.find((w) => w.id === walletIds.metamask); const onContinueAsGuestPress = () => { setIsConnecting(true); - onChooseWallet(localWallet()); + setTimeout(() => { + onChooseWallet(localWallet()); + }, 0); }; return ( - + - {guestWallet && !showGuestWalletAsButton ? ( - + + New to wallets? + + Get started + + + {guestWallet || emailWallet ? ( + + ----------- Or ----------- + + ) : null} + {emailWallet ? ( + + + + + Email + + + + ) : null} + {guestWallet ? ( + + + {isConnecting ? ( + + ) : ( + Continue as guest + )} + + ) : null} ); diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx index 02173b103e9..fd89d0bb1d1 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx @@ -1,16 +1,9 @@ import { useMemo } from "react"; import type { WalletConfig } from "@thirdweb-dev/react-core"; -import { FlatList, Dimensions } from "react-native"; +import { StyleSheet, View, ScrollView } from "react-native"; +import { WalletButton } from "../../base/WalletButton"; import Box from "../../base/Box"; import { useTheme } from "@shopify/restyle"; -import { WalletButtonSquare } from "../../base/WalletButtonSquare"; -import Text from "../../base/Text"; - -const SCREEN_WIDTH = Dimensions.get("screen").width; -const SCREEN_HEIGHT = Dimensions.get("screen").height; -const MAX_HEIGHT = SCREEN_HEIGHT * 0.4; -const NUM_COLUMNS = 3; -const TILE_SIZE = SCREEN_WIDTH / NUM_COLUMNS; interface ChooseWalletContentProps { wallets: WalletConfig[]; @@ -31,62 +24,94 @@ export const ChooseWalletContent = ({ const theme = useTheme(); return ( - - {walletsToDisplay.map((wallet) => { - if (!wallet.selectUI) { - return null; - } - - return ( - - { - onChooseWallet(wallet, data); - }} - walletConfig={wallet} - /> - - ); - })} - + + {walletsToDisplay.map((item, index) => { + const marginBottom = + index === walletsToDisplay.length - 1 ? "none" : "xxs"; + return ( + + {item.selectUI ? ( + + { + onChooseWallet(item, data); + }} + walletConfig={item} + /> + + ) : ( + onChooseWallet(item)} + mb={marginBottom} + /> + )} + + ); + })} + + {/* item.meta.name} data={walletsToDisplay} - numColumns={NUM_COLUMNS} - style={{ maxHeight: MAX_HEIGHT }} - fadingEdgeLength={10} - showsVerticalScrollIndicator={false} - renderItem={({ item }) => { - return !item.selectUI ? ( - onChooseWallet(item)} - /> - ) : null; + style={{ width: "100%" }} + contentContainerStyle={{ flexGrow: 1 }} + renderItem={({ item, index }) => { + const marginBottom = + index === walletsToDisplay.length - 1 ? "none" : "xxs"; + + return ( + <> + {item.selectUI ? ( + + { + onChooseWallet(item, data); + }} + walletConfig={item} + /> + + ) : ( + onChooseWallet(item)} + mb={marginBottom} + /> + )} + + ); }} - /> - - New to wallets? - Get started - - + /> */} + ); }; + +const styles = StyleSheet.create({ + explorerContainer: { + flex: 1, + flexDirection: "row", + flexWrap: "wrap", + justifyContent: "center", + alignItems: "center", + marginTop: 25, + paddingHorizontal: 32, + }, +}); diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContentSquare.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContentSquare.tsx new file mode 100644 index 00000000000..912fda879aa --- /dev/null +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContentSquare.tsx @@ -0,0 +1,92 @@ +import { useMemo } from "react"; +import type { WalletConfig } from "@thirdweb-dev/react-core"; +import { FlatList, Dimensions } from "react-native"; +import Box from "../../base/Box"; +import { useTheme } from "@shopify/restyle"; +import { WalletButtonSquare } from "../../base/WalletButtonSquare"; +import Text from "../../base/Text"; + +const SCREEN_WIDTH = Dimensions.get("screen").width; +const SCREEN_HEIGHT = Dimensions.get("screen").height; +const MAX_HEIGHT = SCREEN_HEIGHT * 0.4; +const NUM_COLUMNS = 3; +const TILE_SIZE = SCREEN_WIDTH / NUM_COLUMNS; + +interface ChooseWalletContentProps { + wallets: WalletConfig[]; + excludeWalletIds?: string[]; + onChooseWallet: (wallet: WalletConfig, data?: any) => void; +} + +export const ChooseWalletContentSquare = ({ + wallets, + excludeWalletIds, + onChooseWallet, +}: ChooseWalletContentProps) => { + const walletsToDisplay = useMemo(() => { + return wallets.filter( + (w) => !!!excludeWalletIds?.find((ewId) => ewId === w.id), + ); + }, [wallets, excludeWalletIds]); + const theme = useTheme(); + + return ( + + {walletsToDisplay.map((wallet) => { + if (!wallet.selectUI) { + return null; + } + + return ( + + { + onChooseWallet(wallet, data); + }} + walletConfig={wallet} + /> + + ); + })} + item.meta.name} + data={walletsToDisplay} + numColumns={NUM_COLUMNS} + style={{ maxHeight: MAX_HEIGHT }} + fadingEdgeLength={10} + showsVerticalScrollIndicator={false} + renderItem={({ item }) => { + return !item.selectUI ? ( + onChooseWallet(item)} + /> + ) : null; + }} + /> + + New to wallets? + Get started + + + ); +}; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx index 677344a3938..5f82e84e8ee 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx @@ -1,4 +1,5 @@ import { useAppTheme } from "../../../styles/hooks"; +import { Box } from "../../base"; import Text from "../../base/Text"; import { ModalFooter } from "../../base/modal/ModalFooter"; import { ConnectWalletHeader } from "./ConnectingWalletHeader"; @@ -30,7 +31,7 @@ export function ConnectingWallet({ }; return ( - + )} - + ); } diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx index 079dfb38d87..9ae79dcac2e 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx @@ -79,7 +79,7 @@ export function LocalWalletFlow({ )} - -------- OR -------- + -------- Or -------- diff --git a/packages/react-native/src/evm/components/MainModal.tsx b/packages/react-native/src/evm/components/MainModal.tsx index 8d0fe9221ea..eeb8acf652e 100644 --- a/packages/react-native/src/evm/components/MainModal.tsx +++ b/packages/react-native/src/evm/components/MainModal.tsx @@ -9,7 +9,7 @@ import { SessionRequestModal } from "./ConnectWalletDetails/SessionRequestModal" import { SessionProposalModal } from "./ConnectWalletDetails/SessionProposalModal"; import { TWModal } from "./base/modal/TWModal"; -const MODAL_HEIGHT = Dimensions.get("window").height * 0.7; +const MODAL_HEIGHT = Dimensions.get("window").height * 0.6; const DEVICE_WIDTH = Dimensions.get("window").width; export const MainModal = () => { @@ -63,8 +63,8 @@ const styles = StyleSheet.create({ width: DEVICE_WIDTH, borderTopLeftRadius: 24, borderTopRightRadius: 24, - padding: 24, - paddingBottom: 40, + paddingTop: 32, + paddingBottom: 28, }, contentContainer: { maxHeight: MODAL_HEIGHT, diff --git a/packages/react-native/src/evm/components/base/WalletButton.tsx b/packages/react-native/src/evm/components/base/WalletButton.tsx index 070b4d2028e..064de218e2e 100644 --- a/packages/react-native/src/evm/components/base/WalletButton.tsx +++ b/packages/react-native/src/evm/components/base/WalletButton.tsx @@ -28,12 +28,12 @@ export const WalletButton = ({ paddingHorizontal="md" paddingVertical="sm" borderRadius="sm" - backgroundColor="backgroundHighlight" + backgroundColor="background" onPress={onPress} > - - + + {name} From 02f4a384b5ab077657169562cf44062991417892 Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Wed, 6 Sep 2023 22:17:26 -0400 Subject: [PATCH 03/18] Connect revamp --- .../ChooseWallet/ChooseWallet.tsx | 182 +++++++++++------- .../ChooseWallet/ChooseWalletContent.tsx | 65 +------ .../ConnectWalletFlow/ConnectWalletFlow.tsx | 21 +- .../ConnectingWallet/ConnectingWallet.tsx | 45 ++--- .../ConnectingWalletHeader.tsx | 4 +- .../base/modal/ModalHeaderTextClose.tsx | 15 +- .../src/evm/wallets/wallets/magic-link.tsx | 125 +++++++++--- .../wallet-connect/WalletLoadingThumbnail.tsx | 30 +-- 8 files changed, 288 insertions(+), 199 deletions(-) diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index d0cc600747c..85aa55ba376 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -8,9 +8,9 @@ import Text from "../../base/Text"; import ThirdwebLogo from "../../../assets/thirdweb-logo"; import { useAppTheme } from "../../../styles/hooks"; import { ChooseWalletContent } from "./ChooseWalletContent"; -import { BaseButton } from "../../base"; +import { BaseButton, ImageSvgUri } from "../../base"; import { ActivityIndicator } from "react-native"; -import Email from "../../../assets/email"; +import { useTheme } from "@shopify/restyle"; export type ChooseWalletProps = { headerText?: ReactNode | string; @@ -30,10 +30,19 @@ export function ChooseWallet({ excludeWalletIds = [], }: ChooseWalletProps) { const theme = useAppTheme(); + const themeLightDark = useTheme(); const [isConnecting, setIsConnecting] = useState(false); + const [isConnectAWalletEnabled, setIsConnectAWalletEnabled] = useState(false); const guestWallet = wallets.find((w) => w.id === walletIds.localWallet); - const emailWallet = wallets.find((w) => w.id === walletIds.metamask); + const emailWallet = wallets.find((w) => w.id === walletIds.magicLink); + const connectionWallets = wallets + .filter( + (wallet) => + wallet.id !== walletIds.magicLink && + wallet.id !== walletIds.localWallet, + ) + .slice(0, 2); const onContinueAsGuestPress = () => { setIsConnecting(true); @@ -42,17 +51,25 @@ export function ChooseWallet({ }, 0); }; + const onConnectAWalletPress = () => { + setIsConnectAWalletEnabled(true); + }; + + const onBackPress = () => { + setIsConnectAWalletEnabled(false); + }; + return ( - + - - - New to wallets? - - Get started - - - {guestWallet || emailWallet ? ( - - ----------- Or ----------- - - ) : null} - {emailWallet ? ( - - + + + - - - Email - - + New to wallets? + + Get started + + + + ) : emailWallet.selectUI ? ( + { + onChooseWallet(emailWallet, data); + }} + walletConfig={emailWallet} + /> + ) : null} + {emailWallet && + !isConnectAWalletEnabled && + (guestWallet || connectionWallets.length > 0) ? ( + + + + Or + + ) : null} + {emailWallet && + !isConnectAWalletEnabled && + connectionWallets.length > 0 ? ( + + {connectionWallets.map((wallet) => { + return ( + + + + ); + })} + Connect a wallet + + ) : null} {guestWallet ? ( - - - {isConnecting ? ( - - ) : ( - Continue as guest - )} - - + + {isConnecting ? ( + + ) : ( + Continue as guest + )} + ) : null} ); diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx index fd89d0bb1d1..40316194949 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx @@ -1,6 +1,6 @@ import { useMemo } from "react"; import type { WalletConfig } from "@thirdweb-dev/react-core"; -import { StyleSheet, View, ScrollView } from "react-native"; +import { Dimensions, ScrollView, View } from "react-native"; import { WalletButton } from "../../base/WalletButton"; import Box from "../../base/Box"; import { useTheme } from "@shopify/restyle"; @@ -11,6 +11,8 @@ interface ChooseWalletContentProps { onChooseWallet: (wallet: WalletConfig, data?: any) => void; } +const MAX_HEIGHT = Dimensions.get("window").height * 0.4; + export const ChooseWalletContent = ({ wallets, excludeWalletIds, @@ -24,8 +26,13 @@ export const ChooseWalletContent = ({ const theme = useTheme(); return ( - - + + {walletsToDisplay.map((item, index) => { const marginBottom = index === walletsToDisplay.length - 1 ? "none" : "xxs"; @@ -60,58 +67,6 @@ export const ChooseWalletContent = ({ ); })} - {/* item.meta.name} - data={walletsToDisplay} - style={{ width: "100%" }} - contentContainerStyle={{ flexGrow: 1 }} - renderItem={({ item, index }) => { - const marginBottom = - index === walletsToDisplay.length - 1 ? "none" : "xxs"; - - return ( - <> - {item.selectUI ? ( - - { - onChooseWallet(item, data); - }} - walletConfig={item} - /> - - ) : ( - onChooseWallet(item)} - mb={marginBottom} - /> - )} - - ); - }} - /> */} ); }; - -const styles = StyleSheet.create({ - explorerContainer: { - flex: 1, - flexDirection: "row", - flexWrap: "wrap", - justifyContent: "center", - alignItems: "center", - marginTop: 25, - paddingHorizontal: 32, - }, -}); diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx index a33bf2b2e97..3f54f2ad511 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx @@ -11,6 +11,7 @@ import { CLOSE_MODAL_STATE, ConnectWalletFlowModal, } from "../../utils/modalTypes"; +import Box from "../base/Box"; export const ConnectWalletFlow = () => { const { modalState, setModalState } = useModalState(); @@ -39,13 +40,14 @@ export const ConnectWalletFlow = () => { const connectActiveWallet = useCallback( async (wallet: WalletConfig, data?: any) => { setIsConnecting(true); - try { - await connect(wallet, { ...data }); - } catch (error) { - console.error("Error connecting to the wallet", error); - } finally { - onClose(true); - } + // try { + // await connect(wallet, { ...data }); + // } catch (error) { + // console.error("Error connecting to the wallet", error); + // } finally { + // onClose(true); + // } + console.log(connect, onClose, wallet, data); }, [connect, onClose], ); @@ -127,10 +129,11 @@ export const ConnectWalletFlow = () => { ]); return ( - <> + {activeWallet ? ( isConnecting ? ( @@ -153,6 +156,6 @@ export const ConnectWalletFlow = () => { onClose={onClose} /> )} - + ); }; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx index 5f82e84e8ee..4bd848543cf 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx @@ -1,11 +1,10 @@ -import { useAppTheme } from "../../../styles/hooks"; -import { Box } from "../../base"; +import WalletLoadingThumbnail from "../../../wallets/wallets/wallet-connect/WalletLoadingThumbnail"; +import { Box, ImageSvgUri } from "../../base"; import Text from "../../base/Text"; -import { ModalFooter } from "../../base/modal/ModalFooter"; import { ConnectWalletHeader } from "./ConnectingWalletHeader"; import type { WalletConfig } from "@thirdweb-dev/react-core"; import { ReactNode } from "react"; -import { ActivityIndicator, Linking, StyleSheet, View } from "react-native"; +import { StyleSheet, View } from "react-native"; export type ConnectingWalletProps = { subHeaderText?: string; @@ -13,7 +12,7 @@ export type ConnectingWalletProps = { content?: ReactNode; onClose: () => void; onBackPress: () => void; - wallet: WalletConfig; + wallet: WalletConfig; }; export function ConnectingWallet({ @@ -24,51 +23,43 @@ export function ConnectingWallet({ onClose, onBackPress, }: ConnectingWalletProps) { - const theme = useAppTheme(); - - const onFooterPress = () => { - Linking.openURL("https://support.thirdweb.com/"); - }; - return ( - + + + + - {content ? ( content ) : ( - - Connect your wallet through the {wallet.meta.name} application. - + <> + + Connecting your wallet + + + Login and connect your wallet through the metamask pop-up + + )} - {footer ? ( - footer - ) : ( - - )} + {footer ? footer : null} ); } const styles = StyleSheet.create({ connectingContainer: { - display: "flex", flexDirection: "column", - flexWrap: "wrap", justifyContent: "center", alignContent: "center", alignItems: "center", paddingHorizontal: 4, + marginBottom: 24, marginTop: 18, }, }); diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWalletHeader.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWalletHeader.tsx index 6325d48ae50..fd0acf49511 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWalletHeader.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWalletHeader.tsx @@ -33,9 +33,7 @@ export const ConnectWalletHeader = ({ onPress={onBackPress} color={theme.colors.iconPrimary} /> - ) : ( - - )} + ) : null} {walletLogoUrl ? ( ) : null} diff --git a/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx b/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx index 55d6e5c572a..273e1972e27 100644 --- a/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx +++ b/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx @@ -8,12 +8,14 @@ interface ModalHeaderTextCloseProps { onClose: () => void; headerText?: ReactNode | string; subHeaderText?: ReactNode | string; + onBackPress?: () => void; } export const ModalHeaderTextClose = ({ headerText, subHeaderText, onClose, + onBackPress, ...props }: ModalHeaderTextCloseProps & React.ComponentProps) => { const theme = useAppTheme(); @@ -25,6 +27,15 @@ export const ModalHeaderTextClose = ({ justifyContent={headerText ? "space-between" : "flex-end"} {...props} > + {onBackPress ? ( + + ) : null} {typeof headerText === "string" ? ( {headerText} ) : ( @@ -32,8 +43,8 @@ export const ModalHeaderTextClose = ({ )} diff --git a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx index 2709269ce74..3d041069cac 100644 --- a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx +++ b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx @@ -15,8 +15,11 @@ import { useEffect, useRef } from "react"; import Box from "../../components/base/Box"; import { TextInput } from "../../components/base/TextInput"; import Text from "../../components/base/Text"; -import { ActivityIndicator } from "react-native"; import { useMagicLink } from "../../providers/context-provider"; +import BaseButton from "../../components/base/BaseButton"; +import { useAppTheme } from "../../styles/hooks"; +import React from "react"; +import { ConnectingWallet } from "../../components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet"; export const magicLink = ( magicLinkOptions: MagicLinkOptions, @@ -42,35 +45,104 @@ export const magicLink = ( /** * UI for selecting wallet - this UI is rendered in the wallet selection screen */ - selectUI: (props: SelectUIProps) => { - return ( - - { - props.onSelect(e.nativeEvent.text); - }} - /> - - ---- OR ---- - - - ); - }, + selectUI: MagicSelectionUI, + // (props: SelectUIProps) => { + // return ( + // + // + // + // + // Sign in + // + // + // + // // // + // // // { + // // // props.onSelect(e.nativeEvent.text); + // // // }} + // // // /> + // // // + // // // ---- OR ---- + // // // + // // + // ); + // }, isInstalled: () => { return true; }, }; }; +const MagicSelectionUI: React.FC> = (props) => { + const theme = useAppTheme(); + const [email, setEmail] = React.useState(""); + + const onContinuePress = () => { + if (!email) { + return; + } + props.onSelect(email); + }; + + return ( + + { + setEmail(text); + }} + /> + + + Continue + + + + ); +}; + const MagicConnectionUI: React.FC< ConnectUIProps & { magicLinkOptions: MagicLinkOptions } -> = ({ selectionData, walletConfig, close, magicLinkOptions }) => { +> = ({ selectionData, walletConfig, close, goBack, magicLinkOptions }) => { const createWalletInstance = useCreateWalletInstance(); const setConnectedWallet = useSetConnectedWallet(); const chainToConnect = useWalletContext().chainToConnect; @@ -125,10 +197,11 @@ const MagicConnectionUI: React.FC< ]); return ( - - - - + ); }; diff --git a/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx b/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx index 7d663e1350a..873757e3589 100644 --- a/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx +++ b/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx @@ -11,7 +11,11 @@ interface Props { showError?: boolean; } -function WalletLoadingThumbnail({ children, showError }: Props) { +function WalletLoadingThumbnail({ + children, + showError, + imageSize = 50, +}: Props) { const Theme = useAppTheme(); const spinValue = useRef(new Animated.Value(0)); @@ -38,12 +42,17 @@ function WalletLoadingThumbnail({ children, showError }: Props) { return ( - + Date: Thu, 7 Sep 2023 11:10:54 -0400 Subject: [PATCH 04/18] comments --- .../ConnectWalletFlow/ConnectWalletFlow.tsx | 15 +++---- .../src/evm/wallets/wallets/magic-link.tsx | 45 ------------------- 2 files changed, 7 insertions(+), 53 deletions(-) diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx index 3f54f2ad511..2d478078abc 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx @@ -40,14 +40,13 @@ export const ConnectWalletFlow = () => { const connectActiveWallet = useCallback( async (wallet: WalletConfig, data?: any) => { setIsConnecting(true); - // try { - // await connect(wallet, { ...data }); - // } catch (error) { - // console.error("Error connecting to the wallet", error); - // } finally { - // onClose(true); - // } - console.log(connect, onClose, wallet, data); + try { + await connect(wallet, { ...data }); + } catch (error) { + console.error("Error connecting to the wallet", error); + } finally { + onClose(true); + } }, [connect, onClose], ); diff --git a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx index 3d041069cac..c479d6f4746 100644 --- a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx +++ b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx @@ -46,51 +46,6 @@ export const magicLink = ( * UI for selecting wallet - this UI is rendered in the wallet selection screen */ selectUI: MagicSelectionUI, - // (props: SelectUIProps) => { - // return ( - // - // - // - // - // Sign in - // - // - // - // // // - // // // { - // // // props.onSelect(e.nativeEvent.text); - // // // }} - // // // /> - // // // - // // // ---- OR ---- - // // // - // // - // ); - // }, isInstalled: () => { return true; }, From 02e0b55fa1f26a20bb031d269fab6fe9c3db3b4c Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Thu, 7 Sep 2023 11:13:31 -0400 Subject: [PATCH 05/18] changeset --- .changeset/orange-pans-brake.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/orange-pans-brake.md diff --git a/.changeset/orange-pans-brake.md b/.changeset/orange-pans-brake.md new file mode 100644 index 00000000000..aeaeff31eeb --- /dev/null +++ b/.changeset/orange-pans-brake.md @@ -0,0 +1,5 @@ +--- +"@thirdweb-dev/react-native": patch +--- + +Improved ConnectWallet design :) From 847c4c69c9af8d89216220becd2849d2b2bbdb70 Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Thu, 7 Sep 2023 14:36:54 -0400 Subject: [PATCH 06/18] fix theme --- packages/chains/chains/103.ts | 6 ++ packages/chains/chains/10395.ts | 6 ++ packages/chains/chains/1089.ts | 53 +++++++++++ packages/chains/chains/109.ts | 34 +++++++ packages/chains/chains/1107.ts | 40 +++++++++ packages/chains/chains/255.ts | 49 +++++++++++ packages/chains/chains/3701.ts | 39 -------- packages/chains/chains/421614.ts | 38 ++++++++ packages/chains/chains/43.ts | 2 +- packages/chains/chains/44.ts | 11 ++- packages/chains/chains/45.ts | 4 +- packages/chains/chains/46.ts | 5 +- packages/chains/chains/47.ts | 4 +- packages/chains/chains/55004.ts | 2 +- packages/chains/chains/6.ts | 21 ----- packages/chains/chains/61.ts | 13 ++- packages/chains/chains/63.ts | 18 +++- packages/chains/chains/669.ts | 20 ++--- packages/chains/chains/91002.ts | 6 +- packages/chains/src/index.ts | 82 +++++++++++++---- .../src/evm/assets/right-arrow.tsx | 6 +- .../src/evm/components/ConnectWallet.tsx | 10 ++- .../ConnectWalletDetailsModal.tsx | 88 ++++++++----------- .../ChooseWallet/ChooseWalletContent.tsx | 2 +- .../ConnectWalletFlow/ConnectWalletButton.tsx | 4 +- .../ConnectWalletFlow/ConnectWalletFlow.tsx | 57 ++++++------ .../SmartWallet/SmartWalletFlow.tsx | 3 +- .../src/evm/components/MainModal.tsx | 12 +-- .../src/evm/components/Web3Button.tsx | 10 ++- .../src/evm/providers/thirdweb-provider.tsx | 6 +- .../src/evm/styles/ThemeProvider.tsx | 5 +- .../src/evm/wallets/wallets/magic-link.tsx | 1 + 32 files changed, 458 insertions(+), 199 deletions(-) create mode 100644 packages/chains/chains/1089.ts create mode 100644 packages/chains/chains/109.ts create mode 100644 packages/chains/chains/1107.ts create mode 100644 packages/chains/chains/255.ts delete mode 100644 packages/chains/chains/3701.ts create mode 100644 packages/chains/chains/421614.ts delete mode 100644 packages/chains/chains/6.ts diff --git a/packages/chains/chains/103.ts b/packages/chains/chains/103.ts index 9198ea1e010..30fcc106a6a 100644 --- a/packages/chains/chains/103.ts +++ b/packages/chains/chains/103.ts @@ -2,6 +2,12 @@ import type { Chain } from "../src/types"; export default { "name": "Worldland Mainnet", "chain": "Worldland", + "icon": { + "url": "ipfs://QmYZNTfK3byhgLsTjXP8vPubVHRz2CWsBrTJxZrQmKq6JZ", + "width": 3509, + "height": 2482, + "format": "png" + }, "rpc": [ "https://worldland.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://seoul.worldland.foundation" diff --git a/packages/chains/chains/10395.ts b/packages/chains/chains/10395.ts index cded53b8b7a..f09e9e5de7c 100644 --- a/packages/chains/chains/10395.ts +++ b/packages/chains/chains/10395.ts @@ -2,6 +2,12 @@ import type { Chain } from "../src/types"; export default { "name": "Worldland Testnet", "chain": "Worldland", + "icon": { + "url": "ipfs://QmYZNTfK3byhgLsTjXP8vPubVHRz2CWsBrTJxZrQmKq6JZ", + "width": 3509, + "height": 2482, + "format": "png" + }, "rpc": [ "https://worldland-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://gwangju.worldland.foundation" diff --git a/packages/chains/chains/1089.ts b/packages/chains/chains/1089.ts new file mode 100644 index 00000000000..d51e370c431 --- /dev/null +++ b/packages/chains/chains/1089.ts @@ -0,0 +1,53 @@ +import type { Chain } from "../src/types"; +export default { + "name": "Humans.ai Mainnet", + "chain": "Humans", + "rpc": [ + "https://humans-ai.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://jsonrpc.humans.nodestake.top", + "https://humans-mainnet-evm.itrocket.net:443", + "https://humans-evm-rpc.staketab.org:443", + "https://evm.humans.stakepool.dev.br", + "https://mainnet-humans-evm.konsortech.xyz", + "https://evm-rpc.mainnet.humans.zone" + ], + "faucets": [], + "nativeCurrency": { + "name": "HEART", + "symbol": "HEART", + "decimals": 18 + }, + "features": [ + { + "name": "EIP155" + }, + { + "name": "EIP1559" + } + ], + "infoURL": "https://humans.ai", + "shortName": "humans", + "chainId": 1089, + "networkId": 1089, + "icon": { + "url": "ipfs://QmU83haX3TNifDDjBx6RP6ByqES1Kg9VqeJC87X9ipKyCS", + "width": 386, + "height": 397, + "format": "png" + }, + "explorers": [ + { + "name": "explorer.guru", + "url": "https://humans.explorers.guru", + "icon": { + "url": "ipfs://QmU83haX3TNifDDjBx6RP6ByqES1Kg9VqeJC87X9ipKyCS", + "width": 386, + "height": 397, + "format": "png" + }, + "standard": "none" + } + ], + "testnet": false, + "slug": "humans-ai" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/109.ts b/packages/chains/chains/109.ts new file mode 100644 index 00000000000..523a61eb908 --- /dev/null +++ b/packages/chains/chains/109.ts @@ -0,0 +1,34 @@ +import type { Chain } from "../src/types"; +export default { + "name": "Shibarium", + "chain": "Shibarium", + "icon": { + "url": "ipfs://QmYNVkoZgRjDBQzJz6kog9mA2yPzQFW2oSKvhnkwuBhLQE", + "width": 2000, + "height": 2000, + "format": "png" + }, + "rpc": [ + "https://shibarium.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://www.shibrpc.com" + ], + "faucets": [], + "nativeCurrency": { + "name": "BONE Shibarium", + "symbol": "BONE", + "decimals": 18 + }, + "infoURL": "https://shibariumecosystem.com", + "shortName": "shibariumecosystem", + "chainId": 109, + "networkId": 109, + "explorers": [ + { + "name": "shibariumscan", + "url": "https://www.shibariumscan.io", + "standard": "none" + } + ], + "testnet": false, + "slug": "shibarium" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/1107.ts b/packages/chains/chains/1107.ts new file mode 100644 index 00000000000..323d7a31231 --- /dev/null +++ b/packages/chains/chains/1107.ts @@ -0,0 +1,40 @@ +import type { Chain } from "../src/types"; +export default { + "name": "BLXq Testnet", + "chain": "BLXQ", + "icon": { + "url": "ipfs://QmS9kDKr1rgcz5W55yCQVfFs1vRTCneaLHt1t9cBizpqpH", + "width": 1000, + "height": 1000, + "format": "png" + }, + "rpc": [ + "https://blxq-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://testnetq1.blx.org" + ], + "faucets": [], + "nativeCurrency": { + "name": "BLXQ", + "symbol": "BLXQ", + "decimals": 18 + }, + "infoURL": "https://blx.org", + "shortName": "blxq", + "chainId": 1107, + "networkId": 1107, + "explorers": [ + { + "name": "BLXq Explorer", + "url": "https://explorer.blx.org", + "icon": { + "url": "ipfs://QmS9kDKr1rgcz5W55yCQVfFs1vRTCneaLHt1t9cBizpqpH", + "width": 1000, + "height": 1000, + "format": "png" + }, + "standard": "none" + } + ], + "testnet": true, + "slug": "blxq-testnet" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/255.ts b/packages/chains/chains/255.ts new file mode 100644 index 00000000000..68e97bcaa9d --- /dev/null +++ b/packages/chains/chains/255.ts @@ -0,0 +1,49 @@ +import type { Chain } from "../src/types"; +export default { + "name": "Kroma", + "chain": "ETH", + "rpc": [ + "https://kroma.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://api.kroma.network" + ], + "faucets": [], + "nativeCurrency": { + "name": "Ether", + "symbol": "ETH", + "decimals": 18 + }, + "infoURL": "https://kroma.network", + "icon": { + "url": "ipfs://QmVpV2WET6ZrqnvvPfE9hCwoE2y5ygbPuniuugpaRoxrho", + "width": 320, + "height": 320, + "format": "svg" + }, + "shortName": "kroma", + "chainId": 255, + "networkId": 255, + "explorers": [ + { + "name": "blockscout", + "url": "https://blockscout.kroma.network", + "icon": { + "url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM", + "width": 551, + "height": 540, + "format": "png" + }, + "standard": "EIP3091" + } + ], + "parent": { + "type": "L2", + "chain": "eip155-1", + "bridges": [ + { + "url": "https://kroma.network/bridge" + } + ] + }, + "testnet": false, + "slug": "kroma" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/3701.ts b/packages/chains/chains/3701.ts deleted file mode 100644 index ba8f1b21c76..00000000000 --- a/packages/chains/chains/3701.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { Chain } from "../src/types"; -export default { - "name": "Xpla Testnet", - "chain": "XPLATest", - "rpc": [ - "https://xpla-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://dimension-rpc.xpla.dev" - ], - "faucets": [ - "https://faucet.xpla.io" - ], - "nativeCurrency": { - "name": "XPLA", - "symbol": "XPLA", - "decimals": 18 - }, - "infoURL": "https://xpla.io", - "shortName": "xplatest", - "chainId": 3701, - "networkId": 3701, - "icon": { - "url": "ipfs://Qmf4GoxfpeA5VGqu7KP5eyv1WKaCpNDbvMxq1MjQBwFWxq", - "width": 512, - "height": 512, - "format": "png" - }, - "explorers": [ - { - "name": "XPLA Explorer", - "url": "https://explorer.xpla.io", - "standard": "none" - } - ], - "redFlags": [ - "reusedChainId" - ], - "testnet": true, - "slug": "xpla-testnet" -} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/421614.ts b/packages/chains/chains/421614.ts new file mode 100644 index 00000000000..26911738b1b --- /dev/null +++ b/packages/chains/chains/421614.ts @@ -0,0 +1,38 @@ +import type { Chain } from "../src/types"; +export default { + "name": "Arbitrum Sepolia", + "title": "Arbitrum Sepolia Rollup Testnet", + "chain": "ETH", + "rpc": [ + "https://arbitrum-sepolia.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://sepolia-rollup.abitrum.io/rpc" + ], + "faucets": [], + "nativeCurrency": { + "name": "Sepolia Ether", + "symbol": "ETH", + "decimals": 18 + }, + "infoURL": "https://arbitrum.io", + "shortName": "arb-sep", + "chainId": 421614, + "networkId": 421614, + "explorers": [ + { + "name": "Arbitrum Sepolia Rollup Testnet Explorer", + "url": "https://sepolia-explorer.arbitrum.io", + "standard": "EIP3091" + } + ], + "parent": { + "type": "L2", + "chain": "eip155-11155111", + "bridges": [ + { + "url": "https://bridge.arbitrum.io" + } + ] + }, + "testnet": true, + "slug": "arbitrum-sepolia" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/43.ts b/packages/chains/chains/43.ts index 2f3e5b75274..dabbbe3098b 100644 --- a/packages/chains/chains/43.ts +++ b/packages/chains/chains/43.ts @@ -7,7 +7,7 @@ export default { "https://pangolin-rpc.darwinia.network" ], "faucets": [ - "https://docs.crab.network/dvm/wallets/dvm-metamask#apply-for-the-test-token" + "https://docs.darwinia.network/pangolin-testnet-1e9ac8b09e874e8abd6a7f18c096ca6a" ], "nativeCurrency": { "name": "Pangolin Network Native Token", diff --git a/packages/chains/chains/44.ts b/packages/chains/chains/44.ts index 966c2e5d07b..c842111a198 100644 --- a/packages/chains/chains/44.ts +++ b/packages/chains/chains/44.ts @@ -1,10 +1,13 @@ import type { Chain } from "../src/types"; export default { - "name": "Darwinia Crab Network", + "name": "Crab Network", "chain": "crab", "rpc": [ - "https://darwinia-crab-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://crab-rpc.darwinia.network" + "https://crab-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://crab-rpc.darwinia.network", + "https://crab-rpc.darwiniacommunitydao.xyz", + "https://crab.api.onfinality.io/public-ws", + "https://darwiniacrab-rpc.dwellir.com" ], "faucets": [], "nativeCurrency": { @@ -24,5 +27,5 @@ export default { } ], "testnet": false, - "slug": "darwinia-crab-network" + "slug": "crab-network" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/45.ts b/packages/chains/chains/45.ts index cee564a8332..cf586b684a0 100644 --- a/packages/chains/chains/45.ts +++ b/packages/chains/chains/45.ts @@ -6,7 +6,9 @@ export default { "https://darwinia-pangoro-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://pangoro-rpc.darwinia.network" ], - "faucets": [], + "faucets": [ + "https://docs.darwinia.network/pangoro-testnet-70cfec5dc9ca42759959ba3803edaec2" + ], "nativeCurrency": { "name": "Pangoro Network Native Token", "symbol": "ORING", diff --git a/packages/chains/chains/46.ts b/packages/chains/chains/46.ts index 687025595a8..694a7956fa8 100644 --- a/packages/chains/chains/46.ts +++ b/packages/chains/chains/46.ts @@ -4,7 +4,10 @@ export default { "chain": "darwinia", "rpc": [ "https://darwinia-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://rpc.darwinia.network" + "https://rpc.darwinia.network", + "https://darwinia-rpc.darwiniacommunitydao.xyz", + "https://darwinia2.api.onfinality.io/public-ws", + "https://darwinia-rpc.dwellir.com" ], "faucets": [], "nativeCurrency": { diff --git a/packages/chains/chains/47.ts b/packages/chains/chains/47.ts index cc2a77eb787..22193286059 100644 --- a/packages/chains/chains/47.ts +++ b/packages/chains/chains/47.ts @@ -3,7 +3,7 @@ export default { "name": "Xpla Testnet", "chain": "XPLA", "rpc": [ - "https://xpla-testnet-xpla-test.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://xpla-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://cube-evm-rpc.xpla.dev" ], "nativeCurrency": { @@ -34,5 +34,5 @@ export default { "redFlags": [ "reusedChainId" ], - "slug": "xpla-testnet-xpla-test" + "slug": "xpla-testnet" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/55004.ts b/packages/chains/chains/55004.ts index 775d176e7a2..6c3687f71e5 100644 --- a/packages/chains/chains/55004.ts +++ b/packages/chains/chains/55004.ts @@ -5,7 +5,7 @@ export default { "rpc": [ "https://titan.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://rpc.titan.tokamak.network", - "wss://rpc.titan.tokamak.network/ws" + "wss://rpc.titan.tokamak.network" ], "faucets": [], "nativeCurrency": { diff --git a/packages/chains/chains/6.ts b/packages/chains/chains/6.ts deleted file mode 100644 index 2c93394e52c..00000000000 --- a/packages/chains/chains/6.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Chain } from "../src/types"; -export default { - "name": "Ethereum Classic Testnet Kotti", - "chain": "ETC", - "rpc": [ - "https://ethereum-classic-testnet-kotti.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://www.ethercluster.com/kotti" - ], - "faucets": [], - "nativeCurrency": { - "name": "Kotti Ether", - "symbol": "KOT", - "decimals": 18 - }, - "infoURL": "https://explorer.jade.builders/?network=kotti", - "shortName": "kot", - "chainId": 6, - "networkId": 6, - "testnet": true, - "slug": "ethereum-classic-testnet-kotti" -} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/61.ts b/packages/chains/chains/61.ts index f279aaf8867..0ad3796d223 100644 --- a/packages/chains/chains/61.ts +++ b/packages/chains/chains/61.ts @@ -4,11 +4,16 @@ export default { "chain": "ETC", "rpc": [ "https://ethereum-classic.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://etc.rivet.link" + "https://etc.rivet.link", + "https://etc.etcdesktop.com", + "https://etc.mytokenpocket.vip" ], - "faucets": [ - "https://free-online-app.com/faucet-for-eth-evm-chains/?" + "features": [ + { + "name": "EIP155" + } ], + "faucets": [], "nativeCurrency": { "name": "Ethereum Classic Ether", "symbol": "ETC", @@ -23,7 +28,7 @@ export default { { "name": "blockscout", "url": "https://blockscout.com/etc/mainnet", - "standard": "none" + "standard": "EIP3091" } ], "testnet": false, diff --git a/packages/chains/chains/63.ts b/packages/chains/chains/63.ts index 0c091d622e0..ebc17a2749b 100644 --- a/packages/chains/chains/63.ts +++ b/packages/chains/chains/63.ts @@ -6,7 +6,15 @@ export default { "https://ethereum-classic-testnet-mordor.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://rpc.mordor.etccooperative.org" ], - "faucets": [], + "features": [ + { + "name": "EIP155" + } + ], + "faucets": [ + "https://mordor.canhaz.net/", + "https://easy.hebeswap.com/#/faucet" + ], "nativeCurrency": { "name": "Mordor Classic Testnet Ether", "symbol": "METC", @@ -16,6 +24,14 @@ export default { "shortName": "metc", "chainId": 63, "networkId": 7, + "slip44": 63, + "explorers": [ + { + "name": "blockscout", + "url": "https://blockscout.com/etc/mordor", + "standard": "EIP3091" + } + ], "testnet": true, "slug": "ethereum-classic-testnet-mordor" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/669.ts b/packages/chains/chains/669.ts index a7c59cb2653..b4dbd951bc4 100644 --- a/packages/chains/chains/669.ts +++ b/packages/chains/chains/669.ts @@ -1,9 +1,9 @@ import type { Chain } from "../src/types"; export default { - "name": "JuncaGlobal Chain Testnet", - "chain": "JuncaGlobal Test Chain", + "name": "JuncaChain testnet", + "chain": "JuncaChain testnet", "rpc": [ - "https://juncaglobal-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://juncachain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://rpc-testnet.juncachain.com", "wss://ws-testnet.juncachain.com" ], @@ -11,27 +11,21 @@ export default { "https://faucet-testnet.juncachain.com" ], "nativeCurrency": { - "name": "JuncaGlobal Chain Testnet Native Token", + "name": "JuncaChain Testnet Native Token", "symbol": "JGCT", "decimals": 18 }, "infoURL": "https://junca-cash.world", - "shortName": "junca", + "shortName": "juncat", "chainId": 669, "networkId": 669, "explorers": [ { - "name": "blockscout", + "name": "JuncaScan", "url": "https://scan-testnet.juncachain.com", - "icon": { - "url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM", - "width": 551, - "height": 540, - "format": "png" - }, "standard": "EIP3091" } ], "testnet": true, - "slug": "juncaglobal-chain-testnet" + "slug": "juncachain-testnet" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/91002.ts b/packages/chains/chains/91002.ts index 90592ad1104..f181099411d 100644 --- a/packages/chains/chains/91002.ts +++ b/packages/chains/chains/91002.ts @@ -1,6 +1,6 @@ import type { Chain } from "../src/types"; export default { - "name": "Nautilus Chain", + "name": "Nautilus Trition Chain", "title": "Nautilus Trition Testnet", "chain": "ETH", "icon": { @@ -10,7 +10,7 @@ export default { "format": "png" }, "rpc": [ - "https://nautilus-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://nautilus-trition-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://triton.api.nautchain.xyz" ], "faucets": [ @@ -33,5 +33,5 @@ export default { } ], "testnet": true, - "slug": "nautilus-chain" + "slug": "nautilus-trition-chain" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/src/index.ts b/packages/chains/src/index.ts index e9e488936ea..e19e7d701f3 100644 --- a/packages/chains/src/index.ts +++ b/packages/chains/src/index.ts @@ -3,7 +3,6 @@ import c2 from "../chains/2"; import c3 from "../chains/3"; import c4 from "../chains/4"; import c5 from "../chains/5"; -import c6 from "../chains/6"; import c7 from "../chains/7"; import c8 from "../chains/8"; import c9 from "../chains/9"; @@ -97,11 +96,13 @@ import c99 from "../chains/99"; import c100 from "../chains/100"; import c101 from "../chains/101"; import c102 from "../chains/102"; +import c103 from "../chains/103"; import c104 from "../chains/104"; import c105 from "../chains/105"; import c106 from "../chains/106"; import c107 from "../chains/107"; import c108 from "../chains/108"; +import c109 from "../chains/109"; import c110 from "../chains/110"; import c111 from "../chains/111"; import c112 from "../chains/112"; @@ -170,6 +171,7 @@ import c242 from "../chains/242"; import c246 from "../chains/246"; import c248 from "../chains/248"; import c250 from "../chains/250"; +import c255 from "../chains/255"; import c256 from "../chains/256"; import c258 from "../chains/258"; import c259 from "../chains/259"; @@ -242,6 +244,7 @@ import c647 from "../chains/647"; import c648 from "../chains/648"; import c666 from "../chains/666"; import c667 from "../chains/667"; +import c668 from "../chains/668"; import c669 from "../chains/669"; import c686 from "../chains/686"; import c700 from "../chains/700"; @@ -311,8 +314,10 @@ import c1072 from "../chains/1072"; import c1079 from "../chains/1079"; import c1080 from "../chains/1080"; import c1088 from "../chains/1088"; +import c1089 from "../chains/1089"; import c1099 from "../chains/1099"; import c1101 from "../chains/1101"; +import c1107 from "../chains/1107"; import c1111 from "../chains/1111"; import c1112 from "../chains/1112"; import c1115 from "../chains/1115"; @@ -419,6 +424,7 @@ import c2025 from "../chains/2025"; import c2031 from "../chains/2031"; import c2032 from "../chains/2032"; import c2037 from "../chains/2037"; +import c2038 from "../chains/2038"; import c2043 from "../chains/2043"; import c2044 from "../chains/2044"; import c2047 from "../chains/2047"; @@ -431,6 +437,7 @@ import c2101 from "../chains/2101"; import c2109 from "../chains/2109"; import c2122 from "../chains/2122"; import c2124 from "../chains/2124"; +import c2137 from "../chains/2137"; import c2138 from "../chains/2138"; import c2151 from "../chains/2151"; import c2152 from "../chains/2152"; @@ -488,7 +495,6 @@ import c3690 from "../chains/3690"; import c3693 from "../chains/3693"; import c3698 from "../chains/3698"; import c3699 from "../chains/3699"; -import c3701 from "../chains/3701"; import c3737 from "../chains/3737"; import c3797 from "../chains/3797"; import c3888 from "../chains/3888"; @@ -532,6 +538,7 @@ import c5177 from "../chains/5177"; import c5197 from "../chains/5197"; import c5234 from "../chains/5234"; import c5315 from "../chains/5315"; +import c5353 from "../chains/5353"; import c5551 from "../chains/5551"; import c5553 from "../chains/5553"; import c5555 from "../chains/5555"; @@ -644,6 +651,7 @@ import c10200 from "../chains/10200"; import c10201 from "../chains/10201"; import c10243 from "../chains/10243"; import c10248 from "../chains/10248"; +import c10395 from "../chains/10395"; import c10507 from "../chains/10507"; import c10508 from "../chains/10508"; import c10823 from "../chains/10823"; @@ -657,6 +665,7 @@ import c11235 from "../chains/11235"; import c11437 from "../chains/11437"; import c11612 from "../chains/11612"; import c11888 from "../chains/11888"; +import c11891 from "../chains/11891"; import c12009 from "../chains/12009"; import c12051 from "../chains/12051"; import c12052 from "../chains/12052"; @@ -724,6 +733,7 @@ import c33333 from "../chains/33333"; import c35011 from "../chains/35011"; import c35441 from "../chains/35441"; import c35443 from "../chains/35443"; +import c38401 from "../chains/38401"; import c39797 from "../chains/39797"; import c39815 from "../chains/39815"; import c41500 from "../chains/41500"; @@ -886,6 +896,7 @@ import c420666 from "../chains/420666"; import c420692 from "../chains/420692"; import c421611 from "../chains/421611"; import c421613 from "../chains/421613"; +import c421614 from "../chains/421614"; import c424242 from "../chains/424242"; import c431140 from "../chains/431140"; import c432201 from "../chains/432201"; @@ -900,6 +911,7 @@ import c534352 from "../chains/534352"; import c534353 from "../chains/534353"; import c534849 from "../chains/534849"; import c535037 from "../chains/535037"; +import c622277 from "../chains/622277"; import c641230 from "../chains/641230"; import c651940 from "../chains/651940"; import c666666 from "../chains/666666"; @@ -1029,7 +1041,6 @@ export { default as ExpanseNetwork } from "../chains/2" export { default as Ropsten } from "../chains/3" export { default as Rinkeby } from "../chains/4" export { default as Goerli } from "../chains/5" -export { default as EthereumClassicTestnetKotti } from "../chains/6" export { default as Thaichain } from "../chains/7" export { default as Ubiq } from "../chains/8" export { default as UbiqNetworkTestnet } from "../chains/9" @@ -1066,7 +1077,7 @@ export { default as TelosEvm } from "../chains/40" export { default as TelosEvmTestnet } from "../chains/41" export { default as Lukso } from "../chains/42" export { default as DarwiniaPangolinTestnet } from "../chains/43" -export { default as DarwiniaCrabNetwork } from "../chains/44" +export { default as CrabNetwork } from "../chains/44" export { default as DarwiniaPangoroTestnet } from "../chains/45" export { default as DarwiniaNetwork } from "../chains/46" export { default as EnnothemProterozoic } from "../chains/48" @@ -1123,11 +1134,13 @@ export { default as PoaNetworkCore } from "../chains/99" export { default as Gnosis } from "../chains/100" export { default as Etherinc } from "../chains/101" export { default as Web3gamesTestnet } from "../chains/102" +export { default as Worldland } from "../chains/103" export { default as KaibaLightningChainTestnet } from "../chains/104" export { default as Web3gamesDevnet } from "../chains/105" export { default as VelasEvm } from "../chains/106" export { default as NebulaTestnet } from "../chains/107" export { default as Thundercore } from "../chains/108" +export { default as Shibarium } from "../chains/109" export { default as ProtonTestnet } from "../chains/110" export { default as EtherliteChain } from "../chains/111" export { default as Coinbit } from "../chains/112" @@ -1196,6 +1209,7 @@ export { default as Plinga } from "../chains/242" export { default as EnergyWebChain } from "../chains/246" export { default as Oasys } from "../chains/248" export { default as Fantom } from "../chains/250" +export { default as Kroma } from "../chains/255" export { default as HuobiEcoChainTestnet } from "../chains/256" export { default as Setheum } from "../chains/258" export { default as Neonlink } from "../chains/259" @@ -1268,7 +1282,8 @@ export { default as SxNetworkTestnet } from "../chains/647" export { default as EnduranceSmartChain } from "../chains/648" export { default as PixieChainTestnet } from "../chains/666" export { default as LaosArrakis } from "../chains/667" -export { default as JuncaglobalChainTestnet } from "../chains/669" +export { default as Juncachain } from "../chains/668" +export { default as JuncachainTestnet } from "../chains/669" export { default as KaruraNetwork } from "../chains/686" export { default as StarSocialTestnet } from "../chains/700" export { default as BlockchainStation } from "../chains/707" @@ -1337,8 +1352,10 @@ export { default as ShimmerevmTestnet } from "../chains/1072" export { default as MintaraTestnet } from "../chains/1079" export { default as Mintara } from "../chains/1080" export { default as MetisAndromeda } from "../chains/1088" +export { default as HumansAi } from "../chains/1089" export { default as Moac } from "../chains/1099" export { default as PolygonZkevm } from "../chains/1101" +export { default as BlxqTestnet } from "../chains/1107" export { default as Wemix30 } from "../chains/1111" export { default as Wemix30Testnet } from "../chains/1112" export { default as CoreBlockchainTestnet } from "../chains/1115" @@ -1445,6 +1462,7 @@ export { default as RangersProtocol } from "../chains/2025" export { default as Centrifuge } from "../chains/2031" export { default as Catalyst } from "../chains/2032" export { default as KiwiSubnet } from "../chains/2037" +export { default as ShrapnelTestnet } from "../chains/2038" export { default as OrigintrailParachain } from "../chains/2043" export { default as ShrapnelSubnet } from "../chains/2044" export { default as StratosTestnet } from "../chains/2047" @@ -1457,6 +1475,7 @@ export { default as EcoballTestnetEspuma } from "../chains/2101" export { default as ExosamaNetwork } from "../chains/2109" export { default as Metaplayerone } from "../chains/2122" export { default as MetaplayeroneDubaiTestnet } from "../chains/2124" +export { default as Bigshortbets } from "../chains/2137" export { default as DefiOracleMetaTestnet } from "../chains/2138" export { default as Bosagora } from "../chains/2151" export { default as Findora } from "../chains/2152" @@ -1514,7 +1533,6 @@ export { default as Bittex } from "../chains/3690" export { default as EmpireNetwork } from "../chains/3693" export { default as SenjepowersTestnet } from "../chains/3698" export { default as Senjepowers } from "../chains/3699" -export { default as XplaTestnet } from "../chains/3701" export { default as Crossbell } from "../chains/3737" export { default as Alveychain } from "../chains/3797" export { default as Kalychain } from "../chains/3888" @@ -1558,6 +1576,7 @@ export { default as TlchainNetwork } from "../chains/5177" export { default as Eraswap } from "../chains/5197" export { default as Humanode } from "../chains/5234" export { default as UzmiNetwork } from "../chains/5315" +export { default as TritaniumTestnet } from "../chains/5353" export { default as Nahmii } from "../chains/5551" export { default as NahmiiTestnet } from "../chains/5553" export { default as ChainVerse } from "../chains/5555" @@ -1670,6 +1689,7 @@ export { default as GnosisChiadoTestnet } from "../chains/10200" export { default as Maxxchain } from "../chains/10201" export { default as ArtheraTestnet } from "../chains/10243" export { default as _0xtade } from "../chains/10248" +export { default as WorldlandTestnet } from "../chains/10395" export { default as Numbers } from "../chains/10507" export { default as NumbersTestnet } from "../chains/10508" export { default as Cryptocoinpay } from "../chains/10823" @@ -1683,6 +1703,7 @@ export { default as HaqqNetwork } from "../chains/11235" export { default as ShyftTestnet } from "../chains/11437" export { default as SardisTestnet } from "../chains/11612" export { default as SanrChain } from "../chains/11888" +export { default as PolygonSupernetArianee } from "../chains/11891" export { default as Satoshichain } from "../chains/12009" export { default as SingularityZeroTestnet } from "../chains/12051" export { default as SingularityZero } from "../chains/12052" @@ -1750,6 +1771,7 @@ export { default as Aves } from "../chains/33333" export { default as J2oTaro } from "../chains/35011" export { default as Q } from "../chains/35441" export { default as QTestnet } from "../chains/35443" +export { default as ConnectormanagerRobin } from "../chains/38401" export { default as Energi } from "../chains/39797" export { default as Oho } from "../chains/39815" export { default as OpulentXBeta } from "../chains/41500" @@ -1836,7 +1858,7 @@ export { default as Cybertrust } from "../chains/85449" export { default as NautilusProteusTestnet } from "../chains/88002" export { default as ChilizScovilleTestnet } from "../chains/88880" export { default as BeverlyHills } from "../chains/90210" -export { default as NautilusChain } from "../chains/91002" +export { default as NautilusTritionChain } from "../chains/91002" export { default as LambdaTestnet } from "../chains/92001" export { default as MantisTestnetHexapod } from "../chains/96970" export { default as ElibertyTestnet } from "../chains/99099" @@ -1912,6 +1934,7 @@ export { default as KekchainKektest } from "../chains/420666" export { default as AlteriumL2Testnet } from "../chains/420692" export { default as ArbitrumRinkeby } from "../chains/421611" export { default as ArbitrumGoerli } from "../chains/421613" +export { default as ArbitrumSepolia } from "../chains/421614" export { default as FastexChainTestnet } from "../chains/424242" export { default as MarkrGo } from "../chains/431140" export { default as DexalotSubnetTestnet } from "../chains/432201" @@ -1926,6 +1949,7 @@ export { default as Scroll } from "../chains/534352" export { default as ScrollAlphaTestnet } from "../chains/534353" export { default as ShinariumBeta } from "../chains/534849" export { default as BeanecoSmartchain } from "../chains/535037" +export { default as Rethereum } from "../chains/622277" export { default as BearNetworkChain } from "../chains/641230" export { default as All } from "../chains/651940" export { default as VisionVpioneerTestChain } from "../chains/666666" @@ -2038,7 +2062,7 @@ export { default as ProofofpepeTestnet } from "../chains/331769" export { default as Pop } from "../chains/331771" export { default as Xpla } from "../chains/37" export { default as Omega } from "../chains/408" -export { default as XplaTestnetXplaTest } from "../chains/47" +export { default as XplaTestnet } from "../chains/47" export { default as XaiGoerliOrbit } from "../chains/47279324479" export { default as OpbnbTestnet } from "../chains/5611" export { default as Linea } from "../chains/59144" @@ -2052,7 +2076,7 @@ export * from "./types"; export * from "./utils"; export const defaultChains = [c1, c5, c8453, c84531, c137, c80001, c42161, c421613, c10, c420, c56, c97, c250, c4002, c43114, c43113, c1337]; // @ts-expect-error - TODO: fix this later -export const allChains: Chain[] = [c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c38, c39, c40, c41, c42, c43, c44, c45, c46, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72, c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84, c85, c86, c87, c88, c89, c90, c91, c92, c93, c94, c95, c96, c97, c98, c99, c100, c101, c102, c104, c105, c106, c107, c108, c110, c111, c112, c113, c114, c117, c118, c119, c120, c121, c122, c123, c124, c125, c126, c127, c128, c134, c135, c136, c137, c138, c139, c141, c142, c144, c150, c151, c152, c153, c154, c155, c156, c160, c161, c162, c163, c165, c167, c168, c170, c172, c180, c186, c188, c189, c193, c195, c196, c197, c198, c199, c200, c201, c204, c208, c210, c211, c212, c217, c225, c226, c230, c236, c242, c246, c248, c250, c256, c258, c259, c262, c269, c271, c274, c280, c288, c295, c296, c297, c298, c301, c303, c311, c313, c314, c321, c322, c324, c333, c335, c336, c338, c345, c361, c363, c364, c365, c369, c371, c385, c400, c401, c411, c416, c418, c420, c424, c427, c443, c444, c456, c499, c500, c501, c512, c513, c516, c520, c529, c530, c534, c542, c555, c558, c568, c570, c592, c595, c596, c597, c599, c600, c601, c614, c634, c647, c648, c666, c667, c669, c686, c700, c707, c708, c719, c721, c741, c742, c766, c776, c777, c786, c787, c788, c789, c800, c803, c808, c813, c818, c820, c841, c842, c859, c868, c876, c877, c880, c888, c900, c901, c902, c903, c909, c910, c917, c942, c943, c956, c970, c971, c972, c977, c980, c985, c989, c990, c997, c998, c1000, c1001, c1004, c1007, c1008, c1010, c1012, c1022, c1023, c1024, c1028, c1030, c1031, c1038, c1039, c1072, c1079, c1080, c1088, c1099, c1101, c1111, c1112, c1115, c1116, c1117, c1130, c1131, c1138, c1139, c1140, c1149, c1170, c1177, c1197, c1201, c1202, c1213, c1214, c1229, c1230, c1231, c1234, c1243, c1244, c1246, c1252, c1280, c1284, c1285, c1287, c1288, c1291, c1294, c1297, c1311, c1314, c1319, c1320, c1338, c1339, c1353, c1369, c1379, c1388, c1392, c1433, c1440, c1442, c1452, c1455, c1501, c1506, c1507, c1515, c1559, c1618, c1620, c1657, c1663, c1688, c1701, c1707, c1708, c1718, c1773, c1777, c1804, c1807, c1818, c1819, c1856, c1875, c1881, c1890, c1891, c1898, c1907, c1908, c1945, c1951, c1954, c1967, c1969, c1970, c1971, c1975, c1984, c1987, c1994, c1995, c2000, c2001, c2002, c2008, c2009, c2016, c2018, c2019, c2020, c2021, c2022, c2023, c2025, c2031, c2032, c2037, c2043, c2044, c2047, c2048, c2077, c2088, c2089, c2100, c2101, c2109, c2122, c2124, c2138, c2151, c2152, c2153, c2154, c2199, c2202, c2203, c2213, c2221, c2222, c2223, c2300, c2309, c2323, c2330, c2332, c2358, c2399, c2400, c2415, c2484, c2559, c2569, c2606, c2611, c2612, c2613, c2625, c2710, c2888, c2999, c3000, c3001, c3003, c3011, c3031, c3068, c3269, c3270, c3306, c3331, c3333, c3334, c3400, c3434, c3500, c3501, c3601, c3602, c3636, c3637, c3666, c3690, c3693, c3698, c3699, c3701, c3737, c3797, c3888, c3889, c3912, c3939, c3966, c3967, c3999, c4000, c4001, c4002, c4051, c4061, c4062, c4090, c4096, c4099, c4102, c4141, c4181, c4201, c4242, c4328, c4337, c4444, c4460, c4689, c4690, c4759, c4777, c4918, c4919, c4999, c5000, c5001, c5002, c5005, c5165, c5177, c5197, c5234, c5315, c5551, c5553, c5555, c5616, c5678, c5700, c5729, c5758, c5777, c5851, c5869, c6065, c6066, c6102, c6118, c6119, c6502, c6552, c6565, c6626, c6688, c6789, c6969, c6999, c7000, c7001, c7027, c7070, c7171, c7331, c7332, c7341, c7484, c7518, c7575, c7576, c7668, c7672, c7700, c7701, c7771, c7777, c7878, c7895, c7979, c8000, c8001, c8029, c8080, c8082, c8086, c8098, c8131, c8132, c8133, c8134, c8135, c8136, c8181, c8217, c8272, c8285, c8387, c8453, c8654, c8655, c8723, c8724, c8738, c8768, c8848, c8880, c8881, c8882, c8883, c8888, c8889, c8898, c8899, c8989, c8995, c9000, c9001, c9012, c9100, c9223, c9339, c9527, c9528, c9559, c9700, c9728, c9768, c9779, c9790, c9792, c9818, c9819, c9977, c9996, c9997, c9999, c10000, c10001, c10024, c10081, c10086, c10101, c10200, c10201, c10243, c10248, c10507, c10508, c10823, c10946, c10947, c11110, c11111, c11115, c11119, c11235, c11437, c11612, c11888, c12009, c12051, c12052, c12123, c12306, c12321, c12345, c12715, c13000, c13308, c13337, c13381, c13812, c14000, c14853, c15551, c15555, c15557, c16000, c16001, c16507, c16688, c16718, c16888, c17000, c17180, c17777, c18000, c18122, c18159, c18686, c19011, c19845, c20001, c20729, c20736, c21337, c21816, c22023, c22040, c22222, c22776, c23006, c23118, c23294, c23295, c24484, c24734, c25888, c25925, c26026, c26600, c26863, c28528, c30067, c31102, c31223, c31224, c31337, c32520, c32659, c32769, c33101, c33333, c35011, c35441, c35443, c39797, c39815, c41500, c42069, c42161, c42170, c42220, c42261, c42262, c42888, c43110, c43113, c43114, c43288, c44444, c44787, c45000, c46688, c47805, c49049, c49088, c49797, c50001, c50021, c51178, c51712, c53935, c54211, c54321, c55004, c55555, c55556, c56288, c56789, c57000, c58008, c59140, c60000, c60001, c60002, c60103, c61800, c61803, c61916, c62320, c62621, c63000, c63001, c65450, c67588, c69420, c70000, c70001, c70002, c70103, c71111, c71393, c71401, c71402, c73799, c73927, c75000, c77612, c77777, c78110, c78281, c78430, c78431, c78432, c79879, c80001, c81341, c81342, c81343, c81351, c81352, c81353, c81361, c81362, c81363, c84531, c84886, c85449, c88002, c88880, c90210, c91002, c92001, c96970, c99099, c99998, c99999, c100000, c100001, c100002, c100003, c100004, c100005, c100006, c100007, c100008, c100009, c100010, c101010, c103090, c108801, c110000, c110001, c110002, c110003, c110004, c110005, c110006, c110007, c110008, c111000, c111111, c112358, c123456, c131419, c142857, c167005, c167006, c188881, c200101, c200202, c200625, c201018, c201030, c201804, c202020, c202624, c210425, c220315, c221230, c221231, c224168, c230315, c234666, c246529, c246785, c247253, c256256, c266256, c271271, c281121, c314159, c330844, c333331, c333777, c333888, c333999, c355113, c373737, c381931, c381932, c404040, c420420, c420666, c420692, c421611, c421613, c424242, c431140, c432201, c432204, c444900, c471100, c474142, c512512, c513100, c534351, c534352, c534353, c534849, c535037, c641230, c651940, c666666, c751230, c761412, c800001, c827431, c846000, c888888, c900000, c910000, c920000, c920001, c923018, c955305, c1313114, c1313500, c1337702, c1337802, c1337803, c2021398, c2099156, c2206132, c3141592, c3441005, c4000003, c4281033, c5167003, c5555555, c5555558, c7225878, c7355310, c7668378, c7762959, c7777777, c8007736, c8794598, c8888881, c8888888, c10067275, c10101010, c11155111, c13371337, c14288640, c16658437, c18289463, c20180430, c20181205, c20201022, c22052002, c27082017, c27082022, c28945486, c29032022, c31415926, c35855456, c43214913, c61717561, c65010000, c65100000, c88888888, c99415706, c192837465, c222000222, c245022926, c245022934, c245022940, c278611351, c311752642, c333000333, c344106930, c356256156, c486217935, c503129905, c1122334455, c1146703430, c1273227453, c1313161554, c1313161555, c1313161556, c1351057110, c1380996178, c1482601649, c1564830818, c1666600000, c1666600001, c1666600002, c1666600003, c1666700000, c1666700001, c1666900000, c1666900001, c2021121117, c2046399126, c2863311531, c3125659152, c4216137055, c11297108099, c11297108109, c111222333444, c197710212030, c197710212031, c383414847825, c666301171999, c6022140761023, c1337, c1440001, c1582, c331769, c331771, c37, c408, c47, c47279324479, c5611, c59144, c8081, c88882, c88888, c91003, c919, c999]; +export const allChains: Chain[] = [c1, c2, c3, c4, c5, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c38, c39, c40, c41, c42, c43, c44, c45, c46, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72, c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84, c85, c86, c87, c88, c89, c90, c91, c92, c93, c94, c95, c96, c97, c98, c99, c100, c101, c102, c103, c104, c105, c106, c107, c108, c109, c110, c111, c112, c113, c114, c117, c118, c119, c120, c121, c122, c123, c124, c125, c126, c127, c128, c134, c135, c136, c137, c138, c139, c141, c142, c144, c150, c151, c152, c153, c154, c155, c156, c160, c161, c162, c163, c165, c167, c168, c170, c172, c180, c186, c188, c189, c193, c195, c196, c197, c198, c199, c200, c201, c204, c208, c210, c211, c212, c217, c225, c226, c230, c236, c242, c246, c248, c250, c255, c256, c258, c259, c262, c269, c271, c274, c280, c288, c295, c296, c297, c298, c301, c303, c311, c313, c314, c321, c322, c324, c333, c335, c336, c338, c345, c361, c363, c364, c365, c369, c371, c385, c400, c401, c411, c416, c418, c420, c424, c427, c443, c444, c456, c499, c500, c501, c512, c513, c516, c520, c529, c530, c534, c542, c555, c558, c568, c570, c592, c595, c596, c597, c599, c600, c601, c614, c634, c647, c648, c666, c667, c668, c669, c686, c700, c707, c708, c719, c721, c741, c742, c766, c776, c777, c786, c787, c788, c789, c800, c803, c808, c813, c818, c820, c841, c842, c859, c868, c876, c877, c880, c888, c900, c901, c902, c903, c909, c910, c917, c942, c943, c956, c970, c971, c972, c977, c980, c985, c989, c990, c997, c998, c1000, c1001, c1004, c1007, c1008, c1010, c1012, c1022, c1023, c1024, c1028, c1030, c1031, c1038, c1039, c1072, c1079, c1080, c1088, c1089, c1099, c1101, c1107, c1111, c1112, c1115, c1116, c1117, c1130, c1131, c1138, c1139, c1140, c1149, c1170, c1177, c1197, c1201, c1202, c1213, c1214, c1229, c1230, c1231, c1234, c1243, c1244, c1246, c1252, c1280, c1284, c1285, c1287, c1288, c1291, c1294, c1297, c1311, c1314, c1319, c1320, c1338, c1339, c1353, c1369, c1379, c1388, c1392, c1433, c1440, c1442, c1452, c1455, c1501, c1506, c1507, c1515, c1559, c1618, c1620, c1657, c1663, c1688, c1701, c1707, c1708, c1718, c1773, c1777, c1804, c1807, c1818, c1819, c1856, c1875, c1881, c1890, c1891, c1898, c1907, c1908, c1945, c1951, c1954, c1967, c1969, c1970, c1971, c1975, c1984, c1987, c1994, c1995, c2000, c2001, c2002, c2008, c2009, c2016, c2018, c2019, c2020, c2021, c2022, c2023, c2025, c2031, c2032, c2037, c2038, c2043, c2044, c2047, c2048, c2077, c2088, c2089, c2100, c2101, c2109, c2122, c2124, c2137, c2138, c2151, c2152, c2153, c2154, c2199, c2202, c2203, c2213, c2221, c2222, c2223, c2300, c2309, c2323, c2330, c2332, c2358, c2399, c2400, c2415, c2484, c2559, c2569, c2606, c2611, c2612, c2613, c2625, c2710, c2888, c2999, c3000, c3001, c3003, c3011, c3031, c3068, c3269, c3270, c3306, c3331, c3333, c3334, c3400, c3434, c3500, c3501, c3601, c3602, c3636, c3637, c3666, c3690, c3693, c3698, c3699, c3737, c3797, c3888, c3889, c3912, c3939, c3966, c3967, c3999, c4000, c4001, c4002, c4051, c4061, c4062, c4090, c4096, c4099, c4102, c4141, c4181, c4201, c4242, c4328, c4337, c4444, c4460, c4689, c4690, c4759, c4777, c4918, c4919, c4999, c5000, c5001, c5002, c5005, c5165, c5177, c5197, c5234, c5315, c5353, c5551, c5553, c5555, c5616, c5678, c5700, c5729, c5758, c5777, c5851, c5869, c6065, c6066, c6102, c6118, c6119, c6502, c6552, c6565, c6626, c6688, c6789, c6969, c6999, c7000, c7001, c7027, c7070, c7171, c7331, c7332, c7341, c7484, c7518, c7575, c7576, c7668, c7672, c7700, c7701, c7771, c7777, c7878, c7895, c7979, c8000, c8001, c8029, c8080, c8082, c8086, c8098, c8131, c8132, c8133, c8134, c8135, c8136, c8181, c8217, c8272, c8285, c8387, c8453, c8654, c8655, c8723, c8724, c8738, c8768, c8848, c8880, c8881, c8882, c8883, c8888, c8889, c8898, c8899, c8989, c8995, c9000, c9001, c9012, c9100, c9223, c9339, c9527, c9528, c9559, c9700, c9728, c9768, c9779, c9790, c9792, c9818, c9819, c9977, c9996, c9997, c9999, c10000, c10001, c10024, c10081, c10086, c10101, c10200, c10201, c10243, c10248, c10395, c10507, c10508, c10823, c10946, c10947, c11110, c11111, c11115, c11119, c11235, c11437, c11612, c11888, c11891, c12009, c12051, c12052, c12123, c12306, c12321, c12345, c12715, c13000, c13308, c13337, c13381, c13812, c14000, c14853, c15551, c15555, c15557, c16000, c16001, c16507, c16688, c16718, c16888, c17000, c17180, c17777, c18000, c18122, c18159, c18686, c19011, c19845, c20001, c20729, c20736, c21337, c21816, c22023, c22040, c22222, c22776, c23006, c23118, c23294, c23295, c24484, c24734, c25888, c25925, c26026, c26600, c26863, c28528, c30067, c31102, c31223, c31224, c31337, c32520, c32659, c32769, c33101, c33333, c35011, c35441, c35443, c38401, c39797, c39815, c41500, c42069, c42161, c42170, c42220, c42261, c42262, c42888, c43110, c43113, c43114, c43288, c44444, c44787, c45000, c46688, c47805, c49049, c49088, c49797, c50001, c50021, c51178, c51712, c53935, c54211, c54321, c55004, c55555, c55556, c56288, c56789, c57000, c58008, c59140, c60000, c60001, c60002, c60103, c61800, c61803, c61916, c62320, c62621, c63000, c63001, c65450, c67588, c69420, c70000, c70001, c70002, c70103, c71111, c71393, c71401, c71402, c73799, c73927, c75000, c77612, c77777, c78110, c78281, c78430, c78431, c78432, c79879, c80001, c81341, c81342, c81343, c81351, c81352, c81353, c81361, c81362, c81363, c84531, c84886, c85449, c88002, c88880, c90210, c91002, c92001, c96970, c99099, c99998, c99999, c100000, c100001, c100002, c100003, c100004, c100005, c100006, c100007, c100008, c100009, c100010, c101010, c103090, c108801, c110000, c110001, c110002, c110003, c110004, c110005, c110006, c110007, c110008, c111000, c111111, c112358, c123456, c131419, c142857, c167005, c167006, c188881, c200101, c200202, c200625, c201018, c201030, c201804, c202020, c202624, c210425, c220315, c221230, c221231, c224168, c230315, c234666, c246529, c246785, c247253, c256256, c266256, c271271, c281121, c314159, c330844, c333331, c333777, c333888, c333999, c355113, c373737, c381931, c381932, c404040, c420420, c420666, c420692, c421611, c421613, c421614, c424242, c431140, c432201, c432204, c444900, c471100, c474142, c512512, c513100, c534351, c534352, c534353, c534849, c535037, c622277, c641230, c651940, c666666, c751230, c761412, c800001, c827431, c846000, c888888, c900000, c910000, c920000, c920001, c923018, c955305, c1313114, c1313500, c1337702, c1337802, c1337803, c2021398, c2099156, c2206132, c3141592, c3441005, c4000003, c4281033, c5167003, c5555555, c5555558, c7225878, c7355310, c7668378, c7762959, c7777777, c8007736, c8794598, c8888881, c8888888, c10067275, c10101010, c11155111, c13371337, c14288640, c16658437, c18289463, c20180430, c20181205, c20201022, c22052002, c27082017, c27082022, c28945486, c29032022, c31415926, c35855456, c43214913, c61717561, c65010000, c65100000, c88888888, c99415706, c192837465, c222000222, c245022926, c245022934, c245022940, c278611351, c311752642, c333000333, c344106930, c356256156, c486217935, c503129905, c1122334455, c1146703430, c1273227453, c1313161554, c1313161555, c1313161556, c1351057110, c1380996178, c1482601649, c1564830818, c1666600000, c1666600001, c1666600002, c1666600003, c1666700000, c1666700001, c1666900000, c1666900001, c2021121117, c2046399126, c2863311531, c3125659152, c4216137055, c11297108099, c11297108109, c111222333444, c197710212030, c197710212031, c383414847825, c666301171999, c6022140761023, c1337, c1440001, c1582, c331769, c331771, c37, c408, c47, c47279324479, c5611, c59144, c8081, c88882, c88888, c91003, c919, c999]; type ChainsById = { 1: typeof c1, @@ -2060,7 +2084,6 @@ type ChainsById = { 3: typeof c3, 4: typeof c4, 5: typeof c5, -6: typeof c6, 7: typeof c7, 8: typeof c8, 9: typeof c9, @@ -2154,11 +2177,13 @@ type ChainsById = { 100: typeof c100, 101: typeof c101, 102: typeof c102, +103: typeof c103, 104: typeof c104, 105: typeof c105, 106: typeof c106, 107: typeof c107, 108: typeof c108, +109: typeof c109, 110: typeof c110, 111: typeof c111, 112: typeof c112, @@ -2227,6 +2252,7 @@ type ChainsById = { 246: typeof c246, 248: typeof c248, 250: typeof c250, +255: typeof c255, 256: typeof c256, 258: typeof c258, 259: typeof c259, @@ -2299,6 +2325,7 @@ type ChainsById = { 648: typeof c648, 666: typeof c666, 667: typeof c667, +668: typeof c668, 669: typeof c669, 686: typeof c686, 700: typeof c700, @@ -2368,8 +2395,10 @@ type ChainsById = { 1079: typeof c1079, 1080: typeof c1080, 1088: typeof c1088, +1089: typeof c1089, 1099: typeof c1099, 1101: typeof c1101, +1107: typeof c1107, 1111: typeof c1111, 1112: typeof c1112, 1115: typeof c1115, @@ -2476,6 +2505,7 @@ type ChainsById = { 2031: typeof c2031, 2032: typeof c2032, 2037: typeof c2037, +2038: typeof c2038, 2043: typeof c2043, 2044: typeof c2044, 2047: typeof c2047, @@ -2488,6 +2518,7 @@ type ChainsById = { 2109: typeof c2109, 2122: typeof c2122, 2124: typeof c2124, +2137: typeof c2137, 2138: typeof c2138, 2151: typeof c2151, 2152: typeof c2152, @@ -2545,7 +2576,6 @@ type ChainsById = { 3693: typeof c3693, 3698: typeof c3698, 3699: typeof c3699, -3701: typeof c3701, 3737: typeof c3737, 3797: typeof c3797, 3888: typeof c3888, @@ -2589,6 +2619,7 @@ type ChainsById = { 5197: typeof c5197, 5234: typeof c5234, 5315: typeof c5315, +5353: typeof c5353, 5551: typeof c5551, 5553: typeof c5553, 5555: typeof c5555, @@ -2701,6 +2732,7 @@ type ChainsById = { 10201: typeof c10201, 10243: typeof c10243, 10248: typeof c10248, +10395: typeof c10395, 10507: typeof c10507, 10508: typeof c10508, 10823: typeof c10823, @@ -2714,6 +2746,7 @@ type ChainsById = { 11437: typeof c11437, 11612: typeof c11612, 11888: typeof c11888, +11891: typeof c11891, 12009: typeof c12009, 12051: typeof c12051, 12052: typeof c12052, @@ -2781,6 +2814,7 @@ type ChainsById = { 35011: typeof c35011, 35441: typeof c35441, 35443: typeof c35443, +38401: typeof c38401, 39797: typeof c39797, 39815: typeof c39815, 41500: typeof c41500, @@ -2943,6 +2977,7 @@ type ChainsById = { 420692: typeof c420692, 421611: typeof c421611, 421613: typeof c421613, +421614: typeof c421614, 424242: typeof c424242, 431140: typeof c431140, 432201: typeof c432201, @@ -2957,6 +2992,7 @@ type ChainsById = { 534353: typeof c534353, 534849: typeof c534849, 535037: typeof c535037, +622277: typeof c622277, 641230: typeof c641230, 651940: typeof c651940, 666666: typeof c666666, @@ -3087,7 +3123,6 @@ type ChainIdsBySlug = { "ropsten": 3, "rinkeby": 4, "goerli": 5, -"ethereum-classic-testnet-kotti": 6, "thaichain": 7, "ubiq": 8, "ubiq-network-testnet": 9, @@ -3124,7 +3159,7 @@ type ChainIdsBySlug = { "telos-evm-testnet": 41, "lukso": 42, "darwinia-pangolin-testnet": 43, -"darwinia-crab-network": 44, +"crab-network": 44, "darwinia-pangoro-testnet": 45, "darwinia-network": 46, "ennothem-proterozoic": 48, @@ -3181,11 +3216,13 @@ type ChainIdsBySlug = { "gnosis": 100, "etherinc": 101, "web3games-testnet": 102, +"worldland": 103, "kaiba-lightning-chain-testnet": 104, "web3games-devnet": 105, "velas-evm": 106, "nebula-testnet": 107, "thundercore": 108, +"shibarium": 109, "proton-testnet": 110, "etherlite-chain": 111, "coinbit": 112, @@ -3254,6 +3291,7 @@ type ChainIdsBySlug = { "energy-web-chain": 246, "oasys": 248, "fantom": 250, +"kroma": 255, "huobi-eco-chain-testnet": 256, "setheum": 258, "neonlink": 259, @@ -3326,7 +3364,8 @@ type ChainIdsBySlug = { "endurance-smart-chain": 648, "pixie-chain-testnet": 666, "laos-arrakis": 667, -"juncaglobal-chain-testnet": 669, +"juncachain": 668, +"juncachain-testnet": 669, "karura-network": 686, "star-social-testnet": 700, "blockchain-station": 707, @@ -3395,8 +3434,10 @@ type ChainIdsBySlug = { "mintara-testnet": 1079, "mintara": 1080, "metis-andromeda": 1088, +"humans-ai": 1089, "moac": 1099, "polygon-zkevm": 1101, +"blxq-testnet": 1107, "wemix3-0": 1111, "wemix3-0-testnet": 1112, "core-blockchain-testnet": 1115, @@ -3503,6 +3544,7 @@ type ChainIdsBySlug = { "centrifuge": 2031, "catalyst": 2032, "kiwi-subnet": 2037, +"shrapnel-testnet": 2038, "origintrail-parachain": 2043, "shrapnel-subnet": 2044, "stratos-testnet": 2047, @@ -3515,6 +3557,7 @@ type ChainIdsBySlug = { "exosama-network": 2109, "metaplayerone": 2122, "metaplayerone-dubai-testnet": 2124, +"bigshortbets": 2137, "defi-oracle-meta-testnet": 2138, "bosagora": 2151, "findora": 2152, @@ -3572,7 +3615,6 @@ type ChainIdsBySlug = { "empire-network": 3693, "senjepowers-testnet": 3698, "senjepowers": 3699, -"xpla-testnet": 3701, "crossbell": 3737, "alveychain": 3797, "kalychain": 3888, @@ -3616,6 +3658,7 @@ type ChainIdsBySlug = { "eraswap": 5197, "humanode": 5234, "uzmi-network": 5315, +"tritanium-testnet": 5353, "nahmii": 5551, "nahmii-testnet": 5553, "chain-verse": 5555, @@ -3728,6 +3771,7 @@ type ChainIdsBySlug = { "maxxchain": 10201, "arthera-testnet": 10243, "0xtade": 10248, +"worldland-testnet": 10395, "numbers": 10507, "numbers-testnet": 10508, "cryptocoinpay": 10823, @@ -3741,6 +3785,7 @@ type ChainIdsBySlug = { "shyft-testnet": 11437, "sardis-testnet": 11612, "sanr-chain": 11888, +"polygon-supernet-arianee": 11891, "satoshichain": 12009, "singularity-zero-testnet": 12051, "singularity-zero": 12052, @@ -3808,6 +3853,7 @@ type ChainIdsBySlug = { "j2o-taro": 35011, "q": 35441, "q-testnet": 35443, +"connectormanager-robin": 38401, "energi": 39797, "oho": 39815, "opulent-x-beta": 41500, @@ -3894,7 +3940,7 @@ type ChainIdsBySlug = { "nautilus-proteus-testnet": 88002, "chiliz-scoville-testnet": 88880, "beverly-hills": 90210, -"nautilus-chain": 91002, +"nautilus-trition-chain": 91002, "lambda-testnet": 92001, "mantis-testnet-hexapod": 96970, "eliberty-testnet": 99099, @@ -3970,6 +4016,7 @@ type ChainIdsBySlug = { "alterium-l2-testnet": 420692, "arbitrum-rinkeby": 421611, "arbitrum-goerli": 421613, +"arbitrum-sepolia": 421614, "fastex-chain-testnet": 424242, "markr-go": 431140, "dexalot-subnet-testnet": 432201, @@ -3984,6 +4031,7 @@ type ChainIdsBySlug = { "scroll-alpha-testnet": 534353, "shinarium-beta": 534849, "beaneco-smartchain": 535037, +"rethereum": 622277, "bear-network-chain": 641230, "all": 651940, "vision-vpioneer-test-chain": 666666, @@ -4096,7 +4144,7 @@ type ChainIdsBySlug = { "pop": 331771, "xpla": 37, "omega": 408, -"xpla-testnet-xpla-test": 47, +"xpla-testnet": 47, "xai-goerli-orbit": 47279324479, "opbnb-testnet": 5611, "linea": 59144, diff --git a/packages/react-native/src/evm/assets/right-arrow.tsx b/packages/react-native/src/evm/assets/right-arrow.tsx index 4aedf608a8a..13872b78ce7 100644 --- a/packages/react-native/src/evm/assets/right-arrow.tsx +++ b/packages/react-native/src/evm/assets/right-arrow.tsx @@ -1,7 +1,11 @@ import { IconStyleProp } from "./types"; import Svg, { Path } from "react-native-svg"; -const RightArrowIcon = ({ width, height, color }: IconStyleProp) => { +const RightArrowIcon = ({ + width, + height, + color = "#646D7A", +}: IconStyleProp) => { return ( { Animated.timing(fadeAnim, { @@ -71,6 +73,12 @@ export const ConnectWallet = ({ }).start(); }, [fadeAnim]); + useEffect(() => { + if (theme) { + setTheme(theme); + } + }, [setTheme, theme]); + return ( diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectWalletDetailsModal.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectWalletDetailsModal.tsx index 6bc175b042e..8a41428d8ea 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectWalletDetailsModal.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectWalletDetailsModal.tsx @@ -18,11 +18,11 @@ import { useSmartWallet } from "../../providers/context-provider"; import BaseButton from "../base/BaseButton"; import { SmartWalletAdditionalActions } from "./SmartWalletAdditionalActions"; import Text from "../base/Text"; -import { useAppTheme } from "../../styles/hooks"; import { LocalWalletImportModal } from "../ConnectWalletFlow/LocalWalletImportModal"; import { IconTextButton } from "../base/IconTextButton"; import MoneyIcon from "../../assets/money"; import { TWModal } from "../base/modal/TWModal"; +import { ThemeProvider } from "../../styles/ThemeProvider"; const MODAL_HEIGHT = Dimensions.get("window").height * 0.7; const DEVICE_WIDTH = Dimensions.get("window").width; @@ -40,7 +40,6 @@ export const ConnectWalletDetailsModal = ({ address?: string; hideTestnetFaucet?: boolean; }) => { - const theme = useAppTheme(); const [isExportModalVisible, setIsExportModalVisible] = useState(false); const activeWallet = useWallet(); const chain = useChain(); @@ -126,11 +125,7 @@ export const ConnectWalletDetailsModal = ({ Backup wallet - + Import wallet - + - - - - - - Current Network - - - {!hideTestnetFaucet && chain?.testnet && chain?.faucets?.length ? ( - } - onPress={() => { - if (chain?.faucets?.[0]) { - Linking.openURL(chain.faucets[0]); - } - }} + + + + + - ) : null} - {getAdditionalActions()} - {extraRows ? extraRows({}) : null} - {addressCopied === true ? ( - - ) : null} + + + Current Network + + + {!hideTestnetFaucet && chain?.testnet && chain?.faucets?.length ? ( + } + onPress={() => { + if (chain?.faucets?.[0]) { + Linking.openURL(chain.faucets[0]); + } + }} + /> + ) : null} + {getAdditionalActions()} + {extraRows ? extraRows({}) : null} + {addressCopied === true ? ( + + ) : null} + - - + + ); }; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx index 40316194949..9e444f39e0c 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx @@ -29,7 +29,7 @@ export const ChooseWalletContent = ({ diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx index aa0772597cc..7333fd28f49 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx @@ -4,6 +4,7 @@ import { useConnectionStatus, useWallets } from "@thirdweb-dev/react-core"; import { useState, useEffect } from "react"; import { useModalState } from "../../providers/ui-context-provider"; import { ThemeProvider, ThemeProviderProps } from "../../styles/ThemeProvider"; +import { useAppTheme } from "../../styles/hooks"; export type ConnectWalletButtonProps = { theme?: ThemeProviderProps["theme"]; @@ -24,6 +25,7 @@ export const ConnectWalletButton = ({ buttonTitle, theme, }: ConnectWalletButtonProps) => { + const appTheme = useAppTheme(); const connectionStatus = useConnectionStatus(); const isWalletConnecting = connectionStatus === "connecting"; @@ -67,7 +69,7 @@ export const ConnectWalletButton = ({ }; return ( - + { const { modalState, setModalState } = useModalState(); @@ -24,6 +26,7 @@ export const ConnectWalletFlow = () => { const [selectionData, setSelectionData] = useState(); const supportedWallets = useWallets(); const theme = useColorScheme(); + const appTheme = useAppTheme(); const connect = useConnect(); const onClose = useCallback( @@ -128,33 +131,35 @@ export const ConnectWalletFlow = () => { ]); return ( - - {activeWallet ? ( - isConnecting ? ( - - Creating, encrypting and securing your device wallet. - - ) : undefined - } - wallet={activeWallet} + + + {activeWallet ? ( + isConnecting ? ( + + Creating, encrypting and securing your device wallet. + + ) : undefined + } + wallet={activeWallet} + onClose={onClose} + onBackPress={onBackPress} + /> + ) : ( + getComponentForWallet() + ) + ) : ( + - ) : ( - getComponentForWallet() - ) - ) : ( - - )} - + )} + + ); }; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx index 7bb757e51a3..dac9c67e8bd 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx @@ -137,6 +137,7 @@ export const SmartWalletFlow = ({ return ( <> + { "Choose a personal wallet that acts as your account's key. This controls access to your account. " } diff --git a/packages/react-native/src/evm/components/MainModal.tsx b/packages/react-native/src/evm/components/MainModal.tsx index eeb8acf652e..6ff909bcdc3 100644 --- a/packages/react-native/src/evm/components/MainModal.tsx +++ b/packages/react-native/src/evm/components/MainModal.tsx @@ -4,17 +4,15 @@ import { Dimensions, StyleSheet, View } from "react-native"; import { useMemo } from "react"; import { CLOSE_MODAL_STATE } from "../utils/modalTypes"; import { ThemeProvider } from "../styles/ThemeProvider"; -import { useAppTheme } from "../styles/hooks"; import { SessionRequestModal } from "./ConnectWalletDetails/SessionRequestModal"; import { SessionProposalModal } from "./ConnectWalletDetails/SessionProposalModal"; import { TWModal } from "./base/modal/TWModal"; +import Box from "./base/Box"; const MODAL_HEIGHT = Dimensions.get("window").height * 0.6; const DEVICE_WIDTH = Dimensions.get("window").width; export const MainModal = () => { - const theme = useAppTheme(); - const { modalState, setModalState } = useModalState(); const { isOpen, isSheet } = modalState; @@ -39,14 +37,12 @@ export const MainModal = () => { }; return ( - + {isSheet ? ( - + {view} - + ) : ( view )} diff --git a/packages/react-native/src/evm/components/Web3Button.tsx b/packages/react-native/src/evm/components/Web3Button.tsx index d6c4cfae5f2..cf85822d38a 100644 --- a/packages/react-native/src/evm/components/Web3Button.tsx +++ b/packages/react-native/src/evm/components/Web3Button.tsx @@ -18,6 +18,7 @@ import type { CallOverrides, ContractInterface } from "ethers"; import { PropsWithChildren, useEffect } from "react"; import { ActivityIndicator, StyleSheet } from "react-native"; import invariant from "tiny-invariant"; +import { useUIContext } from "../providers/ui-context-provider"; type ActionFn = (contract: SmartContract) => Promise; @@ -82,11 +83,18 @@ export const Web3Button = ({ const needToSwitchChain = sdkChainId && walletChainId && sdkChainId !== walletChainId; const connectionStatus = useConnectionStatus(); + const setTheme = useUIContext().setTheme; const queryClient = useQueryClient(); const { contract } = useContract(contractAddress, contractAbi || "custom"); + useEffect(() => { + if (theme) { + setTheme(theme); + } + }, [setTheme, theme]); + const actionMutation = useMutation( async () => { invariant(contract, "contract is not ready yet"); @@ -153,7 +161,7 @@ export const Web3Button = ({ } return ( - + { diff --git a/packages/react-native/src/evm/providers/thirdweb-provider.tsx b/packages/react-native/src/evm/providers/thirdweb-provider.tsx index 63dd7c5ded5..6b301f78100 100644 --- a/packages/react-native/src/evm/providers/thirdweb-provider.tsx +++ b/packages/react-native/src/evm/providers/thirdweb-provider.tsx @@ -16,6 +16,7 @@ import { ThemeProvider } from "../styles/ThemeProvider"; import { SafeAreaProvider } from "react-native-safe-area-context"; import { walletIds } from "@thirdweb-dev/wallets"; import { ThirdwebStorage } from "../../core/storage/storage"; +import { useColorScheme } from "react-native"; interface ThirdwebProviderProps extends Omit< @@ -70,6 +71,7 @@ export const ThirdwebProvider = < sdkOptions, ...restProps }: PropsWithChildren>) => { + const colorScheme = useColorScheme(); useCoinbaseWalletListener( !!supportedWallets.find((w) => w.id === walletIds.coinbase), ); @@ -102,7 +104,9 @@ export const ThirdwebProvider = < {...sdkOptions} {...restProps} > - + {hasMagicConfig ? ( diff --git a/packages/react-native/src/evm/styles/ThemeProvider.tsx b/packages/react-native/src/evm/styles/ThemeProvider.tsx index 075b5ed8cf9..6cac2dfc722 100644 --- a/packages/react-native/src/evm/styles/ThemeProvider.tsx +++ b/packages/react-native/src/evm/styles/ThemeProvider.tsx @@ -3,6 +3,7 @@ import { ThemeProvider as ShopifyThemeProvider } from "@shopify/restyle"; import { ThirdwebThemeContext } from "@thirdweb-dev/react-core"; import { PropsWithChildren, useContext } from "react"; import { useColorScheme } from "react-native"; +import { useUIContext } from "../providers/ui-context-provider"; export type ThemeProviderProps = { theme?: Theme | "light" | "dark"; @@ -14,7 +15,9 @@ export function ThemeProvider({ }: PropsWithChildren) { const isDarkMode = useColorScheme() === "dark"; const themeFromCore = useContext(ThirdwebThemeContext); - const theme_ = theme || themeFromCore || (isDarkMode ? "dark" : "light"); + const themeFromRN = useUIContext().theme; + const theme_ = + theme || themeFromRN || themeFromCore || (isDarkMode ? "dark" : "light"); return ( > = (props) => { Date: Fri, 8 Sep 2023 18:54:17 -0400 Subject: [PATCH 07/18] recommended and getstarted --- packages/chains/chains/421614.ts | 2 +- packages/chains/chains/462.ts | 34 +++++++++++++++++++ packages/react-core/src/core/types/wallet.ts | 5 +++ .../ChooseWallet/ChooseWallet.tsx | 8 +++-- .../ChooseWallet/ChooseWalletContent.tsx | 16 +++++++-- .../src/evm/components/base/WalletButton.tsx | 11 ++++-- .../evm/wallets/wallets/coinbase-wallet.ts | 6 +++- .../src/evm/wallets/wallets/magic-link.tsx | 3 +- .../evm/wallets/wallets/metamask-wallet.ts | 6 ++-- .../src/evm/wallets/wallets/rainbow-wallet.ts | 6 ++-- .../src/evm/wallets/wallets/smart-wallet.ts | 4 ++- .../src/evm/wallets/wallets/trust-wallet.ts | 6 ++-- .../wallets/wallet-connect/wallet-connect.tsx | 2 ++ 13 files changed, 89 insertions(+), 20 deletions(-) create mode 100644 packages/chains/chains/462.ts diff --git a/packages/chains/chains/421614.ts b/packages/chains/chains/421614.ts index 26911738b1b..91d863f0f5a 100644 --- a/packages/chains/chains/421614.ts +++ b/packages/chains/chains/421614.ts @@ -5,7 +5,7 @@ export default { "chain": "ETH", "rpc": [ "https://arbitrum-sepolia.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://sepolia-rollup.abitrum.io/rpc" + "https://sepolia-rollup.arbitrum.io/rpc" ], "faucets": [], "nativeCurrency": { diff --git a/packages/chains/chains/462.ts b/packages/chains/chains/462.ts new file mode 100644 index 00000000000..f9cea4f9219 --- /dev/null +++ b/packages/chains/chains/462.ts @@ -0,0 +1,34 @@ +import type { Chain } from "../src/types"; +export default { + "name": "Areon Network Testnet", + "chain": "Areon", + "icon": { + "url": "ipfs://bafkreihs2nrnizpcuzjmuu2yi7wrtwd7qlqje46qnil5bnntfbfkb2roea", + "width": 1000, + "height": 1000, + "format": "png" + }, + "rpc": [ + "https://areon-network-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://testnet-rpc.areon.network" + ], + "faucets": [], + "nativeCurrency": { + "name": "Areon", + "symbol": "AREA", + "decimals": 18 + }, + "infoURL": "https://areon.network", + "shortName": "area", + "chainId": 462, + "networkId": 462, + "explorers": [ + { + "name": "AreonScan", + "url": "https://areonscan.com", + "standard": "none" + } + ], + "testnet": true, + "slug": "areon-network-testnet" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/react-core/src/core/types/wallet.ts b/packages/react-core/src/core/types/wallet.ts index 405a9831735..68dddfb58c2 100644 --- a/packages/react-core/src/core/types/wallet.ts +++ b/packages/react-core/src/core/types/wallet.ts @@ -39,6 +39,11 @@ export type WalletConfig = { * * ConnectWallet modal will reopen once the personal wallet is connected so that you can render UI for connecting your wallet as the next step */ personalWallets?: WalletConfig[]; + + /** + * If true, this wallet will be tagged as "recommended" in ConnectWallet Modal and will be shown at the top of the list + */ + recommended?: boolean; }; export type ConnectUIProps = { diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index 85aa55ba376..cae968504f4 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -9,7 +9,7 @@ import ThirdwebLogo from "../../../assets/thirdweb-logo"; import { useAppTheme } from "../../../styles/hooks"; import { ChooseWalletContent } from "./ChooseWalletContent"; import { BaseButton, ImageSvgUri } from "../../base"; -import { ActivityIndicator } from "react-native"; +import { ActivityIndicator, Linking } from "react-native"; import { useTheme } from "@shopify/restyle"; export type ChooseWalletProps = { @@ -59,6 +59,10 @@ export function ChooseWallet({ setIsConnectAWalletEnabled(false); }; + const onGetStartedPress = () => { + Linking.openURL("https://ethereum.org/en/wallets/find-wallet/"); + }; + return ( New to wallets? - + Get started diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx index 9e444f39e0c..41cc78c225c 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx @@ -18,12 +18,23 @@ export const ChooseWalletContent = ({ excludeWalletIds, onChooseWallet, }: ChooseWalletContentProps) => { + const theme = useTheme(); + const walletsToDisplay = useMemo(() => { - return wallets.filter( + const filteredWallets = wallets.filter( (w) => !!!excludeWalletIds?.find((ewId) => ewId === w.id), ); + + const trueItems = filteredWallets.filter( + (item) => item.recommended === true, + ); + const falseItems = filteredWallets.filter( + (item) => item.recommended !== true, + ); + const sortedWallets = [...trueItems, ...falseItems]; + + return sortedWallets; }, [wallets, excludeWalletIds]); - const theme = useTheme(); return ( @@ -59,6 +70,7 @@ export const ChooseWalletContent = ({ onChooseWallet(item)} mb={marginBottom} /> diff --git a/packages/react-native/src/evm/components/base/WalletButton.tsx b/packages/react-native/src/evm/components/base/WalletButton.tsx index f3ff7161e84..503ce2e3f3f 100644 --- a/packages/react-native/src/evm/components/base/WalletButton.tsx +++ b/packages/react-native/src/evm/components/base/WalletButton.tsx @@ -10,6 +10,7 @@ type WalletButtonProps = { walletIconUrl: string; name: string; labelText?: string; + recommended?: boolean; } & React.ComponentProps; export const WalletButton = ({ @@ -18,6 +19,7 @@ export const WalletButton = ({ walletIconUrl, name, labelText, + recommended, }: WalletButtonProps) => { return ( - - {name} - + + {name} + {recommended ? ( + Recommended + ) : null} + {labelText ? diff --git a/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts b/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts index 23cfaa6cdfb..6cae281e60f 100644 --- a/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts @@ -69,7 +69,10 @@ export class CoinbaseWallet extends AbstractClientWallet { +export const coinbaseWallet = (config?: { + callbackURL?: URL; + recommended?: boolean; +}) => { const callbackURLNonNull = config?.callbackURL || new URL("https://thirdweb.com/wsegue"); return { @@ -77,5 +80,6 @@ export const coinbaseWallet = (config?: { callbackURL?: URL }) => { meta: CoinbaseWallet.meta, create: (options: WalletOptionsRC) => new CoinbaseWallet({ ...options, callbackURL: callbackURLNonNull }), + recommended: config?.recommended, } satisfies WalletConfig; }; diff --git a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx index 30978ccc4cc..0e6ff09c466 100644 --- a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx +++ b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx @@ -22,7 +22,7 @@ import React from "react"; import { ConnectingWallet } from "../../components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet"; export const magicLink = ( - magicLinkOptions: MagicLinkOptions, + magicLinkOptions: MagicLinkOptions & { recommended?: boolean }, ): WalletConfig => { return { id: walletIds.magicLink, @@ -49,6 +49,7 @@ export const magicLink = ( isInstalled: () => { return true; }, + recommended: magicLinkOptions?.recommended, }; }; diff --git a/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts b/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts index faf34c4818c..0cd0c7a00e4 100644 --- a/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts @@ -2,6 +2,7 @@ import { walletIds } from "@thirdweb-dev/wallets"; import { WalletOptions, WalletConfig } from "@thirdweb-dev/react-core"; import { WCMeta } from "../types/wc"; import { WalletConnectBase } from "./wallet-connect/WalletConnectBase"; +import { WalletConnectConfig } from "./wallet-connect/wallet-connect"; export class MetaMaskWallet extends WalletConnectBase { static id = walletIds.metamask; @@ -20,9 +21,7 @@ export class MetaMaskWallet extends WalletConnectBase { } } -type MetaMaskWalletConfig = { projectId?: string }; - -export const metamaskWallet = (config?: MetaMaskWalletConfig) => { +export const metamaskWallet = (config?: WalletConnectConfig) => { return { id: MetaMaskWallet.id, meta: MetaMaskWallet.meta, @@ -32,5 +31,6 @@ export const metamaskWallet = (config?: MetaMaskWalletConfig) => { walletId: walletIds.metamask, projectId: config?.projectId, }), + recommended: config?.recommended, } satisfies WalletConfig; }; diff --git a/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts b/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts index d8b846f598a..e1ef023acb6 100644 --- a/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts @@ -3,6 +3,7 @@ import { WalletConfig, } from "@thirdweb-dev/react-core"; import { WalletConnectBase } from "./wallet-connect/WalletConnectBase"; +import { WalletConnectConfig } from "./wallet-connect/wallet-connect"; export class RainbowWallet extends WalletConnectBase { static id = "rainbow" as const; @@ -21,9 +22,7 @@ export class RainbowWallet extends WalletConnectBase { } } -type RainbowWalletConfig = { projectId?: string }; - -export const rainbowWallet = (config?: RainbowWalletConfig) => { +export const rainbowWallet = (config?: WalletConnectConfig) => { return { id: RainbowWallet.id, meta: RainbowWallet.meta, @@ -33,5 +32,6 @@ export const rainbowWallet = (config?: RainbowWalletConfig) => { walletId: RainbowWallet.id, projectId: config?.projectId, }), + recommended: config?.recommended, } satisfies WalletConfig; }; diff --git a/packages/react-native/src/evm/wallets/wallets/smart-wallet.ts b/packages/react-native/src/evm/wallets/wallets/smart-wallet.ts index bd84f1b4d1a..379af76d59b 100644 --- a/packages/react-native/src/evm/wallets/wallets/smart-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/smart-wallet.ts @@ -9,7 +9,8 @@ import { createSyncStorage } from "../../../core/AsyncStorage"; type SmartWalletConfig = { personalWallets?: WalletConfig[]; -} & Omit; + recommended?: boolean; +} & Omit; export type SmartWalletObj = WalletConfig; @@ -27,5 +28,6 @@ export const smartWallet = ( wcStorage: createSyncStorage("smart-wallet"), }), personalWallets: config.personalWallets || DEFAULT_WALLETS, + recommended: config.recommended, }; }; diff --git a/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts b/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts index d4cae8b2ecf..db04facec9a 100644 --- a/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts @@ -1,6 +1,7 @@ import { WalletOptions, WalletConfig } from "@thirdweb-dev/react-core"; import { WCMeta } from "../types/wc"; import { WalletConnectBase } from "./wallet-connect/WalletConnectBase"; +import { WalletConnectConfig } from "./wallet-connect/wallet-connect"; export class TrustWallet extends WalletConnectBase { static id = "trust" as const; @@ -19,9 +20,7 @@ export class TrustWallet extends WalletConnectBase { } } -type TrustWalletConfig = { projectId?: string }; - -export const trustWallet = (config?: TrustWalletConfig) => { +export const trustWallet = (config?: WalletConnectConfig) => { return { id: TrustWallet.id, meta: TrustWallet.meta, @@ -31,5 +30,6 @@ export const trustWallet = (config?: TrustWalletConfig) => { walletId: "trust", projectId: config?.projectId, }), + recommended: config?.recommended, } satisfies WalletConfig; }; diff --git a/packages/react-native/src/evm/wallets/wallets/wallet-connect/wallet-connect.tsx b/packages/react-native/src/evm/wallets/wallets/wallet-connect/wallet-connect.tsx index cf26701a140..8f6e001ddba 100644 --- a/packages/react-native/src/evm/wallets/wallets/wallet-connect/wallet-connect.tsx +++ b/packages/react-native/src/evm/wallets/wallets/wallet-connect/wallet-connect.tsx @@ -6,6 +6,7 @@ import { walletIds } from "@thirdweb-dev/wallets"; export type WalletConnectConfig = { projectId?: string; + recommended?: boolean; }; export const walletConnect = ( @@ -24,5 +25,6 @@ export const walletConnect = ( connectUI(props) { return ; }, + recommended: config?.recommended, }; }; From e6c2cd90354d0b3654a10e7585968a1e1c0de22f Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Fri, 8 Sep 2023 18:59:25 -0400 Subject: [PATCH 08/18] changeset --- .changeset/orange-pans-brake.md | 19 +++++++++++++++++++ .../ChooseWallet/ChooseWallet.tsx | 2 +- .../ConnectWalletFlow/LocalWalletFlow.tsx | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.changeset/orange-pans-brake.md b/.changeset/orange-pans-brake.md index aeaeff31eeb..0c0c8d01901 100644 --- a/.changeset/orange-pans-brake.md +++ b/.changeset/orange-pans-brake.md @@ -3,3 +3,22 @@ --- Improved ConnectWallet design :) + +Devs can now pass a `recommended` field in most wallets to recommend wallets to users. + +When recommending a wallet, this wallet will show up at the top of the wallets list. + +```javascript +import { metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react-native"; + + + +; +``` diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index cae968504f4..02dc1ca62d7 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -148,7 +148,7 @@ export function ChooseWallet({ > - Or + OR diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx index 9ae79dcac2e..079dfb38d87 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletFlow.tsx @@ -79,7 +79,7 @@ export function LocalWalletFlow({ )} - -------- Or -------- + -------- OR -------- From 4b634a548fbca39d78a756e8bac27c31939c24fc Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Mon, 11 Sep 2023 12:26:47 -0400 Subject: [PATCH 09/18] fix textinput props --- .../ConnectWalletDetails/ConnectAppField.tsx | 14 +++++++---- .../LocalWalletImportModal.tsx | 10 +++++--- .../src/evm/components/PasswordInput.tsx | 2 ++ .../src/evm/components/base/TextInput.tsx | 16 ++++++------ .../src/evm/wallets/wallets/magic-link.tsx | 25 ++++++++++++------- 5 files changed, 41 insertions(+), 26 deletions(-) diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx index 2e74becba61..abbbf2d573a 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx @@ -119,11 +119,15 @@ const ConnectAppField = () => { borderRadius="md" > onWCPress()} diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletImportModal.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletImportModal.tsx index c195ac82af8..7e47d4df141 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletImportModal.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/LocalWalletImportModal.tsx @@ -196,10 +196,12 @@ export const LocalWalletImportModal = ({ ---- Or Private key or Mnemonic ---- { const theme = useTheme(); @@ -19,17 +21,15 @@ export const TextInput = ({ borderWidth={1} borderRadius="md" pr="xs" - {...props} + {...containerProps} > ); diff --git a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx index 0e6ff09c466..96282def0f5 100644 --- a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx +++ b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx @@ -67,16 +67,23 @@ const MagicSelectionUI: React.FC> = (props) => { return ( { + setEmail(text); + }, + style: { + height: 50, + fontSize: 16, + color: theme.colors.textPrimary, + }, }} - onChangeText={(text: string) => { - setEmail(text); + containerProps={{ + paddingHorizontal: "sm", + style: { + height: 50, + }, }} /> Date: Mon, 11 Sep 2023 18:58:56 -0400 Subject: [PATCH 10/18] adds tos and privacypolicy urls --- .../src/evm/components/ConnectWallet.tsx | 4 ++ .../ChooseWallet/ChooseWallet.tsx | 55 ++++++++++++++++++- .../ChooseWallet/ChooseWalletContent.tsx | 2 +- .../ConnectWalletFlow/ConnectWalletButton.tsx | 13 +++++ .../ConnectWalletFlow/ConnectWalletFlow.tsx | 7 ++- .../react-native/src/evm/utils/modalTypes.ts | 2 + 6 files changed, 79 insertions(+), 4 deletions(-) diff --git a/packages/react-native/src/evm/components/ConnectWallet.tsx b/packages/react-native/src/evm/components/ConnectWallet.tsx index 3a25abbb52b..5e59f76faea 100644 --- a/packages/react-native/src/evm/components/ConnectWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWallet.tsx @@ -55,6 +55,8 @@ export const ConnectWallet = ({ extraRows, hideTestnetFaucet, switchToActiveChain, + termsOfServiceUrl, + privacyPolicyUrl, }: ConnectWalletProps) => { const fadeAnim = useRef(new Animated.Value(0)).current; const address = useAddress(); @@ -120,6 +122,8 @@ export const ConnectWallet = ({ modalTitle={modalTitle} buttonTitle={buttonTitle} theme={theme} + termsOfServiceUrl={termsOfServiceUrl} + privacyPolicyUrl={privacyPolicyUrl} /> )} diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index 02dc1ca62d7..0c3e957906d 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -19,6 +19,8 @@ export type ChooseWalletProps = { onClose: () => void; wallets: WalletConfig[]; excludeWalletIds?: string[]; + termsOfServiceUrl?: string; + privacyPolicyUrl?: string; }; export function ChooseWallet({ @@ -28,6 +30,8 @@ export function ChooseWallet({ onChooseWallet, onClose, excludeWalletIds = [], + termsOfServiceUrl, + privacyPolicyUrl, }: ChooseWalletProps) { const theme = useAppTheme(); const themeLightDark = useTheme(); @@ -44,6 +48,8 @@ export function ChooseWallet({ ) .slice(0, 2); + const showToSPrivacyPolicy = termsOfServiceUrl || privacyPolicyUrl; + const onContinueAsGuestPress = () => { setIsConnecting(true); setTimeout(() => { @@ -63,6 +69,18 @@ export function ChooseWallet({ Linking.openURL("https://ethereum.org/en/wallets/find-wallet/"); }; + const onToSPressed = () => { + if (termsOfServiceUrl) { + Linking.openURL(termsOfServiceUrl); + } + }; + + const onPrivacyPolicyPress = () => { + if (privacyPolicyUrl) { + Linking.openURL(privacyPolicyUrl); + } + }; + return ( 0 ? ( ) : null} + {showToSPrivacyPolicy ? ( + + + By connecting, you agree to the + + + {termsOfServiceUrl ? ( + + + Terms of Service + + + ) : null} + {termsOfServiceUrl && privacyPolicyUrl ? ( + + {" & "} + + ) : null} + {privacyPolicyUrl ? ( + + + Privacy Policy + + + ) : null} + + + ) : null} ); } diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx index 41cc78c225c..d5c48e9eec9 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx @@ -11,7 +11,7 @@ interface ChooseWalletContentProps { onChooseWallet: (wallet: WalletConfig, data?: any) => void; } -const MAX_HEIGHT = Dimensions.get("window").height * 0.4; +const MAX_HEIGHT = Dimensions.get("window").height * 0.3; export const ChooseWalletContent = ({ wallets, diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx index 7333fd28f49..dea658b701e 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx @@ -18,10 +18,21 @@ export type ConnectWalletButtonProps = { * @default "Choose your wallet" */ modalTitle?: string; + /** + * Set a custom terms of service url + */ + termsOfServiceUrl?: string; + + /** + * Set a custom privacy policy url + */ + privacyPolicyUrl?: string; }; export const ConnectWalletButton = ({ modalTitle, + termsOfServiceUrl, + privacyPolicyUrl, buttonTitle, theme, }: ConnectWalletButtonProps) => { @@ -61,6 +72,8 @@ export const ConnectWalletButton = ({ view: "ConnectWalletFlow", data: { modalTitle, + termsOfServiceUrl, + privacyPolicyUrl, walletConfig: supportedWallets.length === 1 ? supportedWallets[0] : undefined, }, diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx index aab889e82f4..c980ff6cb4c 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx @@ -17,8 +17,9 @@ import { useAppTheme } from "../../styles/hooks"; export const ConnectWalletFlow = () => { const { modalState, setModalState } = useModalState(); - const { modalTitle, walletConfig } = (modalState as ConnectWalletFlowModal) - .data; + const { modalTitle, privacyPolicyUrl, termsOfServiceUrl, walletConfig } = ( + modalState as ConnectWalletFlowModal + ).data; const [modalVisible, setModalVisible] = useState(false); const [activeWallet, setActiveWallet] = useState(); @@ -154,6 +155,8 @@ export const ConnectWalletFlow = () => { ) : ( Date: Tue, 12 Sep 2023 16:49:38 -0400 Subject: [PATCH 11/18] improve theme customization --- .changeset/orange-pans-brake.md | 39 ++++++++++++++- .../ChooseWallet/ChooseWallet.tsx | 50 ++++++++++++++----- .../ConnectWalletFlow/ConnectWalletFlow.tsx | 2 +- .../src/evm/components/base/WalletButton.tsx | 6 +-- .../src/evm/providers/ui-context-provider.tsx | 8 +-- .../react-native/src/evm/styles/colors.ts | 13 ++++- packages/react-native/src/evm/styles/theme.ts | 45 ++++++++--------- .../react-native/src/evm/types/deepPartial.ts | 3 ++ .../src/evm/wallets/wallets/magic-link.tsx | 20 ++++---- 9 files changed, 128 insertions(+), 58 deletions(-) create mode 100644 packages/react-native/src/evm/types/deepPartial.ts diff --git a/.changeset/orange-pans-brake.md b/.changeset/orange-pans-brake.md index 0c0c8d01901..3d01ddbb722 100644 --- a/.changeset/orange-pans-brake.md +++ b/.changeset/orange-pans-brake.md @@ -2,9 +2,9 @@ "@thirdweb-dev/react-native": patch --- -Improved ConnectWallet design :) +Improved ConnectWallet UX/DevX :) -Devs can now pass a `recommended` field in most wallets to recommend wallets to users. +1. Devs can now pass a `recommended` field to `supportedWallets` to recommend wallets to users. When recommending a wallet, this wallet will show up at the top of the wallets list. @@ -22,3 +22,38 @@ import { metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react-native"; ; ``` + +2. Better theme customization + +You can now more easily customize the theme of the ConnectWallet component: + +```javascript +import { ConnectWallet, darkTheme } from "@thirdweb-dev/react-native"; + +; +``` + +Note that you can still pass `light` or `dark` if you want to use one of the predefined thems :) + +3. You can now pass your Privacy Policy and Terms of Service urls, they will show up + at the bottom of the modal: + +```javascript +import { ConnectWallet, darkTheme } from "@thirdweb-dev/react-native"; + +; +``` + +4. Fixed a bug when you only specify an email wallet. In this case the app shouldn't auto connect, it should show the email field. diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index 0c3e957906d..0f3712490f8 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -159,6 +159,7 @@ export function ChooseWallet({ (guestWallet || connectionWallets.length > 0) ? ( ); })} - Connect a wallet + + Connect a wallet + ) : null} {guestWallet ? ( ) : ( - Continue as guest + + Continue as guest + )} ) : null} @@ -223,29 +228,50 @@ export function ChooseWallet({ pt="md" height={50} marginHorizontal={!isConnectAWalletEnabled ? "xl" : "none"} - borderTopColor="border" - borderTopWidth={1} alignItems="center" > - + By connecting, you agree to the {termsOfServiceUrl ? ( - - + + Terms of Service ) : null} {termsOfServiceUrl && privacyPolicyUrl ? ( - + {" & "} ) : null} {privacyPolicyUrl ? ( - - + + Privacy Policy diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx index c980ff6cb4c..bf80599d347 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx @@ -72,7 +72,7 @@ export const ConnectWalletFlow = () => { useEffect(() => { // case when only one wallet is passed in supportedWallets - if (walletConfig) { + if (walletConfig && !walletConfig.connectUI) { onChooseWallet(walletConfig); } }, [onChooseWallet, walletConfig]); diff --git a/packages/react-native/src/evm/components/base/WalletButton.tsx b/packages/react-native/src/evm/components/base/WalletButton.tsx index 503ce2e3f3f..0e17ce4fdc4 100644 --- a/packages/react-native/src/evm/components/base/WalletButton.tsx +++ b/packages/react-native/src/evm/components/base/WalletButton.tsx @@ -35,11 +35,9 @@ export const WalletButton = ({ > - + {name} - {recommended ? ( - Recommended - ) : null} + {recommended ? Recommended : null} {labelText ? )} diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx index c1bec304f32..8455771acc5 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx @@ -16,12 +16,14 @@ interface WalletDetailsModalHeaderProps { onDisconnectPress: () => void; onAddressCopied?: () => void; loading?: boolean; + tokenAddress?: string; } export const WalletDetailsModalHeader = ({ address, onDisconnectPress, onAddressCopied, + tokenAddress, }: WalletDetailsModalHeaderProps) => { const theme = useAppTheme(); const activeWallet = useWallet(); @@ -66,7 +68,10 @@ export const WalletDetailsModalHeader = ({ color={theme.colors.textSecondary} /> - + {showLoading ? ( diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx index 4bd848543cf..8da1fba14cb 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectingWallet/ConnectingWallet.tsx @@ -30,7 +30,7 @@ export function ConnectingWallet({ subHeaderText={subHeaderText} onClose={onClose} /> - + diff --git a/packages/react-native/src/evm/components/ReceiveButton.tsx b/packages/react-native/src/evm/components/ReceiveButton.tsx new file mode 100644 index 00000000000..e88632bbb32 --- /dev/null +++ b/packages/react-native/src/evm/components/ReceiveButton.tsx @@ -0,0 +1,156 @@ +import React, { useEffect, useState } from "react"; +import { IconTextButton } from "./base/IconTextButton"; +import { useAddress } from "@thirdweb-dev/react-core"; +import { Dimensions, KeyboardAvoidingView } from "react-native"; +import { useAppTheme } from "../styles/hooks"; +import { + TWModal, + Box, + ModalHeaderTextClose, + Text, + AddressDisplay, + BaseButton, + Toast, +} from "./base"; +import DownloadIcon from "../assets/download"; +import CopyIcon from "../assets/copy"; +import QRCode from "react-native-qrcode-svg"; + +// type SendButtonProps = { +// chain?: Chain; +// onPress?: () => void; +// switchChainOnPress?: boolean; +// onChainSwitched?: () => void; +// }; + +export const ReceiveButton = () => { + const theme = useAppTheme(); + const [isModalVisible, setIsModalVisible] = useState(false); + + const onClose = () => { + setIsModalVisible(false); + }; + + const onReceivePress = () => { + setIsModalVisible(true); + }; + + return ( + <> + + } + onPress={onReceivePress} + /> + + + ); +}; + +const MODAL_HEIGHT = Dimensions.get("window").height * 0.7; + +export type ReceiveFundsModalProps = { + isVisible: boolean; + onClose: () => void; +}; + +export const ReceiveFundsModal = ({ + isVisible, + onClose, +}: ReceiveFundsModalProps) => { + const theme = useAppTheme(); + const address = useAddress(); + const [addressCopied, setAddressCopied] = useState(false); + + useEffect(() => { + const timeout = setTimeout(() => { + if (addressCopied) { + setAddressCopied(false); + } + }, 2000); + + return () => clearTimeout(timeout); + }, [addressCopied]); + + const onCloseInternal = () => { + onClose(); + }; + + const onAddressPress = () => { + setAddressCopied(true); + }; + + return ( + + + + + + Paste the wallet address or scan the QR code to send funds to this + wallet. + + + Current Network + + + + + + + QR Code + + + + + + {addressCopied === true ? ( + + ) : null} + + + + ); +}; diff --git a/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx b/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx new file mode 100644 index 00000000000..c90904bc227 --- /dev/null +++ b/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx @@ -0,0 +1,37 @@ +import { useBalance, useChain } from "@thirdweb-dev/react-core"; +import { TokenInfo } from "./defaultTokens"; +import { BaseButton, Box, ChainIcon, ImageSvgUri, Text } from "../base"; +import LoadingTextAnimation from "../base/LoadingTextAnimation"; + +export function SelectTokenButton(props: { + token?: TokenInfo; + onPress: () => void; +}) { + const balanceQuery = useBalance(props.token?.address); + const chain = useChain(); + const tokenName = props.token?.name || balanceQuery.data?.name; + + return ( + + {props.token?.icon ? ( + + ) : ( + + )} + + {tokenName} + {!balanceQuery.data ? ( + + ) : ( + + {Number(balanceQuery.data?.displayValue).toFixed(3)}{" "} + {balanceQuery.data.symbol} + + )} + + + ); +} diff --git a/packages/react-native/src/evm/components/SendFunds/SendButton.tsx b/packages/react-native/src/evm/components/SendFunds/SendButton.tsx new file mode 100644 index 00000000000..33000f55a22 --- /dev/null +++ b/packages/react-native/src/evm/components/SendFunds/SendButton.tsx @@ -0,0 +1,360 @@ +import { useAppTheme } from "../../styles/hooks"; +import React, { useEffect, useMemo, useState } from "react"; +import SendIcon from "../../assets/send"; +import { + BaseButton, + Box, + ChainIcon, + IconTextButton, + ImageSvgUri, + ModalHeaderTextClose, + TWModal, + Text, +} from "../base"; +import { + ActivityIndicator, + Dimensions, + KeyboardAvoidingView, + TextInput as TextInputRN, +} from "react-native"; +import { + TransactionResult, + useBalance, + useChain, + useChainId, + useWallet, +} from "@thirdweb-dev/react-core"; +import { SupportedTokens, TokenInfo } from "./defaultTokens"; +import { useMutation } from "@tanstack/react-query"; +import { utils } from "ethers"; +import LoadingTextAnimation from "../base/LoadingTextAnimation"; +import CheckIcon from "../../assets/check"; +import { TokenSelector } from "./TokenSelector"; + +export const SendButton = ({ + supportedTokens, +}: { + supportedTokens: SupportedTokens; +}) => { + const theme = useAppTheme(); + const [isModalVisible, setIsModalVisible] = useState(false); + + const onClose = () => { + setIsModalVisible(false); + }; + + const onSendPress = () => { + setIsModalVisible(true); + }; + + return ( + <> + + } + onPress={onSendPress} + /> + + + ); +}; + +const MODAL_HEIGHT = Dimensions.get("window").height * 0.7; + +type TXError = Error & { data?: { message?: string } }; + +export type SendFundsModalProps = { + isVisible: boolean; + onClose: () => void; + supportedTokens: SupportedTokens; +}; + +export const SendFundsModal = ({ + isVisible, + onClose, + supportedTokens, +}: SendFundsModalProps) => { + const [token, setToken] = useState(); + const [showTokenSelector, setShowTokenSelector] = useState(false); + + const onTokenSelectorPress = () => { + setShowTokenSelector(true); + }; + + return ( + + + {showTokenSelector ? ( + { + setShowTokenSelector(false); + }} + onTokenSelect={(_token) => { + setToken(_token); + setShowTokenSelector(false); + }} + /> + ) : ( + + )} + + + ); +}; + +const SendFundsForm = ({ + onClose, + onTokenSelectorPress, + token, +}: { + onClose: () => void; + onTokenSelectorPress: () => void; + token?: TokenInfo; +}) => { + const theme = useAppTheme(); + const chain = useChain(); + const wallet = useWallet(); + const chainId = useChainId(); + const [receiverAddress, setReceiverAddress] = useState(""); + const [amount, setAmount] = useState(""); + const [showIcon, setShowIcon] = useState(false); + const tokenAddress = token?.address; + + const balanceQuery = useBalance( + tokenAddress && utils.isAddress(tokenAddress) ? tokenAddress : undefined, + ); + + const tokenName = token?.name || balanceQuery?.data?.name; + const tokenSymbol = token?.symbol || balanceQuery.data?.symbol; + + // Ethereum or Rinkeby or Goerli + const isENSSupprted = chainId === 1 || chainId === 5 || chainId === 4; + + const isValidReceieverAddress = useMemo(() => { + const isENS = receiverAddress.endsWith(".eth"); + + if (!isENSSupprted && isENS) { + return false; + } + + return isENS || utils.isAddress(receiverAddress); + }, [receiverAddress, isENSSupprted]); + + const showInvalidAddressError = receiverAddress && !isValidReceieverAddress; + + const sendTokenMutation = useMutation( + async () => { + if (!wallet) { + return; + } + + return wallet.transfer(receiverAddress, amount, tokenAddress); + }, + ); + + useEffect(() => { + if (sendTokenMutation.isSuccess) { + setShowIcon(true); + setTimeout(() => { + setShowIcon(false); + }, 1000); + } + }, [sendTokenMutation.isSuccess]); + + const onCloseInternal = () => { + onClose(); + }; + + function getErrorMessage(error?: TXError) { + const message = error?.data?.message || error?.message; + + if (!message) { + return "Transaction Failed"; + } + + if (message.includes("user rejected")) { + return "Transaction Rejected"; + } + + if (message.includes("insufficient funds")) { + return "Insufficient funds"; + } + + return "Transaction Failed"; + } + + return ( + + + + Select Token + + + + + {token?.icon ? ( + + ) : ( + + )} + + {tokenName} + {!balanceQuery.data ? ( + + ) : ( + + {Number(balanceQuery.data?.displayValue).toFixed(3)}{" "} + {balanceQuery.data.symbol} + + )} + + + + + + Send to + + + + + + Amount + + + + {tokenSymbol} + + { + if (!receiverAddress || !wallet || !amount) { + return; + } + + await sendTokenMutation.mutateAsync(); + }} + > + {sendTokenMutation.isLoading ? ( + + ) : showIcon ? ( + + ) : ( + + Send + + )} + + + {sendTokenMutation.isError && ( + + {getErrorMessage(sendTokenMutation.error || undefined)} + + )} + + ); +}; diff --git a/packages/react-native/src/evm/components/SendFunds/TokenSelector.tsx b/packages/react-native/src/evm/components/SendFunds/TokenSelector.tsx new file mode 100644 index 00000000000..df95620a13a --- /dev/null +++ b/packages/react-native/src/evm/components/SendFunds/TokenSelector.tsx @@ -0,0 +1,201 @@ +import { + NATIVE_TOKEN_ADDRESS, + useBalance, + useChain, + useChainId, +} from "@thirdweb-dev/react-core"; +import React, { useState } from "react"; +import { TokenInfo, SupportedTokens } from "./defaultTokens"; +import { utils } from "ethers"; +import Box from "../base/Box"; +import { ModalHeaderTextClose } from "../base/modal/ModalHeaderTextClose"; +import { ActivityIndicator, Dimensions, TextInput } from "react-native"; +import { useAppTheme } from "../../styles/hooks"; +import { SelectTokenButton } from "./SelectTokenButton"; +import CloseIcon from "../../assets/close"; +import Text from "../base/Text"; + +export function useToken(tokenAddress: string): { + isLoading: boolean; + data: TokenInfo | undefined; +} { + const balanceQuery = useBalance( + utils.isAddress(tokenAddress) ? tokenAddress : undefined, + ); + const chain = useChain(); + + if (!utils.isAddress(tokenAddress)) { + return { + isLoading: false, + data: undefined, + }; + } + + if (balanceQuery.isLoading) { + return { + isLoading: true, + data: undefined, + }; + } + + if (balanceQuery.data) { + return { + isLoading: false, + data: { + name: balanceQuery.data.name, + symbol: balanceQuery.data.symbol, + address: tokenAddress, + icon: chain?.icon?.url || "", + }, + }; + } + + return { + isLoading: false, + data: undefined, + }; +} + +function useNativeToken(): TokenInfo | undefined { + const balanceQuery = useBalance(); + const chain = useChain(); + + if (balanceQuery.data) { + return { + name: balanceQuery.data.name, + symbol: balanceQuery.data.symbol, + address: NATIVE_TOKEN_ADDRESS, + icon: chain?.icon?.url || "", + }; + } +} + +const MODAL_HEIGHT = Dimensions.get("window").height * 0.7; + +export function TokenSelector(props: { + onTokenSelect: (token?: TokenInfo) => void; + onBack: () => void; + supportedTokens: SupportedTokens; +}) { + const theme = useAppTheme(); + const [input, setInput] = useState(""); + const chainId = useChainId(); + const nativeTokenInfo = useNativeToken(); + const { data: foundToken, isLoading: findingToken } = useToken(input); + + let tokenList = (chainId ? props.supportedTokens[chainId] : undefined) || []; + + if (nativeTokenInfo) { + tokenList = [nativeTokenInfo, ...tokenList]; + } + + if (foundToken) { + tokenList = [foundToken, ...tokenList]; + } + + const filteredList = input + ? tokenList.filter((t) => { + const inputStr = input.toLowerCase(); + return ( + t.name.toLowerCase().includes(inputStr) || + t.symbol.toLowerCase().includes(inputStr) || + t.address.includes(input) + ); + }) + : tokenList; + + return ( + + + + + + + + + + {filteredList.length > 0 && ( + + {filteredList.map((token) => { + return ( + props.onTokenSelect(token)} + token={token} + key={token.address} + /> + ); + })} + + )} + + {findingToken && ( + + + + )} + + {filteredList.length === 0 && !findingToken && ( + + + No Tokens found + + )} + + ); +} diff --git a/packages/react-native/src/evm/components/SendFunds/defaultTokens.ts b/packages/react-native/src/evm/components/SendFunds/defaultTokens.ts new file mode 100644 index 00000000000..1928a9841fb --- /dev/null +++ b/packages/react-native/src/evm/components/SendFunds/defaultTokens.ts @@ -0,0 +1,306 @@ +export type TokenInfo = { + name: string; + symbol: string; + address: string; + icon: string; +}; + +const wrappedEthIcon = + ''; + +const tetherUsdIcon = + 'tether-usdt-logo'; + +const usdcIcon = ` + + + + +`; + +const wrappedBtcIcon = + 'wrapped-bitcoin-wbtc'; + +const maticIcon = ` + + + + `; + +const binanceCoinIcon = + ''; + +const BUSDIcon = + 'Asset 1'; + +const fantomIcon = + 'fa'; + +export type SupportedTokens = Record; + +export const defaultTokens: SupportedTokens = { + "1": [ + { + address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + address: "0xdAC17F958D2ee523a2206206994597C13D831ec7", + name: "Tether USD", + symbol: "USDT", + icon: tetherUsdIcon, + }, + { + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + { + address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", + name: "Wrapped Bitcoin", + symbol: "WBTC", + icon: wrappedBtcIcon, + }, + { + address: "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0", + name: "Polygon", + symbol: "WMATIC", + icon: maticIcon, + }, + ], + "5": [ + { + address: "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + address: "0x07865c6E87B9F70255377e024ace6630C1Eaa37F", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + ], + "10": [ + { + address: "0x4200000000000000000000000000000000000006", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + ], + "56": [ + { + address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + name: "Wrapped Binance Chain Token", + symbol: "WBNB", + icon: binanceCoinIcon, + }, + { + address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", + name: "Binance USD", + symbol: "BUSD", + icon: BUSDIcon, + }, + ], + "97": [ + { + address: "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + name: "Wrapped Binance Chain Testnet Token", + symbol: "WBNB", + icon: binanceCoinIcon, + }, + { + address: "0xed24fc36d5ee211ea25a80239fb8c4cfd80f12ee", + name: "Binance USD", + symbol: "BUSD", + icon: BUSDIcon, + }, + ], + "137": [ + { + address: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", + name: "Wrapped Matic", + symbol: "WMATIC", + icon: maticIcon, + }, + { + address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + { + address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", + name: "Tether USD", + symbol: "USDT", + icon: tetherUsdIcon, + }, + { + address: "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6", + name: "Wrapped BTC", + symbol: "WBTC", + icon: wrappedBtcIcon, + }, + ], + "250": [ + { + address: "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83", + name: "Wrapped Fantom", + symbol: "WFTM", + icon: fantomIcon, + }, + { + name: "Wrapped Ether", + address: "0x74b23882a30290451A17c44f4F05243b6b58C76d", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + name: "USD Coin", + address: "0x04068DA6C83AFCFA0e13ba15A6696662335D5B75", + symbol: "USDC", + icon: usdcIcon, + }, + { + name: "Wrapped Bitcoin", + address: "0x321162Cd933E2Be498Cd2267a90534A804051b11", + symbol: "WBTC", + icon: wrappedBtcIcon, + }, + ], + "420": [ + { + address: "0x4200000000000000000000000000000000000006", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + ], + "4002": [ + { + address: "0xf1277d1Ed8AD466beddF92ef448A132661956621", + name: "Wrapped Fantom", + symbol: "WFTM", + icon: fantomIcon, + }, + ], + "42161": [ + { + address: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + ], + "43113": [ + { + address: "0xd00ae08403B9bbb9124bB305C09058E32C39A48c", + name: "Wrapped AVAX", + symbol: "WAVAX", + icon: ` + + + + `, + }, + { + address: "0x5425890298aed601595a70AB815c96711a31Bc65", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + ], + "43114": [ + { + address: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + name: "Wrapped AVAX", + symbol: "WAVAX", + icon: ` + + + + `, + }, + { + address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118", + name: "Tether USD", + symbol: "USDT", + icon: tetherUsdIcon, + }, + { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + { + address: "0x50b7545627a5162F82A992c33b87aDc75187B218", + name: "Wrapped BTC", + symbol: "WBTC", + icon: wrappedBtcIcon, + }, + ], + "80001": [ + { + address: "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889", + name: "Wrapped Matic", + symbol: "WMATIC", + icon: maticIcon, + }, + { + name: "Wrapped Ether", + address: "0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + address: "0x0FA8781a83E46826621b3BC094Ea2A0212e71B23", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + { + name: "Tether USD", + address: "0x3813e82e6f7098b9583FC0F33a962D02018B6803", + symbol: "USDT", + icon: tetherUsdIcon, + }, + ], + "421613": [ + { + address: "0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3", + name: "Wrapped Ether", + symbol: "WETH", + icon: wrappedEthIcon, + }, + { + address: "0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63", + name: "USD Coin", + symbol: "USDC", + icon: usdcIcon, + }, + ], +}; diff --git a/packages/react-native/src/evm/components/base/IconTextButton.tsx b/packages/react-native/src/evm/components/base/IconTextButton.tsx index 1b4490f30ca..76ae900d4ac 100644 --- a/packages/react-native/src/evm/components/base/IconTextButton.tsx +++ b/packages/react-native/src/evm/components/base/IconTextButton.tsx @@ -22,7 +22,11 @@ export const IconTextButton = ({ { const storage = useStorage(); + const [error, setError] = useState(false); + + if (imageUrl.startsWith(" + + + ); + } + const resolvedImageUrl = storage ? storage.resolveScheme(imageUrl) + (isAppBundleIdPresentInGlobal() @@ -24,8 +34,6 @@ const ImageSvgUri = ({ : "") : imageUrl.replace("ipfs://", "https://ipfs.io/ipfs/"); - const [error, setError] = useState(false); - if (!resolvedImageUrl || resolvedImageUrl === "") { return null; } diff --git a/packages/react-native/src/evm/components/base/TextBalance.tsx b/packages/react-native/src/evm/components/base/TextBalance.tsx index 71339417e41..6396b1b9cce 100644 --- a/packages/react-native/src/evm/components/base/TextBalance.tsx +++ b/packages/react-native/src/evm/components/base/TextBalance.tsx @@ -5,10 +5,11 @@ import { baseTheme } from "../../styles/theme"; type TextBalance = { textVariant: keyof typeof baseTheme.textVariants; + tokenAddress?: string; }; -export const TextBalance = ({ textVariant }: TextBalance) => { - const balanceQuery = useBalance(); +export const TextBalance = ({ textVariant, tokenAddress }: TextBalance) => { + const balanceQuery = useBalance(tokenAddress); return !balanceQuery.data ? ( diff --git a/packages/react-native/src/evm/components/base/TextInput.tsx b/packages/react-native/src/evm/components/base/TextInput.tsx index f6b6d430529..684ed6fe506 100644 --- a/packages/react-native/src/evm/components/base/TextInput.tsx +++ b/packages/react-native/src/evm/components/base/TextInput.tsx @@ -40,6 +40,5 @@ const styles = StyleSheet.create({ textAlign: "left", flex: 1, height: 40, - paddingLeft: 5, }, }); diff --git a/packages/react-native/src/evm/components/base/Toast.tsx b/packages/react-native/src/evm/components/base/Toast.tsx index 3702633f495..bfe3431d02b 100644 --- a/packages/react-native/src/evm/components/base/Toast.tsx +++ b/packages/react-native/src/evm/components/base/Toast.tsx @@ -62,7 +62,6 @@ const styles = StyleSheet.create({ alignContent: "center", alignItems: "center", justifyContent: "center", - alignSelf: "stretch", height: TOAST_HEIGHT, marginHorizontal: 10, padding: 10, diff --git a/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx b/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx index 273e1972e27..72a59ab8b03 100644 --- a/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx +++ b/packages/react-native/src/evm/components/base/modal/ModalHeaderTextClose.tsx @@ -1,3 +1,4 @@ +import { View } from "react-native"; import { Icon } from "../../../assets/icon"; import { useAppTheme } from "../../../styles/hooks"; import Box from "../Box"; @@ -5,7 +6,7 @@ import Text from "../Text"; import { ReactNode } from "react"; interface ModalHeaderTextCloseProps { - onClose: () => void; + onClose?: () => void; headerText?: ReactNode | string; subHeaderText?: ReactNode | string; onBackPress?: () => void; @@ -41,13 +42,17 @@ export const ModalHeaderTextClose = ({ ) : ( headerText )} - + {onClose ? ( + + ) : ( + + )} {typeof subHeaderText === "string" ? ( diff --git a/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx b/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx index 873757e3589..625e4da920d 100644 --- a/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx +++ b/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletLoadingThumbnail.tsx @@ -5,6 +5,9 @@ import { useAppTheme } from "../../../styles/hooks"; const AnimatedRect = Animated.createAnimatedComponent(Rect); +const PADDING = 10; +const INTERNAL_PADDING = 6; + interface Props { children?: React.ReactNode; imageSize?: number; @@ -43,16 +46,16 @@ function WalletLoadingThumbnail({ return ( =3.0.0 <3.1.5: '>=3.1.5' got@<11.8.5: '>=11.8.5' @@ -156,7 +160,7 @@ importers: version: link:../eslint-config-thirdweb eslint-plugin-import: specifier: ^2.26.0 - version: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + version: 2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0) eslint-plugin-inclusive-language: specifier: ^2.2.0 version: 2.2.0 @@ -615,7 +619,7 @@ importers: version: 0.0.3(eslint@8.45.0) eslint-plugin-import: specifier: ^2.26.0 - version: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + version: 2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0) eslint-plugin-inclusive-language: specifier: ^2.2.0 version: 2.2.0 @@ -739,7 +743,7 @@ importers: version: 0.0.3(eslint@8.45.0) eslint-plugin-import: specifier: ^2.26.0 - version: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + version: 2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0) eslint-plugin-inclusive-language: specifier: ^2.2.0 version: 2.2.0 @@ -818,9 +822,12 @@ importers: react-native-modal: specifier: ^13.0.1 version: 13.0.1(react-native@0.71.11)(react@18.2.0) + react-native-qrcode-svg: + specifier: 6.2.0 + version: 6.2.0(react-native-svg@13.2.0)(react-native@0.71.11)(react@18.2.0) react-native-svg: - specifier: ^13.9.0 - version: 13.9.0(react-native@0.71.11)(react@18.2.0) + specifier: 13.2.0 + version: 13.2.0(react-native@0.71.11)(react@18.2.0) tiny-invariant: specifier: ^1.2.0 version: 1.3.1 @@ -882,7 +889,7 @@ importers: version: link:../eslint-config-thirdweb eslint-plugin-import: specifier: ^2.26.0 - version: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + version: 2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0) eslint-plugin-inclusive-language: specifier: ^2.2.0 version: 2.2.0 @@ -1112,7 +1119,7 @@ importers: version: 0.0.3(eslint@8.45.0) eslint-plugin-import: specifier: ^2.26.0 - version: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + version: 2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0) eslint-plugin-inclusive-language: specifier: ^2.2.0 version: 2.2.0 @@ -15984,7 +15991,7 @@ packages: eslint: 8.45.0 eslint-import-resolver-node: 0.3.7 eslint-import-resolver-typescript: 3.5.3(eslint-plugin-import@2.27.5)(eslint@8.45.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.45.0) eslint-plugin-react: 7.33.0(eslint@8.45.0) eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705(eslint@8.45.0) @@ -16020,7 +16027,7 @@ packages: confusing-browser-globals: 1.0.11 eslint: 8.45.0 eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.22.5)(@babel/plugin-transform-react-jsx@7.22.5)(eslint@8.45.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint@8.45.0) eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.60.1)(eslint@8.45.0)(jest@27.5.1)(typescript@5.1.6) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.45.0) eslint-plugin-react: 7.33.0(eslint@8.45.0) @@ -16064,7 +16071,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) enhanced-resolve: 5.12.0 eslint: 8.45.0 - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0) get-tsconfig: 4.4.0 globby: 13.1.3 is-core-module: 2.11.0 @@ -16101,6 +16108,35 @@ packages: eslint-import-resolver-typescript: 3.5.3(eslint-plugin-import@2.27.5)(eslint@8.45.0) transitivePeerDependencies: - supports-color + dev: false + + /eslint-module-utils@2.7.4(@typescript-eslint/parser@6.2.0)(eslint-import-resolver-node@0.3.7)(eslint@8.45.0): + resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 6.2.0(eslint@8.45.0)(typescript@5.1.6) + debug: 3.2.7 + eslint: 8.45.0 + eslint-import-resolver-node: 0.3.7 + transitivePeerDependencies: + - supports-color /eslint-plugin-better-tree-shaking@0.0.3(eslint@8.45.0): resolution: {integrity: sha512-U5OjauLSVcXvlh2La3ptPwIs6JwLPJKP20OQdTDBe2oh0cHvBeEwhQ8mjFrEoCMdQdmMdrSBkSRLG3gLxFjK3A==} @@ -16149,7 +16185,7 @@ packages: string-natural-compare: 3.0.1 dev: true - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.3)(eslint@8.45.0): + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.60.1)(eslint@8.45.0): resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -16180,6 +16216,39 @@ packages: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color + dev: false + + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@6.2.0)(eslint@8.45.0): + resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 6.2.0(eslint@8.45.0)(typescript@5.1.6) + array-includes: 3.1.6 + array.prototype.flat: 1.3.1 + array.prototype.flatmap: 1.3.1 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.45.0 + eslint-import-resolver-node: 0.3.7 + eslint-module-utils: 2.7.4(@typescript-eslint/parser@6.2.0)(eslint-import-resolver-node@0.3.7)(eslint@8.45.0) + has: 1.0.3 + is-core-module: 2.11.0 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.values: 1.1.6 + resolve: 1.22.1 + semver: 7.5.3 + tsconfig-paths: 3.14.2 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color /eslint-plugin-inclusive-language@2.2.0: resolution: {integrity: sha512-RzPeSjuw1NYiTSQyFzYl2uTDgiPQWDUmFCiGAMCITmXN627DsWZ9rR4KNzrb8vnk/gLL5qdYr8oxh44xsrcO5Q==} @@ -24450,6 +24519,20 @@ packages: react-native-animatable: 1.3.3 dev: false + /react-native-qrcode-svg@6.2.0(react-native-svg@13.2.0)(react-native@0.71.11)(react@18.2.0): + resolution: {integrity: sha512-rb2PgUwT8QpQyReVYNvzRY84AHsMh81354Tnkfp6MfqRbcdJURhnBWLBOO11pLMS6eXiwlq4SkcQxy88hRq+Dw==} + peerDependencies: + react: '*' + react-native: '>=0.63.4' + react-native-svg: ^13.2.0 + dependencies: + prop-types: 15.8.1 + qrcode: 1.5.3 + react: 18.2.0 + react-native: 0.71.11(@babel/core@7.22.9)(@babel/preset-env@7.22.9)(react@18.2.0) + react-native-svg: 13.2.0(react-native@0.71.11)(react@18.2.0) + dev: false + /react-native-safe-area-context@4.5.3(react-native@0.71.11)(react@18.2.0): resolution: {integrity: sha512-ihYeGDEBSkYH+1aWnadNhVtclhppVgd/c0tm4mj0+HV11FoiWJ8N6ocnnZnRLvM5Fxc+hUqxR9bm5AXU3rXiyA==} requiresBuild: true @@ -24461,8 +24544,8 @@ packages: react-native: 0.71.11(@babel/core@7.22.9)(@babel/preset-env@7.22.9)(react@18.2.0) dev: false - /react-native-svg@13.9.0(react-native@0.71.11)(react@18.2.0): - resolution: {integrity: sha512-Ey18POH0dA0ob/QiwCBVrxIiwflhYuw0P0hBlOHeY4J5cdbs8ngdKHeWC/Kt9+ryP6fNoEQ1PUgPYw2Bs/rp5Q==} + /react-native-svg@13.2.0(react-native@0.71.11)(react@18.2.0): + resolution: {integrity: sha512-bDvMeFReA3F9pVp0EhACPrEerRcITzTu9N2m2lAPinhIMVvwzGzVXyFsXI8fCMSoeOIh+77hKvukoCedh06tLw==} peerDependencies: react: '*' react-native: '*' @@ -28922,7 +29005,3 @@ packages: version: 5.4.7 engines: {node: '>=0.11'} dev: true - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false From e8521ac0406311b72acf3cb71752be6920c6a13a Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Thu, 21 Sep 2023 22:49:11 -0400 Subject: [PATCH 13/18] clean --- .changeset/orange-pans-brake.md | 59 --------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 .changeset/orange-pans-brake.md diff --git a/.changeset/orange-pans-brake.md b/.changeset/orange-pans-brake.md deleted file mode 100644 index 3d01ddbb722..00000000000 --- a/.changeset/orange-pans-brake.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -"@thirdweb-dev/react-native": patch ---- - -Improved ConnectWallet UX/DevX :) - -1. Devs can now pass a `recommended` field to `supportedWallets` to recommend wallets to users. - -When recommending a wallet, this wallet will show up at the top of the wallets list. - -```javascript -import { metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react-native"; - - - -; -``` - -2. Better theme customization - -You can now more easily customize the theme of the ConnectWallet component: - -```javascript -import { ConnectWallet, darkTheme } from "@thirdweb-dev/react-native"; - -; -``` - -Note that you can still pass `light` or `dark` if you want to use one of the predefined thems :) - -3. You can now pass your Privacy Policy and Terms of Service urls, they will show up - at the bottom of the modal: - -```javascript -import { ConnectWallet, darkTheme } from "@thirdweb-dev/react-native"; - -; -``` - -4. Fixed a bug when you only specify an email wallet. In this case the app shouldn't auto connect, it should show the email field. From a17b2a1dcc4b9e468d8e0ad2240929073206d03b Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Fri, 22 Sep 2023 08:23:32 -0400 Subject: [PATCH 14/18] scroll and img --- .../SendFunds/SelectTokenButton.tsx | 7 +++- .../components/SendFunds/TokenSelector.tsx | 34 +++++++++++-------- .../evm/components/SendFunds/defaultTokens.ts | 8 ++--- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx b/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx index c90904bc227..92fb4c8d268 100644 --- a/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx +++ b/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx @@ -12,7 +12,12 @@ export function SelectTokenButton(props: { const tokenName = props.token?.name || balanceQuery.data?.name; return ( - + {props.token?.icon ? ( ) : ( diff --git a/packages/react-native/src/evm/components/SendFunds/TokenSelector.tsx b/packages/react-native/src/evm/components/SendFunds/TokenSelector.tsx index df95620a13a..a1a6051e569 100644 --- a/packages/react-native/src/evm/components/SendFunds/TokenSelector.tsx +++ b/packages/react-native/src/evm/components/SendFunds/TokenSelector.tsx @@ -9,7 +9,12 @@ import { TokenInfo, SupportedTokens } from "./defaultTokens"; import { utils } from "ethers"; import Box from "../base/Box"; import { ModalHeaderTextClose } from "../base/modal/ModalHeaderTextClose"; -import { ActivityIndicator, Dimensions, TextInput } from "react-native"; +import { + ActivityIndicator, + Dimensions, + ScrollView, + TextInput, +} from "react-native"; import { useAppTheme } from "../../styles/hooks"; import { SelectTokenButton } from "./SelectTokenButton"; import CloseIcon from "../../assets/close"; @@ -70,7 +75,7 @@ function useNativeToken(): TokenInfo | undefined { } } -const MODAL_HEIGHT = Dimensions.get("window").height * 0.7; +const MODAL_HEIGHT = Dimensions.get("window").height * 0.5; export function TokenSelector(props: { onTokenSelect: (token?: TokenInfo) => void; @@ -151,20 +156,21 @@ export function TokenSelector(props: { {filteredList.length > 0 && ( - {filteredList.map((token) => { - return ( - props.onTokenSelect(token)} - token={token} - key={token.address} - /> - ); - })} + + {filteredList.map((token) => { + return ( + props.onTokenSelect(token)} + token={token} + key={token.address} + /> + ); + })} + )} diff --git a/packages/react-native/src/evm/components/SendFunds/defaultTokens.ts b/packages/react-native/src/evm/components/SendFunds/defaultTokens.ts index 1928a9841fb..6679a5a3625 100644 --- a/packages/react-native/src/evm/components/SendFunds/defaultTokens.ts +++ b/packages/react-native/src/evm/components/SendFunds/defaultTokens.ts @@ -19,9 +19,9 @@ const usdcIcon = `wrapped-bitcoin-wbtc'; + 'wrapped-bitcoin-wbtc'; -const maticIcon = ` +const maticIcon = ` @@ -31,10 +31,10 @@ const binanceCoinIcon = ''; const BUSDIcon = - 'Asset 1'; + 'Asset 1'; const fantomIcon = - 'fa'; + 'fa'; export type SupportedTokens = Record; From 84b6aeb1b5055394afc22e7723c30b13149d0cb3 Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Fri, 22 Sep 2023 19:15:48 -0400 Subject: [PATCH 15/18] final version --- packages/chains/chains/12890.ts | 6 +- packages/chains/chains/2048.ts | 20 +- packages/chains/chains/221230.ts | 2 +- packages/chains/chains/2241.ts | 39 +++ packages/chains/chains/225.ts | 4 +- packages/chains/chains/274.ts | 4 +- packages/chains/chains/30.ts | 29 +- packages/chains/chains/31.ts | 16 +- packages/chains/chains/314.ts | 3 +- packages/chains/chains/314159.ts | 3 +- packages/chains/chains/333666.ts | 30 +++ packages/chains/chains/333777.ts | 20 +- packages/chains/chains/38400.ts | 34 +++ packages/chains/chains/5234.ts | 14 +- packages/chains/chains/534351.ts | 12 +- packages/chains/chains/751230.ts | 7 +- packages/chains/chains/81720.ts | 34 +++ packages/chains/package.json | 4 +- packages/chains/src/index.ts | 38 ++- packages/react-native/package.json | 2 +- packages/react-native/src/evm/assets/svgs.ts | 113 ++++++++ .../ConnectWalletDetails/ConnectAppField.tsx | 2 +- .../SmartWalletAdditionalActions.tsx | 53 ++-- .../WalletDetailsButton.tsx | 9 - .../ChooseWallet/ChooseWallet.tsx | 5 +- .../ConnectWalletFlow/ConnectWalletFlow.tsx | 18 +- .../SmartWallet/SmartWalletFlow.tsx | 255 +++++++----------- .../SendFunds/SelectTokenButton.tsx | 4 +- .../components/SendFunds/TokenSelector.tsx | 1 - .../src/evm/components/base/ImageSvgUri.tsx | 6 +- .../src/evm/wallets/types/smart-wallet.ts | 12 + .../src/evm/wallets/wallets/LocalWallet.ts | 4 +- .../evm/wallets/wallets/coinbase-wallet.ts | 4 +- .../evm/wallets/wallets/metamask-wallet.ts | 4 +- .../src/evm/wallets/wallets/rainbow-wallet.ts | 4 +- .../src/evm/wallets/wallets/smart-wallet.ts | 33 --- .../src/evm/wallets/wallets/smart-wallet.tsx | 32 +++ .../src/evm/wallets/wallets/trust-wallet.ts | 4 +- pnpm-lock.yaml | 14 +- 39 files changed, 566 insertions(+), 332 deletions(-) create mode 100644 packages/chains/chains/2241.ts create mode 100644 packages/chains/chains/333666.ts create mode 100644 packages/chains/chains/38400.ts create mode 100644 packages/chains/chains/81720.ts create mode 100644 packages/react-native/src/evm/assets/svgs.ts create mode 100644 packages/react-native/src/evm/wallets/types/smart-wallet.ts delete mode 100644 packages/react-native/src/evm/wallets/wallets/smart-wallet.ts create mode 100644 packages/react-native/src/evm/wallets/wallets/smart-wallet.tsx diff --git a/packages/chains/chains/12890.ts b/packages/chains/chains/12890.ts index 3e7117ad6ca..9ff7842cdb5 100644 --- a/packages/chains/chains/12890.ts +++ b/packages/chains/chains/12890.ts @@ -1,7 +1,7 @@ import type { Chain } from "../src/types"; export default { "name": "Quantum Chain Testnet", - "chain": "QNET", + "chain": "tQNET", "icon": { "url": "ipfs://bafkreibwywok67uewqbtqdzgr7nlk3lvvg7hxmbgwtn7kdwxe34useucvm", "width": 1024, @@ -15,11 +15,11 @@ export default { "faucets": [], "nativeCurrency": { "name": "Quantum Chain", - "symbol": "QNET", + "symbol": "tQNET", "decimals": 18 }, "infoURL": "https://quantumnetwork.gg", - "shortName": "qnet", + "shortName": "tqnet", "chainId": 12890, "networkId": 12890, "explorers": [ diff --git a/packages/chains/chains/2048.ts b/packages/chains/chains/2048.ts index 262d92c9090..abad714fb0e 100644 --- a/packages/chains/chains/2048.ts +++ b/packages/chains/chains/2048.ts @@ -1,8 +1,11 @@ import type { Chain } from "../src/types"; export default { - "name": "Stratos Mainnet", + "name": "Stratos", "chain": "STOS", - "rpc": [], + "rpc": [ + "https://stratos.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://web3-rpc.thestratos.org" + ], "faucets": [], "nativeCurrency": { "name": "STOS", @@ -13,7 +16,18 @@ export default { "shortName": "stos-mainnet", "chainId": 2048, "networkId": 2048, - "status": "incubating", + "explorers": [ + { + "name": "Stratos EVM Explorer (Blockscout)", + "url": "https://web3-explorer.thestratos.org", + "standard": "none" + }, + { + "name": "Stratos Cosmos Explorer (BigDipper)", + "url": "https://explorer.thestratos.org", + "standard": "none" + } + ], "testnet": false, "slug": "stratos" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/221230.ts b/packages/chains/chains/221230.ts index a5f6f1ce7d9..9a87c201e04 100644 --- a/packages/chains/chains/221230.ts +++ b/packages/chains/chains/221230.ts @@ -4,7 +4,7 @@ export default { "chain": "REAP", "rpc": [ "https://reapchain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://rpc.reapchain.org" + "https://eth.reapchain.org" ], "faucets": [], "nativeCurrency": { diff --git a/packages/chains/chains/2241.ts b/packages/chains/chains/2241.ts new file mode 100644 index 00000000000..58913ed460e --- /dev/null +++ b/packages/chains/chains/2241.ts @@ -0,0 +1,39 @@ +import type { Chain } from "../src/types"; +export default { + "name": "The Krest Network", + "chain": "Krest", + "icon": { + "url": "ipfs://bafkreid3bhzhughhjwq3rpgiic5zesj5mekqktawt646itdyqtvjxoupca", + "width": 257, + "height": 257, + "format": "svg" + }, + "rpc": [ + "https://the-krest-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://erpc-krest.peaq.network" + ], + "faucets": [], + "nativeCurrency": { + "name": "Krest", + "symbol": "KRST", + "decimals": 18 + }, + "infoURL": "https://www.peaq.network", + "shortName": "KRST", + "chainId": 2241, + "networkId": 2241, + "explorers": [ + { + "name": "Polkadot.js", + "url": "https://polkadot.js.org/apps/?rpc=wss://wss-krest.peaq.network#/explorer", + "standard": "none" + }, + { + "name": "Subscan", + "url": "https://krest.subscan.io", + "standard": "none" + } + ], + "testnet": false, + "slug": "the-krest-network" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/225.ts b/packages/chains/chains/225.ts index 8803cea8ff4..22c4a5d3531 100644 --- a/packages/chains/chains/225.ts +++ b/packages/chains/chains/225.ts @@ -9,7 +9,7 @@ export default { "format": "png" }, "rpc": [ - "https://lachain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://lachain-LA.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://rpc-mainnet.lachain.io" ], "faucets": [], @@ -30,5 +30,5 @@ export default { } ], "testnet": false, - "slug": "lachain" + "slug": "lachain-LA" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/274.ts b/packages/chains/chains/274.ts index 8b5bb536108..1ce1f5db9f0 100644 --- a/packages/chains/chains/274.ts +++ b/packages/chains/chains/274.ts @@ -9,7 +9,7 @@ export default { "format": "png" }, "rpc": [ - "https://lachain-lachain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://lachain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://rpc1.mainnet.lachain.network", "https://rpc2.mainnet.lachain.network", "https://lachain.rpc-nodes.cedalio.dev" @@ -37,5 +37,5 @@ export default { } ], "testnet": false, - "slug": "lachain-lachain" + "slug": "lachain" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/30.ts b/packages/chains/chains/30.ts index b516892736e..eb1658dc048 100644 --- a/packages/chains/chains/30.ts +++ b/packages/chains/chains/30.ts @@ -1,30 +1,47 @@ import type { Chain } from "../src/types"; export default { - "name": "RSK Mainnet", - "chain": "RSK", + "name": "Rootstock Mainnet", + "chain": "Rootstock", "rpc": [ - "https://rsk.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://rootstock.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://public-node.rsk.co", "https://mycrypto.rsk.co" ], "faucets": [], + "icon": { + "url": "ipfs://bafkreigidzbf22dnpmmlfxv6u7oifq6ln33j4n57ox4ipiproalufrheym", + "width": 3000, + "height": 3325, + "format": "png" + }, "nativeCurrency": { "name": "Smart Bitcoin", "symbol": "RBTC", "decimals": 18 }, - "infoURL": "https://rsk.co", + "infoURL": "https://rootstock.io", "shortName": "rsk", "chainId": 30, "networkId": 30, "slip44": 137, "explorers": [ { - "name": "RSK Explorer", + "name": "blockscout", + "url": "https://rootstock.blockscout.com", + "icon": { + "url": "ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM", + "width": 551, + "height": 540, + "format": "png" + }, + "standard": "EIP3091" + }, + { + "name": "Rootstock Explorer", "url": "https://explorer.rsk.co", "standard": "EIP3091" } ], "testnet": false, - "slug": "rsk" + "slug": "rootstock" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/31.ts b/packages/chains/chains/31.ts index d7eadb11b44..b6e7cffba6c 100644 --- a/packages/chains/chains/31.ts +++ b/packages/chains/chains/31.ts @@ -1,21 +1,27 @@ import type { Chain } from "../src/types"; export default { - "name": "RSK Testnet", - "chain": "RSK", + "name": "Rootstock Testnet", + "chain": "Rootstock", "rpc": [ - "https://rsk-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://rootstock-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://public-node.testnet.rsk.co", "https://mycrypto.testnet.rsk.co" ], "faucets": [ "https://faucet.rsk.co/" ], + "icon": { + "url": "ipfs://bafkreigidzbf22dnpmmlfxv6u7oifq6ln33j4n57ox4ipiproalufrheym", + "width": 3000, + "height": 3325, + "format": "png" + }, "nativeCurrency": { "name": "Testnet Smart Bitcoin", "symbol": "tRBTC", "decimals": 18 }, - "infoURL": "https://rsk.co", + "infoURL": "https://rootstock.io", "shortName": "trsk", "chainId": 31, "networkId": 31, @@ -27,5 +33,5 @@ export default { } ], "testnet": true, - "slug": "rsk-testnet" + "slug": "rootstock-testnet" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/314.ts b/packages/chains/chains/314.ts index 58cd8e21db2..c07f76d99bd 100644 --- a/packages/chains/chains/314.ts +++ b/packages/chains/chains/314.ts @@ -12,7 +12,8 @@ export default { "https://filecoin.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://api.node.glif.io/", "https://rpc.ankr.com/filecoin", - "https://filecoin-mainnet.chainstacklabs.com/rpc/v1" + "https://filecoin-mainnet.chainstacklabs.com/rpc/v1", + "https://filfox.info/rpc/v1" ], "faucets": [], "nativeCurrency": { diff --git a/packages/chains/chains/314159.ts b/packages/chains/chains/314159.ts index d7c05ac6873..23e7f71ef02 100644 --- a/packages/chains/chains/314159.ts +++ b/packages/chains/chains/314159.ts @@ -13,7 +13,8 @@ export default { "https://api.calibration.node.glif.io/rpc/v1", "https://rpc.ankr.com/filecoin_testnet", "https://filecoin-calibration.chainstacklabs.com/rpc/v1", - "https://filecoin-calibration.chainup.net/rpc/v1" + "https://filecoin-calibration.chainup.net/rpc/v1", + "https://calibration.filfox.info/rpc/v1" ], "faucets": [ "https://faucet.calibration.fildev.network/" diff --git a/packages/chains/chains/333666.ts b/packages/chains/chains/333666.ts new file mode 100644 index 00000000000..20240ac79b3 --- /dev/null +++ b/packages/chains/chains/333666.ts @@ -0,0 +1,30 @@ +import type { Chain } from "../src/types"; +export default { + "name": "Oone Chain Testnet", + "chain": "OONE Testnet", + "rpc": [ + "https://oone-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://rpc.testnet.oonechain.com" + ], + "faucets": [ + "https://apps-test.adigium.com/faucet" + ], + "nativeCurrency": { + "name": "tOONE", + "symbol": "tOONE", + "decimals": 18 + }, + "infoURL": "https://oonechain.com", + "shortName": "oonetest", + "chainId": 333666, + "networkId": 333666, + "explorers": [ + { + "name": "blockscout", + "url": "https://testnet.oonescan.com", + "standard": "none" + } + ], + "testnet": true, + "slug": "oone-chain-testnet" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/333777.ts b/packages/chains/chains/333777.ts index 63752c10e7c..b80d5625f4f 100644 --- a/packages/chains/chains/333777.ts +++ b/packages/chains/chains/333777.ts @@ -1,30 +1,30 @@ import type { Chain } from "../src/types"; export default { - "name": "Oone Chain Testnet", - "chain": "OONE", + "name": "Oone Chain Devnet", + "chain": "OONE Devnet", "rpc": [ - "https://oone-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://blockchain-test.adigium.world" + "https://oone-chain-devnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://rpc.dev.oonechain.com" ], "faucets": [ "https://apps-test.adigium.com/faucet" ], "nativeCurrency": { - "name": "Oone", + "name": "tOONE", "symbol": "tOONE", "decimals": 18 }, - "infoURL": "https://oone.world", - "shortName": "oonetest", + "infoURL": "https://oonechain.com", + "shortName": "oonedev", "chainId": 333777, "networkId": 333777, "explorers": [ { - "name": "expedition", - "url": "https://explorer-test.adigium.world", + "name": "blockscout", + "url": "https://dev.oonescan.com", "standard": "none" } ], "testnet": true, - "slug": "oone-chain-testnet" + "slug": "oone-chain-devnet" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/38400.ts b/packages/chains/chains/38400.ts new file mode 100644 index 00000000000..7039a929910 --- /dev/null +++ b/packages/chains/chains/38400.ts @@ -0,0 +1,34 @@ +import type { Chain } from "../src/types"; +export default { + "name": "ConnectorManager", + "chain": "Rangers", + "icon": { + "url": "ipfs://QmXR5e5SDABWfQn6XT9uMsVYAo5Bv7vUv4jVs8DFqatZWG", + "width": 2000, + "height": 2000, + "format": "png" + }, + "rpc": [ + "https://connectormanager.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://cm.rangersprotocol.com/api/jsonrpc" + ], + "faucets": [], + "nativeCurrency": { + "name": "Rangers Protocol Gas", + "symbol": "cmRPG", + "decimals": 18 + }, + "infoURL": "https://rangersprotocol.com", + "shortName": "cmrpg", + "chainId": 38400, + "networkId": 38400, + "explorers": [ + { + "name": "rangersscan", + "url": "https://scan.rangersprotocol.com", + "standard": "none" + } + ], + "testnet": false, + "slug": "connectormanager" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/5234.ts b/packages/chains/chains/5234.ts index d582c77af82..bb1bafb13be 100644 --- a/packages/chains/chains/5234.ts +++ b/packages/chains/chains/5234.ts @@ -16,7 +16,19 @@ export default { "shortName": "hmnd", "chainId": 5234, "networkId": 5234, - "explorers": [], + "explorers": [ + { + "name": "Subscan", + "url": "https://humanode.subscan.io", + "standard": "EIP3091", + "icon": { + "url": "ipfs://Qma2GfW5nQHuA7nGqdEfwaXPL63G9oTwRTQKaGTfjNtM2W", + "width": 400, + "height": 400, + "format": "png" + } + } + ], "testnet": false, "slug": "humanode" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/534351.ts b/packages/chains/chains/534351.ts index 88eb6487bab..dc501ddf282 100644 --- a/packages/chains/chains/534351.ts +++ b/packages/chains/chains/534351.ts @@ -5,7 +5,10 @@ export default { "status": "active", "rpc": [ "https://scroll-sepolia-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", - "https://sepolia-rpc.scroll.io/" + "https://sepolia-rpc.scroll.io", + "https://rpc.ankr.com/scroll_sepolia_testnet", + "https://scroll-sepolia.chainstacklabs.com", + "https://scroll-testnet-public.unifra.io" ], "faucets": [], "nativeCurrency": { @@ -19,7 +22,12 @@ export default { "networkId": 534351, "explorers": [ { - "name": "Scroll Sepolia Testnet Block Explorer", + "name": "Scroll Sepolia Etherscan", + "url": "https://sepolia.scrollscan.dev", + "standard": "EIP3091" + }, + { + "name": "Scroll Sepolia Blockscout", "url": "https://sepolia-blockscout.scroll.io", "standard": "EIP3091" } diff --git a/packages/chains/chains/751230.ts b/packages/chains/chains/751230.ts index 21371e6fbc8..a309f7e0551 100644 --- a/packages/chains/chains/751230.ts +++ b/packages/chains/chains/751230.ts @@ -2,12 +2,7 @@ import type { Chain } from "../src/types"; export default { "name": "Bear Network Chain Testnet", "chain": "BRNKCTEST", - "icon": { - "url": "ipfs://QmQqhH28QpUrreoRw5Gj8YShzdHxxVGMjfVrx3TqJNLSLv", - "width": 1067, - "height": 1067, - "format": "png" - }, + "icon": "brnkc", "rpc": [ "https://bear-network-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://brnkc-test.bearnetwork.net" diff --git a/packages/chains/chains/81720.ts b/packages/chains/chains/81720.ts new file mode 100644 index 00000000000..6bfc177238b --- /dev/null +++ b/packages/chains/chains/81720.ts @@ -0,0 +1,34 @@ +import type { Chain } from "../src/types"; +export default { + "name": "Quantum Chain Mainnet", + "chain": "QNET", + "icon": { + "url": "ipfs://bafkreibwywok67uewqbtqdzgr7nlk3lvvg7hxmbgwtn7kdwxe34useucvm", + "width": 1024, + "height": 1024, + "format": "png" + }, + "rpc": [ + "https://quantum-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://rpc.quantumscan.org" + ], + "faucets": [], + "nativeCurrency": { + "name": "Quantum Chain", + "symbol": "QNET", + "decimals": 18 + }, + "infoURL": "https://quantumnetwork.gg", + "shortName": "qnet", + "chainId": 81720, + "networkId": 81720, + "explorers": [ + { + "name": "Quantum Scan Mainnet", + "url": "https://quantumscan.org", + "standard": "EIP3091" + } + ], + "testnet": false, + "slug": "quantum-chain" +} as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/package.json b/packages/chains/package.json index f15c4513b73..af9f9998067 100644 --- a/packages/chains/package.json +++ b/packages/chains/package.json @@ -49,8 +49,8 @@ }, "sideEffects": false, "scripts": { - "build": "node ./scripts/generate-package.mjs && tsc && preconstruct build", - "push": "yalc push", + "build": "", + "push": "", "plop": "plop", "add-chain": "plop add-chain", "override-chain": "plop override-chain", diff --git a/packages/chains/src/index.ts b/packages/chains/src/index.ts index 6b4bc00570d..4bf7df3a635 100644 --- a/packages/chains/src/index.ts +++ b/packages/chains/src/index.ts @@ -458,6 +458,7 @@ import c2213 from "../chains/2213"; import c2221 from "../chains/2221"; import c2222 from "../chains/2222"; import c2223 from "../chains/2223"; +import c2241 from "../chains/2241"; import c2300 from "../chains/2300"; import c2309 from "../chains/2309"; import c2323 from "../chains/2323"; @@ -745,6 +746,7 @@ import c33333 from "../chains/33333"; import c35011 from "../chains/35011"; import c35441 from "../chains/35441"; import c35443 from "../chains/35443"; +import c38400 from "../chains/38400"; import c38401 from "../chains/38401"; import c39797 from "../chains/39797"; import c39815 from "../chains/39815"; @@ -826,6 +828,7 @@ import c81353 from "../chains/81353"; import c81361 from "../chains/81361"; import c81362 from "../chains/81362"; import c81363 from "../chains/81363"; +import c81720 from "../chains/81720"; import c84531 from "../chains/84531"; import c84886 from "../chains/84886"; import c85449 from "../chains/85449"; @@ -896,6 +899,7 @@ import c281121 from "../chains/281121"; import c314159 from "../chains/314159"; import c330844 from "../chains/330844"; import c333331 from "../chains/333331"; +import c333666 from "../chains/333666"; import c333777 from "../chains/333777"; import c333888 from "../chains/333888"; import c333999 from "../chains/333999"; @@ -1077,8 +1081,8 @@ export { default as GenesisL1Testnet } from "../chains/26" export { default as Shibachain } from "../chains/27" export { default as BobaNetworkRinkebyTestnet } from "../chains/28" export { default as GenesisL1 } from "../chains/29" -export { default as Rsk } from "../chains/30" -export { default as RskTestnet } from "../chains/31" +export { default as Rootstock } from "../chains/30" +export { default as RootstockTestnet } from "../chains/31" export { default as GooddataTestnet } from "../chains/32" export { default as Gooddata } from "../chains/33" export { default as DithereumTestnet } from "../chains/34" @@ -1215,7 +1219,7 @@ export { default as Bitnet } from "../chains/210" export { default as FreightTrustNetwork } from "../chains/211" export { default as MapMakalu } from "../chains/212" export { default as SiriusnetV2 } from "../chains/217" -export { default as Lachain } from "../chains/225" +export { default as LachainLA } from "../chains/225" export { default as LachainTestnet } from "../chains/226" export { default as Swapdex } from "../chains/230" export { default as DeamchainTestnet } from "../chains/236" @@ -1230,7 +1234,7 @@ export { default as Neonlink } from "../chains/259" export { default as SurBlockchainNetwork } from "../chains/262" export { default as HighPerformanceBlockchain } from "../chains/269" export { default as Egoncoin } from "../chains/271" -export { default as LachainLachain } from "../chains/274" +export { default as Lachain } from "../chains/274" export { default as ZksyncEraTestnet } from "../chains/280" export { default as BobaNetwork } from "../chains/288" export { default as Hedera } from "../chains/295" @@ -1509,6 +1513,7 @@ export { default as Evanesco } from "../chains/2213" export { default as KavaTestnet } from "../chains/2221" export { default as Kava } from "../chains/2222" export { default as Vchain } from "../chains/2223" +export { default as TheKrestNetwork } from "../chains/2241" export { default as BombChain } from "../chains/2300" export { default as Arevia } from "../chains/2309" export { default as SomaNetworkTestnet } from "../chains/2323" @@ -1796,6 +1801,7 @@ export { default as Aves } from "../chains/33333" export { default as J2oTaro } from "../chains/35011" export { default as Q } from "../chains/35441" export { default as QTestnet } from "../chains/35443" +export { default as Connectormanager } from "../chains/38400" export { default as ConnectormanagerRobin } from "../chains/38401" export { default as Energi } from "../chains/39797" export { default as Oho } from "../chains/39815" @@ -1877,6 +1883,7 @@ export { default as FlanaPrivnet } from "../chains/81353" export { default as MizanaTestnet } from "../chains/81361" export { default as MizanaMixnet } from "../chains/81362" export { default as MizanaPrivnet } from "../chains/81363" +export { default as QuantumChain } from "../chains/81720" export { default as BaseGoerli } from "../chains/84531" export { default as AerieNetwork } from "../chains/84886" export { default as Cybertrust } from "../chains/85449" @@ -1947,7 +1954,8 @@ export { default as SocialSmartChain } from "../chains/281121" export { default as FilecoinCalibrationTestnet } from "../chains/314159" export { default as TtcoinSmartChain } from "../chains/330844" export { default as AvesTestnet } from "../chains/333331" -export { default as OoneChainTestnet } from "../chains/333777" +export { default as OoneChainTestnet } from "../chains/333666" +export { default as OoneChainDevnet } from "../chains/333777" export { default as PolisTestnet } from "../chains/333888" export { default as Polis } from "../chains/333999" export { default as BitfinityNetworkTestnet } from "../chains/355113" @@ -2102,7 +2110,7 @@ export * from "./types"; export * from "./utils"; export const defaultChains = [c1, c5, c8453, c84531, c137, c80001, c42161, c421613, c10, c420, c56, c97, c250, c4002, c43114, c43113, c1337]; // @ts-expect-error - TODO: fix this later -export const allChains: Chain[] = [c1, c2, c3, c4, c5, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c38, c39, c40, c41, c42, c43, c44, c45, c46, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72, c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84, c85, c86, c87, c88, c89, c90, c91, c92, c93, c94, c95, c96, c97, c98, c99, c100, c101, c102, c103, c104, c105, c106, c107, c108, c109, c110, c111, c112, c113, c114, c117, c118, c119, c120, c121, c122, c123, c124, c125, c126, c127, c128, c134, c135, c136, c137, c138, c139, c141, c142, c144, c150, c151, c152, c153, c154, c155, c156, c160, c161, c162, c163, c165, c167, c168, c169, c170, c172, c180, c186, c188, c189, c193, c195, c196, c197, c198, c199, c200, c201, c204, c208, c210, c211, c212, c217, c225, c226, c230, c236, c242, c246, c248, c250, c255, c256, c258, c259, c262, c269, c271, c274, c280, c288, c295, c296, c297, c298, c301, c303, c309, c311, c313, c314, c321, c322, c324, c333, c335, c336, c338, c345, c361, c363, c364, c365, c369, c371, c385, c400, c401, c411, c416, c418, c420, c424, c427, c443, c444, c456, c462, c499, c500, c501, c512, c513, c516, c520, c529, c530, c534, c542, c555, c558, c568, c570, c592, c595, c596, c597, c599, c600, c601, c614, c634, c647, c648, c666, c667, c668, c669, c686, c700, c707, c708, c719, c721, c741, c742, c766, c776, c777, c786, c787, c788, c789, c800, c803, c808, c813, c818, c820, c841, c842, c859, c868, c876, c877, c880, c888, c900, c901, c902, c903, c909, c910, c917, c927, c943, c956, c970, c971, c972, c977, c980, c985, c989, c990, c997, c998, c1000, c1001, c1003, c1004, c1007, c1008, c1010, c1012, c1022, c1023, c1024, c1028, c1030, c1031, c1038, c1039, c1072, c1079, c1080, c1088, c1089, c1099, c1101, c1107, c1108, c1111, c1112, c1115, c1116, c1117, c1130, c1131, c1133, c1138, c1139, c1140, c1149, c1170, c1177, c1197, c1201, c1202, c1213, c1214, c1229, c1230, c1231, c1234, c1243, c1244, c1246, c1252, c1280, c1284, c1285, c1287, c1288, c1291, c1294, c1297, c1311, c1314, c1319, c1320, c1338, c1339, c1353, c1369, c1379, c1388, c1392, c1433, c1440, c1442, c1452, c1455, c1501, c1506, c1507, c1515, c1559, c1618, c1620, c1657, c1663, c1688, c1701, c1707, c1708, c1718, c1773, c1777, c1804, c1807, c1818, c1819, c1856, c1875, c1881, c1890, c1891, c1898, c1907, c1908, c1945, c1951, c1954, c1967, c1969, c1970, c1971, c1975, c1984, c1985, c1986, c1987, c1994, c1995, c2000, c2001, c2002, c2008, c2009, c2016, c2018, c2019, c2020, c2021, c2022, c2023, c2025, c2031, c2032, c2037, c2038, c2043, c2044, c2047, c2048, c2077, c2088, c2089, c2100, c2101, c2109, c2122, c2124, c2137, c2138, c2151, c2152, c2153, c2154, c2199, c2202, c2203, c2213, c2221, c2222, c2223, c2300, c2309, c2323, c2330, c2332, c2358, c2399, c2400, c2415, c2484, c2559, c2569, c2606, c2611, c2612, c2613, c2625, c2710, c2888, c2999, c3000, c3001, c3003, c3011, c3031, c3068, c3269, c3270, c3306, c3331, c3333, c3334, c3400, c3434, c3500, c3501, c3601, c3602, c3636, c3637, c3666, c3690, c3693, c3698, c3699, c3737, c3797, c3888, c3889, c3912, c3939, c3966, c3967, c3999, c4000, c4001, c4002, c4051, c4061, c4062, c4090, c4096, c4099, c4102, c4141, c4181, c4201, c4242, c4328, c4337, c4444, c4460, c4689, c4690, c4759, c4777, c4918, c4919, c4999, c5000, c5001, c5002, c5005, c5165, c5177, c5197, c5234, c5315, c5353, c5522, c5551, c5553, c5555, c5616, c5678, c5700, c5729, c5758, c5777, c5851, c5869, c6065, c6066, c6102, c6118, c6119, c6502, c6552, c6565, c6626, c6688, c6789, c6969, c6999, c7000, c7001, c7027, c7070, c7171, c7331, c7332, c7341, c7484, c7518, c7575, c7576, c7668, c7672, c7700, c7701, c7771, c7777, c7878, c7895, c7979, c8000, c8001, c8029, c8080, c8082, c8086, c8098, c8131, c8132, c8133, c8134, c8135, c8136, c8181, c8217, c8272, c8285, c8387, c8453, c8654, c8655, c8723, c8724, c8738, c8768, c8848, c8880, c8881, c8882, c8883, c8888, c8889, c8898, c8899, c8989, c8995, c9000, c9001, c9012, c9100, c9223, c9339, c9527, c9528, c9559, c9700, c9728, c9768, c9779, c9790, c9792, c9818, c9819, c9977, c9990, c9996, c9997, c9999, c10000, c10001, c10024, c10081, c10086, c10101, c10200, c10201, c10243, c10248, c10395, c10507, c10508, c10823, c10946, c10947, c11110, c11111, c11115, c11119, c11235, c11437, c11612, c11888, c11891, c12009, c12051, c12052, c12123, c12306, c12321, c12345, c12715, c12890, c13000, c13308, c13337, c13381, c13812, c14000, c14853, c15551, c15555, c15557, c16000, c16001, c16507, c16688, c16718, c16888, c17000, c17180, c17777, c18000, c18122, c18159, c18686, c19011, c19845, c20001, c20729, c20736, c21337, c21816, c22023, c22040, c22222, c22776, c23006, c23118, c23294, c23295, c24484, c24734, c25888, c25925, c26026, c26600, c26863, c28528, c30067, c30103, c31102, c31223, c31224, c31337, c32520, c32659, c32769, c33101, c33333, c35011, c35441, c35443, c38401, c39797, c39815, c41500, c42069, c42161, c42170, c42220, c42261, c42262, c42888, c43110, c43113, c43114, c43288, c44444, c44787, c45000, c46688, c47805, c49049, c49088, c49797, c50001, c50021, c51178, c51712, c53935, c54211, c54321, c55004, c55555, c55556, c56288, c56789, c57000, c58008, c59140, c60000, c60001, c60002, c60103, c61800, c61803, c61916, c62320, c62621, c63000, c63001, c65450, c67588, c69420, c70000, c70001, c70002, c70103, c71111, c71393, c71401, c71402, c73799, c73927, c75000, c77612, c77777, c78110, c78281, c78430, c78431, c78432, c79879, c80001, c81341, c81342, c81343, c81351, c81352, c81353, c81361, c81362, c81363, c84531, c84886, c85449, c88002, c88880, c90210, c91002, c92001, c96970, c99099, c99998, c99999, c100000, c100001, c100002, c100003, c100004, c100005, c100006, c100007, c100008, c100009, c100010, c101010, c103090, c108801, c110000, c110001, c110002, c110003, c110004, c110005, c110006, c110007, c110008, c111000, c111111, c112358, c123456, c131419, c142857, c167005, c167006, c167007, c188881, c200101, c200202, c200625, c201018, c201030, c201804, c202020, c202624, c210425, c220315, c221230, c221231, c224168, c230315, c234666, c246529, c246785, c247253, c256256, c266256, c271271, c281121, c314159, c330844, c333331, c333777, c333888, c333999, c355113, c373737, c381931, c381932, c404040, c420420, c420666, c420692, c421611, c421613, c421614, c424242, c431140, c432201, c432204, c444900, c471100, c474142, c512512, c513100, c534351, c534352, c534353, c534849, c535037, c622277, c641230, c651940, c666666, c751230, c761412, c800001, c827431, c846000, c888888, c900000, c910000, c920000, c920001, c923018, c955305, c1313114, c1313500, c1337702, c1337802, c1337803, c2021398, c2099156, c2206132, c3141592, c3441005, c4000003, c4281033, c5167003, c5555555, c5555558, c7225878, c7355310, c7668378, c7762959, c7777777, c8007736, c8794598, c8888881, c8888888, c10067275, c10101010, c11155111, c13371337, c14288640, c16658437, c18289463, c20180430, c20181205, c20201022, c22052002, c27082017, c27082022, c28945486, c29032022, c31415926, c35855456, c43214913, c61717561, c65010000, c65100000, c88888888, c99415706, c192837465, c222000222, c245022926, c245022934, c245022940, c278611351, c311752642, c333000333, c344106930, c356256156, c486217935, c503129905, c1122334455, c1146703430, c1273227453, c1313161554, c1313161555, c1313161556, c1351057110, c1380996178, c1482601649, c1564830818, c1666600000, c1666600001, c1666600002, c1666600003, c1666700000, c1666700001, c1666900000, c1666900001, c2021121117, c2046399126, c2863311531, c3125659152, c4216137055, c11297108099, c11297108109, c111222333444, c197710212030, c197710212031, c383414847825, c666301171999, c6022140761023, c1337, c1440001, c1582, c331769, c331771, c37, c408, c47, c47279324479, c5611, c59144, c8081, c88882, c88888, c91003, c919, c999]; +export const allChains: Chain[] = [c1, c2, c3, c4, c5, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c38, c39, c40, c41, c42, c43, c44, c45, c46, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72, c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84, c85, c86, c87, c88, c89, c90, c91, c92, c93, c94, c95, c96, c97, c98, c99, c100, c101, c102, c103, c104, c105, c106, c107, c108, c109, c110, c111, c112, c113, c114, c117, c118, c119, c120, c121, c122, c123, c124, c125, c126, c127, c128, c134, c135, c136, c137, c138, c139, c141, c142, c144, c150, c151, c152, c153, c154, c155, c156, c160, c161, c162, c163, c165, c167, c168, c169, c170, c172, c180, c186, c188, c189, c193, c195, c196, c197, c198, c199, c200, c201, c204, c208, c210, c211, c212, c217, c225, c226, c230, c236, c242, c246, c248, c250, c255, c256, c258, c259, c262, c269, c271, c274, c280, c288, c295, c296, c297, c298, c301, c303, c309, c311, c313, c314, c321, c322, c324, c333, c335, c336, c338, c345, c361, c363, c364, c365, c369, c371, c385, c400, c401, c411, c416, c418, c420, c424, c427, c443, c444, c456, c462, c499, c500, c501, c512, c513, c516, c520, c529, c530, c534, c542, c555, c558, c568, c570, c592, c595, c596, c597, c599, c600, c601, c614, c634, c647, c648, c666, c667, c668, c669, c686, c700, c707, c708, c719, c721, c741, c742, c766, c776, c777, c786, c787, c788, c789, c800, c803, c808, c813, c818, c820, c841, c842, c859, c868, c876, c877, c880, c888, c900, c901, c902, c903, c909, c910, c917, c927, c943, c956, c970, c971, c972, c977, c980, c985, c989, c990, c997, c998, c1000, c1001, c1003, c1004, c1007, c1008, c1010, c1012, c1022, c1023, c1024, c1028, c1030, c1031, c1038, c1039, c1072, c1079, c1080, c1088, c1089, c1099, c1101, c1107, c1108, c1111, c1112, c1115, c1116, c1117, c1130, c1131, c1133, c1138, c1139, c1140, c1149, c1170, c1177, c1197, c1201, c1202, c1213, c1214, c1229, c1230, c1231, c1234, c1243, c1244, c1246, c1252, c1280, c1284, c1285, c1287, c1288, c1291, c1294, c1297, c1311, c1314, c1319, c1320, c1338, c1339, c1353, c1369, c1379, c1388, c1392, c1433, c1440, c1442, c1452, c1455, c1501, c1506, c1507, c1515, c1559, c1618, c1620, c1657, c1663, c1688, c1701, c1707, c1708, c1718, c1773, c1777, c1804, c1807, c1818, c1819, c1856, c1875, c1881, c1890, c1891, c1898, c1907, c1908, c1945, c1951, c1954, c1967, c1969, c1970, c1971, c1975, c1984, c1985, c1986, c1987, c1994, c1995, c2000, c2001, c2002, c2008, c2009, c2016, c2018, c2019, c2020, c2021, c2022, c2023, c2025, c2031, c2032, c2037, c2038, c2043, c2044, c2047, c2048, c2077, c2088, c2089, c2100, c2101, c2109, c2122, c2124, c2137, c2138, c2151, c2152, c2153, c2154, c2199, c2202, c2203, c2213, c2221, c2222, c2223, c2241, c2300, c2309, c2323, c2330, c2332, c2358, c2399, c2400, c2415, c2484, c2559, c2569, c2606, c2611, c2612, c2613, c2625, c2710, c2888, c2999, c3000, c3001, c3003, c3011, c3031, c3068, c3269, c3270, c3306, c3331, c3333, c3334, c3400, c3434, c3500, c3501, c3601, c3602, c3636, c3637, c3666, c3690, c3693, c3698, c3699, c3737, c3797, c3888, c3889, c3912, c3939, c3966, c3967, c3999, c4000, c4001, c4002, c4051, c4061, c4062, c4090, c4096, c4099, c4102, c4141, c4181, c4201, c4242, c4328, c4337, c4444, c4460, c4689, c4690, c4759, c4777, c4918, c4919, c4999, c5000, c5001, c5002, c5005, c5165, c5177, c5197, c5234, c5315, c5353, c5522, c5551, c5553, c5555, c5616, c5678, c5700, c5729, c5758, c5777, c5851, c5869, c6065, c6066, c6102, c6118, c6119, c6502, c6552, c6565, c6626, c6688, c6789, c6969, c6999, c7000, c7001, c7027, c7070, c7171, c7331, c7332, c7341, c7484, c7518, c7575, c7576, c7668, c7672, c7700, c7701, c7771, c7777, c7878, c7895, c7979, c8000, c8001, c8029, c8080, c8082, c8086, c8098, c8131, c8132, c8133, c8134, c8135, c8136, c8181, c8217, c8272, c8285, c8387, c8453, c8654, c8655, c8723, c8724, c8738, c8768, c8848, c8880, c8881, c8882, c8883, c8888, c8889, c8898, c8899, c8989, c8995, c9000, c9001, c9012, c9100, c9223, c9339, c9527, c9528, c9559, c9700, c9728, c9768, c9779, c9790, c9792, c9818, c9819, c9977, c9990, c9996, c9997, c9999, c10000, c10001, c10024, c10081, c10086, c10101, c10200, c10201, c10243, c10248, c10395, c10507, c10508, c10823, c10946, c10947, c11110, c11111, c11115, c11119, c11235, c11437, c11612, c11888, c11891, c12009, c12051, c12052, c12123, c12306, c12321, c12345, c12715, c12890, c13000, c13308, c13337, c13381, c13812, c14000, c14853, c15551, c15555, c15557, c16000, c16001, c16507, c16688, c16718, c16888, c17000, c17180, c17777, c18000, c18122, c18159, c18686, c19011, c19845, c20001, c20729, c20736, c21337, c21816, c22023, c22040, c22222, c22776, c23006, c23118, c23294, c23295, c24484, c24734, c25888, c25925, c26026, c26600, c26863, c28528, c30067, c30103, c31102, c31223, c31224, c31337, c32520, c32659, c32769, c33101, c33333, c35011, c35441, c35443, c38400, c38401, c39797, c39815, c41500, c42069, c42161, c42170, c42220, c42261, c42262, c42888, c43110, c43113, c43114, c43288, c44444, c44787, c45000, c46688, c47805, c49049, c49088, c49797, c50001, c50021, c51178, c51712, c53935, c54211, c54321, c55004, c55555, c55556, c56288, c56789, c57000, c58008, c59140, c60000, c60001, c60002, c60103, c61800, c61803, c61916, c62320, c62621, c63000, c63001, c65450, c67588, c69420, c70000, c70001, c70002, c70103, c71111, c71393, c71401, c71402, c73799, c73927, c75000, c77612, c77777, c78110, c78281, c78430, c78431, c78432, c79879, c80001, c81341, c81342, c81343, c81351, c81352, c81353, c81361, c81362, c81363, c81720, c84531, c84886, c85449, c88002, c88880, c90210, c91002, c92001, c96970, c99099, c99998, c99999, c100000, c100001, c100002, c100003, c100004, c100005, c100006, c100007, c100008, c100009, c100010, c101010, c103090, c108801, c110000, c110001, c110002, c110003, c110004, c110005, c110006, c110007, c110008, c111000, c111111, c112358, c123456, c131419, c142857, c167005, c167006, c167007, c188881, c200101, c200202, c200625, c201018, c201030, c201804, c202020, c202624, c210425, c220315, c221230, c221231, c224168, c230315, c234666, c246529, c246785, c247253, c256256, c266256, c271271, c281121, c314159, c330844, c333331, c333666, c333777, c333888, c333999, c355113, c373737, c381931, c381932, c404040, c420420, c420666, c420692, c421611, c421613, c421614, c424242, c431140, c432201, c432204, c444900, c471100, c474142, c512512, c513100, c534351, c534352, c534353, c534849, c535037, c622277, c641230, c651940, c666666, c751230, c761412, c800001, c827431, c846000, c888888, c900000, c910000, c920000, c920001, c923018, c955305, c1313114, c1313500, c1337702, c1337802, c1337803, c2021398, c2099156, c2206132, c3141592, c3441005, c4000003, c4281033, c5167003, c5555555, c5555558, c7225878, c7355310, c7668378, c7762959, c7777777, c8007736, c8794598, c8888881, c8888888, c10067275, c10101010, c11155111, c13371337, c14288640, c16658437, c18289463, c20180430, c20181205, c20201022, c22052002, c27082017, c27082022, c28945486, c29032022, c31415926, c35855456, c43214913, c61717561, c65010000, c65100000, c88888888, c99415706, c192837465, c222000222, c245022926, c245022934, c245022940, c278611351, c311752642, c333000333, c344106930, c356256156, c486217935, c503129905, c1122334455, c1146703430, c1273227453, c1313161554, c1313161555, c1313161556, c1351057110, c1380996178, c1482601649, c1564830818, c1666600000, c1666600001, c1666600002, c1666600003, c1666700000, c1666700001, c1666900000, c1666900001, c2021121117, c2046399126, c2863311531, c3125659152, c4216137055, c11297108099, c11297108109, c111222333444, c197710212030, c197710212031, c383414847825, c666301171999, c6022140761023, c1337, c1440001, c1582, c331769, c331771, c37, c408, c47, c47279324479, c5611, c59144, c8081, c88882, c88888, c91003, c919, c999]; type ChainsById = { 1: typeof c1, @@ -2565,6 +2573,7 @@ type ChainsById = { 2221: typeof c2221, 2222: typeof c2222, 2223: typeof c2223, +2241: typeof c2241, 2300: typeof c2300, 2309: typeof c2309, 2323: typeof c2323, @@ -2852,6 +2861,7 @@ type ChainsById = { 35011: typeof c35011, 35441: typeof c35441, 35443: typeof c35443, +38400: typeof c38400, 38401: typeof c38401, 39797: typeof c39797, 39815: typeof c39815, @@ -2933,6 +2943,7 @@ type ChainsById = { 81361: typeof c81361, 81362: typeof c81362, 81363: typeof c81363, +81720: typeof c81720, 84531: typeof c84531, 84886: typeof c84886, 85449: typeof c85449, @@ -3003,6 +3014,7 @@ type ChainsById = { 314159: typeof c314159, 330844: typeof c330844, 333331: typeof c333331, +333666: typeof c333666, 333777: typeof c333777, 333888: typeof c333888, 333999: typeof c333999, @@ -3185,8 +3197,8 @@ type ChainIdsBySlug = { "shibachain": 27, "boba-network-rinkeby-testnet": 28, "genesis-l1": 29, -"rsk": 30, -"rsk-testnet": 31, +"rootstock": 30, +"rootstock-testnet": 31, "gooddata-testnet": 32, "gooddata": 33, "dithereum-testnet": 34, @@ -3323,7 +3335,7 @@ type ChainIdsBySlug = { "freight-trust-network": 211, "map-makalu": 212, "siriusnet-v2": 217, -"lachain": 225, +"lachain-LA": 225, "lachain-testnet": 226, "swapdex": 230, "deamchain-testnet": 236, @@ -3338,7 +3350,7 @@ type ChainIdsBySlug = { "sur-blockchain-network": 262, "high-performance-blockchain": 269, "egoncoin": 271, -"lachain-lachain": 274, +"lachain": 274, "zksync-era-testnet": 280, "boba-network": 288, "hedera": 295, @@ -3617,6 +3629,7 @@ type ChainIdsBySlug = { "kava-testnet": 2221, "kava": 2222, "vchain": 2223, +"the-krest-network": 2241, "bomb-chain": 2300, "arevia": 2309, "soma-network-testnet": 2323, @@ -3904,6 +3917,7 @@ type ChainIdsBySlug = { "j2o-taro": 35011, "q": 35441, "q-testnet": 35443, +"connectormanager": 38400, "connectormanager-robin": 38401, "energi": 39797, "oho": 39815, @@ -3985,6 +3999,7 @@ type ChainIdsBySlug = { "mizana-testnet": 81361, "mizana-mixnet": 81362, "mizana-privnet": 81363, +"quantum-chain": 81720, "base-goerli": 84531, "aerie-network": 84886, "cybertrust": 85449, @@ -4055,7 +4070,8 @@ type ChainIdsBySlug = { "filecoin-calibration-testnet": 314159, "ttcoin-smart-chain": 330844, "aves-testnet": 333331, -"oone-chain-testnet": 333777, +"oone-chain-testnet": 333666, +"oone-chain-devnet": 333777, "polis-testnet": 333888, "polis": 333999, "bitfinity-network-testnet": 355113, diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 5204d556a75..6a46f0bf74c 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -43,7 +43,7 @@ "react-native-mmkv": "2.5.1", "react-native-modal": "^13.0.1", "react-native-qrcode-svg": "6.2.0", - "react-native-svg": "13.2.0", + "react-native-svg": "^13.9.0", "tiny-invariant": "^1.2.0" }, "devDependencies": { diff --git a/packages/react-native/src/evm/assets/svgs.ts b/packages/react-native/src/evm/assets/svgs.ts new file mode 100644 index 00000000000..95d07bb4ddf --- /dev/null +++ b/packages/react-native/src/evm/assets/svgs.ts @@ -0,0 +1,113 @@ +export const LOCAL_WALLET_ICON = ` + + + + + + + + + + + + + + + + +`; + +export const COINBASE_ICON = ` + + + + + + + + + + + +`; + +export const TRUST_ICON = ` + + +`; + +export const METAMASK_ICON = ` + + + + + + + + + + + + + +`; + +export const RAINBOW_ICON = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`; diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx index abbbf2d573a..93f82fd0bb0 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx @@ -157,7 +157,7 @@ const ConnectAppField = () => { void; }) => { - const personalWalletAddress = usePersonalWalletAddress(); const { setConnectedWallet } = useWalletContext(); const [smartWallet, setSmartWallet] = useSmartWallet(); const [smartWalletAddress, setSmartWalletAddress] = useState(""); @@ -62,38 +60,22 @@ export const SmartWalletAdditionalActions = ({ return ( <> - - - {showSmartWallet ? "Smart Wallet" : "Personal Wallet"} - - - + } onPress={onWalletPress} - > - <> - {wallet?.getMeta().iconURL ? ( - - ) : null} - - - - - - + /> {!showSmartWallet && smartWallet?.enableConnectApp ? ( ) : null} @@ -104,6 +86,7 @@ export const SmartWalletAdditionalActions = ({ backgroundColor="background" borderColor="border" mb="sm" + mt="xs" justifyContent="space-between" style={styles.exportWallet} onPress={onExportPress} diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx index b0e4f13ede6..1a58153ccf9 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx @@ -48,15 +48,6 @@ export const WalletDetailsButton = ({ const [isModalVisible, setIsModalVisible] = useState(false); const onPress = () => { - // setModalState({ - // view: "WalletDetails", - // data: { - // address: address, - // }, - // isOpen: true, - // isSheet: true, - // caller: "ConnectWalletDetails", - // }); setIsModalVisible(!isModalVisible); }; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx index 04a8150339a..58a606f1823 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWallet.tsx @@ -1,5 +1,4 @@ import { walletIds } from "@thirdweb-dev/wallets"; -import { localWallet } from "../../../wallets/wallets/local-wallet"; import { ModalHeaderTextClose } from "../../base/modal/ModalHeaderTextClose"; import { WalletConfig } from "@thirdweb-dev/react-core"; import { ReactNode, useState } from "react"; @@ -53,7 +52,9 @@ export function ChooseWallet({ const onContinueAsGuestPress = () => { setIsConnecting(true); setTimeout(() => { - onChooseWallet(localWallet()); + if (guestWallet) { + onChooseWallet(guestWallet); + } }, 0); }; diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx index 73068722c81..6918b29c18c 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx @@ -3,8 +3,7 @@ import { ChooseWallet } from "./ChooseWallet/ChooseWallet"; import { ConnectingWallet } from "./ConnectingWallet/ConnectingWallet"; import { WalletConfig, useConnect, useWallets } from "@thirdweb-dev/react-core"; import { useCallback, useEffect, useState } from "react"; -import { SmartWallet, walletIds } from "@thirdweb-dev/wallets"; -import { SmartWalletFlow } from "./SmartWallet/SmartWalletFlow"; +import { walletIds } from "@thirdweb-dev/wallets"; import { useColorScheme } from "react-native"; import { useModalState } from "../../providers/ui-context-provider"; import { @@ -60,10 +59,8 @@ export const ConnectWalletFlow = () => { setActiveWallet(() => wallet); setSelectionData(data); - // If not smart wallet (sw has it's own flow, need to migrate it to connectUI) - // && // If the wallet has no custom connect UI, then connect it - if (wallet.id !== SmartWallet.id && !wallet.connectUI) { + if (!wallet.connectUI) { connectActiveWallet(wallet, data); } }, @@ -85,10 +82,6 @@ export const ConnectWalletFlow = () => { resetModal(); }, []); - const onConnected = useCallback(() => { - onClose(true); - }, [onClose]); - const resetModal = () => { setActiveWallet(undefined); setIsConnecting(false); @@ -99,11 +92,6 @@ export const ConnectWalletFlow = () => { }, [onClose]); const getComponentForWallet = useCallback(() => { - switch (activeWallet?.id) { - case SmartWallet.id: - return ; - } - if (activeWallet?.connectUI) { return ( { handleClose, modalVisible, onBackPress, - onClose, - onConnected, selectionData, supportedWallets, theme, diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx index e9523874051..c943ef3b03d 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx @@ -1,121 +1,84 @@ import { useCallback, useEffect, useState } from "react"; import { + ConnectUIProps, WalletConfig, WalletInstance, useConnect, useCreateWalletInstance, - useSupportedWallet, useWalletContext, - useWallets, } from "@thirdweb-dev/react-core"; -import { SmartWalletObj } from "../../../wallets/wallets/smart-wallet"; -import { localWallet } from "../../../wallets/wallets/local-wallet"; -import { ChooseWallet } from "../ChooseWallet/ChooseWallet"; -import { LocalWalletFlow } from "../LocalWalletFlow"; -import { ModalHeaderTextClose } from "../../base/modal/ModalHeaderTextClose"; -import { ActivityIndicator, Linking, useColorScheme } from "react-native"; +import { StyleSheet, View } from "react-native"; import BaseButton from "../../base/BaseButton"; import Text from "../../base/Text"; -import { walletIds } from "@thirdweb-dev/wallets"; -import { useAppTheme } from "../../../styles/hooks"; -import { DEFAULT_WALLETS } from "../../../constants/wallets"; +import { SmartWallet } from "@thirdweb-dev/wallets"; +import WalletLoadingThumbnail from "../../../wallets/wallets/wallet-connect/WalletLoadingThumbnail"; +import ImageSvgUri from "../../base/ImageSvgUri"; +import Box from "../../base/Box"; +import { ConnectWalletHeader } from "../ConnectingWallet/ConnectingWalletHeader"; export const SmartWalletFlow = ({ - onClose, - onConnect, -}: { - onClose: () => void; - onConnect: () => void; -}) => { - const [showLocalWalletFlow, setShowLocalWalletFlow] = useState(); + close, + goBack, + walletConfig, +}: ConnectUIProps) => { const [connectedPersonalWallet, setConnectedPersonalWallet] = useState(); - const [isConnecting, setIsConnecting] = useState(false); const [personalWalletChainId, setPersonalWalletChaindId] = useState< number | undefined >(); - const theme = useAppTheme(); const createWalletInstance = useCreateWalletInstance(); - const walletObj = useSupportedWallet(walletIds.smartWallet) as SmartWalletObj; const connect = useConnect(); const targetChain = useWalletContext().activeChain; - const colorScheme = useColorScheme(); - const supportedWallets = useWallets(); + console.log("walletConfig", personalWalletChainId); const mismatch = personalWalletChainId ? personalWalletChainId !== targetChain.chainId : false; - const connectPersonalWallet = useCallback( - async (wallet: WalletConfig) => { - setIsConnecting(true); - const walletInstance = createWalletInstance(wallet); - await walletInstance.connect(); + const connectSmartWallet = useCallback( + async (personalWallet: WalletInstance) => { + const eoaWalletChainId = await personalWallet.getChainId(); - setConnectedPersonalWallet(walletInstance); + if (eoaWalletChainId === targetChain.chainId) { + await connect(walletConfig, { + personalWallet: personalWallet, + }); + close(); + } else { + setPersonalWalletChaindId(eoaWalletChainId); + } }, - [createWalletInstance], + [close, connect, targetChain.chainId, walletConfig], ); - const onChoosePersonalWallet = useCallback( + const connectPersonalWallet = useCallback( async (wallet: WalletConfig) => { - // if (wallet.id === LocalWallet.id) { - // setShowLocalWalletFlow(true); - // } else { - connectPersonalWallet(wallet); - // } - }, - [connectPersonalWallet], - ); - - useEffect(() => { - if (walletObj.personalWallets?.length === 1) { - onChoosePersonalWallet(walletObj.personalWallets[0]); - } - }, [onChoosePersonalWallet, walletObj.personalWallets]); + const walletInstance = createWalletInstance(wallet); + await walletInstance.connect(); - useEffect(() => { - (async () => { - if (connectedPersonalWallet) { - const chainId = await connectedPersonalWallet.getChainId(); - setPersonalWalletChaindId(chainId); - } - })(); - }, [connectedPersonalWallet]); + setConnectedPersonalWallet(walletInstance); - const connectSmartWallet = useCallback( - async (personalWallet: WalletInstance) => { - if (!mismatch && personalWalletChainId) { - await connect(walletObj, { - personalWallet: personalWallet, - }); - onConnect(); - } + connectSmartWallet(walletInstance); }, - [connect, mismatch, onConnect, personalWalletChainId, walletObj], + [connectSmartWallet, createWalletInstance], ); useEffect(() => { - if (connectedPersonalWallet) { - if (!mismatch) { - connectSmartWallet(connectedPersonalWallet); - } + if (walletConfig.personalWallets?.[0]) { + connectPersonalWallet(walletConfig.personalWallets[0]); } - }, [connectSmartWallet, connectedPersonalWallet, mismatch]); - - const onConnectedLocalWallet = async (wallet: WalletInstance) => { - setIsConnecting(true); - - connectSmartWallet(wallet); - }; + }, [connectPersonalWallet, walletConfig.personalWallets]); - const onLocalWalletBackPress = () => { - setShowLocalWalletFlow(false); + const onConnectingClosePress = () => { + connectedPersonalWallet?.disconnect(); + reset(); + close(); }; - const onConnectingClosePress = () => { + const onConnectingBackPress = () => { connectedPersonalWallet?.disconnect(); reset(); + goBack(); }; const onSwitchNetworkPress = async () => { @@ -124,90 +87,74 @@ export const SmartWalletFlow = ({ }; const reset = () => { - setIsConnecting(false); setConnectedPersonalWallet(undefined); setPersonalWalletChaindId(undefined); }; - const onLearnMorePress = () => { - Linking.openURL("https://portal.thirdweb.com/wallet/smart-wallet"); - }; - - if (isConnecting) { - return ( - <> - + + - - {mismatch ? null : ( - - )} - - {mismatch === true ? ( - - Switch Network - - ) : null} - - ); - } - - if (showLocalWalletFlow) { - return ( - {}} - walletConfig={localWallet()} - selectionData={undefined} // TODO - setSelectionData={() => {}} // TODO - supportedWallets={supportedWallets} // TODO - pass personal wallets instead - /> - ); - } - - return ( - - { - "Choose a personal wallet that acts as your account's key. This controls access to your account. " - } - - Learn more. + + + + + <> + + {mismatch + ? "Network Mismatch" + : `Connecting ${walletConfig.meta.name}`} + + {mismatch ? ( + + { + "There's a network mismatch between your contract and your wallet" + } + + ) : null} + + + + + {mismatch === true ? ( + + + Switch Network - - } - wallets={walletObj.personalWallets || DEFAULT_WALLETS} - onChooseWallet={onChoosePersonalWallet} - onClose={onClose} - /> + + ) : null} + ); }; + +const styles = StyleSheet.create({ + connectingContainer: { + flexDirection: "column", + justifyContent: "center", + alignContent: "center", + alignItems: "center", + paddingHorizontal: 4, + marginBottom: 24, + marginTop: 18, + }, +}); diff --git a/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx b/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx index 92fb4c8d268..238caee4eb2 100644 --- a/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx +++ b/packages/react-native/src/evm/components/SendFunds/SelectTokenButton.tsx @@ -16,7 +16,7 @@ export function SelectTokenButton(props: { flexDirection="row" alignItems="center" onPress={props.onPress} - mb="xs" + mb="md" > {props.token?.icon ? ( @@ -24,7 +24,7 @@ export function SelectTokenButton(props: { )} - {tokenName} + {tokenName} {!balanceQuery.data ? ( diff --git a/packages/react-native/src/evm/components/base/ImageSvgUri.tsx b/packages/react-native/src/evm/components/base/ImageSvgUri.tsx index 1a8c8a809b4..64dadf72bd3 100644 --- a/packages/react-native/src/evm/components/base/ImageSvgUri.tsx +++ b/packages/react-native/src/evm/components/base/ImageSvgUri.tsx @@ -20,11 +20,7 @@ const ImageSvgUri = ({ const [error, setError] = useState(false); if (imageUrl.startsWith(" - - - ); + return ; } const resolvedImageUrl = storage diff --git a/packages/react-native/src/evm/wallets/types/smart-wallet.ts b/packages/react-native/src/evm/wallets/types/smart-wallet.ts new file mode 100644 index 00000000000..17f5496e2f3 --- /dev/null +++ b/packages/react-native/src/evm/wallets/types/smart-wallet.ts @@ -0,0 +1,12 @@ +import type { WalletConfig } from "@thirdweb-dev/react-core"; +import { + SmartWallet, + SmartWalletConfig as SmartWalletConfigWallets, +} from "@thirdweb-dev/wallets"; + +export type SmartWalletConfig = Omit< + SmartWalletConfigWallets, + "chain" | "clientId" | "secretKey" +>; + +export type SmartWalletObj = WalletConfig; diff --git a/packages/react-native/src/evm/wallets/wallets/LocalWallet.ts b/packages/react-native/src/evm/wallets/wallets/LocalWallet.ts index d1ddbdeab0e..b2d38888a6e 100644 --- a/packages/react-native/src/evm/wallets/wallets/LocalWallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/LocalWallet.ts @@ -3,12 +3,12 @@ import { Connector, } from "@thirdweb-dev/wallets"; import { ethers, utils } from "ethers"; +import { LOCAL_WALLET_ICON } from "../../assets/svgs"; export class LocalWallet extends LocalWalletCore { static meta = { name: "Guest Wallet", - iconURL: - "ipfs://QmQAyJG3y2wZf9u6JXxn8U9Kd1ZVfjtQkf5aua8FcWr8Gm/local-wallet-mobile.svg", + iconURL: LOCAL_WALLET_ICON, }; getMeta() { diff --git a/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts b/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts index 8cd90ab7edc..b038adbcd68 100644 --- a/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/coinbase-wallet.ts @@ -12,6 +12,7 @@ import { walletIds, } from "@thirdweb-dev/wallets"; import { WalletOptions as WalletOptionsRC } from "@thirdweb-dev/react-core"; +import { COINBASE_ICON } from "../../assets/svgs"; type CoinbaseWalletOptions = Omit< WalletOptions, @@ -21,8 +22,7 @@ type CoinbaseWalletOptions = Omit< export class CoinbaseWallet extends AbstractClientWallet { static meta = { name: "Coinbase Wallet", - iconURL: - "ipfs://QmcJBHopbwfJcLqJpX2xEufSS84aLbF7bHavYhaXUcrLaH/coinbase.svg", + iconURL: COINBASE_ICON, }; connector?: Connector; diff --git a/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts b/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts index 0cd0c7a00e4..169d5ca836c 100644 --- a/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/metamask-wallet.ts @@ -3,13 +3,13 @@ import { WalletOptions, WalletConfig } from "@thirdweb-dev/react-core"; import { WCMeta } from "../types/wc"; import { WalletConnectBase } from "./wallet-connect/WalletConnectBase"; import { WalletConnectConfig } from "./wallet-connect/wallet-connect"; +import { METAMASK_ICON } from "../../assets/svgs"; export class MetaMaskWallet extends WalletConnectBase { static id = walletIds.metamask; static meta = { name: "MetaMask", - iconURL: - "ipfs://QmZZHcw7zcXursywnLDAyY6Hfxzqop5GKgwoq8NB9jjrkN/metamask.svg", + iconURL: METAMASK_ICON, links: { native: "metamask:", universal: "https://metamask.app.link", diff --git a/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts b/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts index e1ef023acb6..5999a0334c5 100644 --- a/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/rainbow-wallet.ts @@ -4,13 +4,13 @@ import { } from "@thirdweb-dev/react-core"; import { WalletConnectBase } from "./wallet-connect/WalletConnectBase"; import { WalletConnectConfig } from "./wallet-connect/wallet-connect"; +import { RAINBOW_ICON } from "../../assets/svgs"; export class RainbowWallet extends WalletConnectBase { static id = "rainbow" as const; static meta = { name: "Rainbow", - iconURL: - "ipfs://QmSZn47p4DVVBfzvg9BAX2EqwnPxkT1YAE7rUnrtd9CybQ/rainbow-logo.png", + iconURL: RAINBOW_ICON, links: { native: "rainbow:", universal: "https://rnbwapp.com", diff --git a/packages/react-native/src/evm/wallets/wallets/smart-wallet.ts b/packages/react-native/src/evm/wallets/wallets/smart-wallet.ts deleted file mode 100644 index 379af76d59b..00000000000 --- a/packages/react-native/src/evm/wallets/wallets/smart-wallet.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { WalletConfig, WalletOptions } from "@thirdweb-dev/react-core"; -import { - SmartWallet, - SmartWalletConfig as SmartWalletConfigWallets, - createAsyncLocalStorage, -} from "@thirdweb-dev/wallets"; -import { DEFAULT_WALLETS } from "../../constants/wallets"; -import { createSyncStorage } from "../../../core/AsyncStorage"; - -type SmartWalletConfig = { - personalWallets?: WalletConfig[]; - recommended?: boolean; -} & Omit; - -export type SmartWalletObj = WalletConfig; - -export const smartWallet = ( - config: SmartWalletConfig, -): WalletConfig => { - return { - id: SmartWallet.id, - meta: SmartWallet.meta, - create: (options: WalletOptions) => - new SmartWallet({ - ...options, - ...config, - walletStorage: createAsyncLocalStorage("smart-wallet"), - wcStorage: createSyncStorage("smart-wallet"), - }), - personalWallets: config.personalWallets || DEFAULT_WALLETS, - recommended: config.recommended, - }; -}; diff --git a/packages/react-native/src/evm/wallets/wallets/smart-wallet.tsx b/packages/react-native/src/evm/wallets/wallets/smart-wallet.tsx new file mode 100644 index 00000000000..c4af0378bcd --- /dev/null +++ b/packages/react-native/src/evm/wallets/wallets/smart-wallet.tsx @@ -0,0 +1,32 @@ +import type { WalletConfig, WalletOptions } from "@thirdweb-dev/react-core"; +import { SmartWallet, createAsyncLocalStorage } from "@thirdweb-dev/wallets"; +import { createSyncStorage } from "../../../core/AsyncStorage"; +import { SmartWalletConfig } from "../types/smart-wallet"; +import { SmartWalletFlow } from "../../components/ConnectWalletFlow/SmartWallet/SmartWalletFlow"; + +export const smartWallet = ( + wallet: WalletConfig, + config: SmartWalletConfig, +): WalletConfig => { + const WalletSelectUI = wallet.selectUI; + + return { + ...wallet, + create: (options: WalletOptions) => + new SmartWallet({ + ...options, + ...config, + walletStorage: createAsyncLocalStorage("smart-wallet"), + wcStorage: createSyncStorage("smart-wallet"), + }), + connectUI(props) { + return ; + }, + selectUI: WalletSelectUI + ? (props) => { + return ; + } + : undefined, + personalWallets: [wallet], + }; +}; diff --git a/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts b/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts index db04facec9a..117c187857f 100644 --- a/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts +++ b/packages/react-native/src/evm/wallets/wallets/trust-wallet.ts @@ -2,13 +2,13 @@ import { WalletOptions, WalletConfig } from "@thirdweb-dev/react-core"; import { WCMeta } from "../types/wc"; import { WalletConnectBase } from "./wallet-connect/WalletConnectBase"; import { WalletConnectConfig } from "./wallet-connect/wallet-connect"; +import { TRUST_ICON } from "../../assets/svgs"; export class TrustWallet extends WalletConnectBase { static id = "trust" as const; static meta = { name: "Trust Wallet", - iconURL: - "ipfs://QmNigQbXk7wKZwDcgN38Znj1ZZQ3JEG3DD6fUKLBU8SUTP/trust%20wallet.svg", + iconURL: TRUST_ICON, links: { native: "trust:", universal: "https://link.trustwallet.com", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40fbb685c81..23f661f152f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -824,10 +824,10 @@ importers: version: 13.0.1(react-native@0.71.11)(react@18.2.0) react-native-qrcode-svg: specifier: 6.2.0 - version: 6.2.0(react-native-svg@13.2.0)(react-native@0.71.11)(react@18.2.0) + version: 6.2.0(react-native-svg@13.14.0)(react-native@0.71.11)(react@18.2.0) react-native-svg: - specifier: 13.2.0 - version: 13.2.0(react-native@0.71.11)(react@18.2.0) + specifier: ^13.9.0 + version: 13.14.0(react-native@0.71.11)(react@18.2.0) tiny-invariant: specifier: ^1.2.0 version: 1.3.1 @@ -24519,7 +24519,7 @@ packages: react-native-animatable: 1.3.3 dev: false - /react-native-qrcode-svg@6.2.0(react-native-svg@13.2.0)(react-native@0.71.11)(react@18.2.0): + /react-native-qrcode-svg@6.2.0(react-native-svg@13.14.0)(react-native@0.71.11)(react@18.2.0): resolution: {integrity: sha512-rb2PgUwT8QpQyReVYNvzRY84AHsMh81354Tnkfp6MfqRbcdJURhnBWLBOO11pLMS6eXiwlq4SkcQxy88hRq+Dw==} peerDependencies: react: '*' @@ -24530,7 +24530,7 @@ packages: qrcode: 1.5.3 react: 18.2.0 react-native: 0.71.11(@babel/core@7.22.9)(@babel/preset-env@7.22.9)(react@18.2.0) - react-native-svg: 13.2.0(react-native@0.71.11)(react@18.2.0) + react-native-svg: 13.14.0(react-native@0.71.11)(react@18.2.0) dev: false /react-native-safe-area-context@4.5.3(react-native@0.71.11)(react@18.2.0): @@ -24544,8 +24544,8 @@ packages: react-native: 0.71.11(@babel/core@7.22.9)(@babel/preset-env@7.22.9)(react@18.2.0) dev: false - /react-native-svg@13.2.0(react-native@0.71.11)(react@18.2.0): - resolution: {integrity: sha512-bDvMeFReA3F9pVp0EhACPrEerRcITzTu9N2m2lAPinhIMVvwzGzVXyFsXI8fCMSoeOIh+77hKvukoCedh06tLw==} + /react-native-svg@13.14.0(react-native@0.71.11)(react@18.2.0): + resolution: {integrity: sha512-27ZnxUkHgWICimhuj6MuqBkISN53lVvgWJB7pIypjXysAyM+nqgQBPh4vXg+7MbqLBoYvR4PiBgKfwwGAqVxHg==} peerDependencies: react: '*' react-native: '*' From 4d92a40b69df6a7954bb8a2e832f6800ee8a5b82 Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Mon, 25 Sep 2023 17:26:15 +0200 Subject: [PATCH 16/18] ui fix --- .../evm/components/ConnectWalletDetails/ConnectAppField.tsx | 4 ++-- .../ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx | 1 - packages/react-native/src/evm/components/ReceiveButton.tsx | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx index 93f82fd0bb0..c14b9ae6c5b 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/ConnectAppField.tsx @@ -113,7 +113,7 @@ const ConnectAppField = () => { {!appMeta && showWCInput ? ( { onPress={onConnectDappPress} > <> - {appMeta ? ( + {appMeta?.iconUrl ? ( ) : ( diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx index c943ef3b03d..a42a94b0c78 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/SmartWallet/SmartWalletFlow.tsx @@ -30,7 +30,6 @@ export const SmartWalletFlow = ({ const connect = useConnect(); const targetChain = useWalletContext().activeChain; - console.log("walletConfig", personalWalletChainId); const mismatch = personalWalletChainId ? personalWalletChainId !== targetChain.chainId : false; diff --git a/packages/react-native/src/evm/components/ReceiveButton.tsx b/packages/react-native/src/evm/components/ReceiveButton.tsx index e88632bbb32..077bf1c52ea 100644 --- a/packages/react-native/src/evm/components/ReceiveButton.tsx +++ b/packages/react-native/src/evm/components/ReceiveButton.tsx @@ -143,7 +143,7 @@ export const ReceiveFundsModal = ({ borderRadius="md" p="md" > - + {addressCopied === true ? ( From d303a941cad6e056e7ce6ca262674a04599e9b6c Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Tue, 26 Sep 2023 20:06:54 +0200 Subject: [PATCH 17/18] chains --- packages/chains/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/chains/package.json b/packages/chains/package.json index af9f9998067..f15c4513b73 100644 --- a/packages/chains/package.json +++ b/packages/chains/package.json @@ -49,8 +49,8 @@ }, "sideEffects": false, "scripts": { - "build": "", - "push": "", + "build": "node ./scripts/generate-package.mjs && tsc && preconstruct build", + "push": "yalc push", "plop": "plop", "add-chain": "plop add-chain", "override-chain": "plop override-chain", From 72137f60ed16d19ebb9cbc1b3426f4f1f6e318aa Mon Sep 17 00:00:00 2001 From: ikethirdweb Date: Wed, 27 Sep 2023 21:23:58 +0200 Subject: [PATCH 18/18] [RN] Lots of small UI fixes --- .changeset/bright-llamas-greet.md | 5 +++ packages/chains/chains/1089.ts | 6 ++-- packages/chains/chains/2241.ts | 14 ++++----- packages/chains/chains/225.ts | 4 +-- packages/chains/chains/274.ts | 4 +-- packages/chains/chains/751230.ts | 7 ++++- packages/chains/chains/9990.ts | 13 +++++--- packages/chains/src/index.ts | 10 ++++-- packages/react-native/src/evm/assets/svgs.ts | 28 +++++++++++++++++ .../src/evm/components/ConnectWallet.tsx | 4 +++ .../ConnectWalletDetailsModal.tsx | 22 +++++++++++++ .../ExportLocalWalletModal.tsx | 12 +++---- .../WalletDetailsButton.tsx | 13 +++++--- .../WalletDetailsModalHeader.tsx | 9 +++++- .../ChooseWallet/ChooseWallet.tsx | 31 ++++++++++++++----- .../ChooseWallet/ChooseWalletContent.tsx | 1 + .../ConnectWalletFlow/ConnectWalletButton.tsx | 8 +++++ .../ConnectWalletFlow/ConnectWalletFlow.tsx | 11 +++++-- .../LocalWalletImportModal.tsx | 9 +++--- .../src/evm/components/ReceiveButton.tsx | 6 ++-- .../SendFunds/SelectTokenButton.tsx | 2 +- .../evm/components/SendFunds/SendButton.tsx | 30 +++++++++++------- .../src/evm/components/base/ActiveDot.tsx | 15 ++++----- .../src/evm/components/base/ChainIcon.tsx | 5 +-- .../src/evm/components/base/NetworkButton.tsx | 4 +-- .../src/evm/components/base/WalletButton.tsx | 2 ++ .../src/evm/components/base/modal/TWModal.tsx | 3 ++ .../react-native/src/evm/utils/modalTypes.ts | 1 + .../src/evm/wallets/wallets/magic-link.tsx | 4 +-- .../wallets/wallet-connect/WalletConnect.ts | 4 +-- .../wallet-connect/WalletConnectButton.tsx | 9 ++++-- .../wallet-connect/WalletConnectUI.tsx | 11 ++++--- 32 files changed, 217 insertions(+), 90 deletions(-) create mode 100644 .changeset/bright-llamas-greet.md diff --git a/.changeset/bright-llamas-greet.md b/.changeset/bright-llamas-greet.md new file mode 100644 index 00000000000..3b966720960 --- /dev/null +++ b/.changeset/bright-llamas-greet.md @@ -0,0 +1,5 @@ +--- +"@thirdweb-dev/react-native": patch +--- + +Lots of small UI fixes diff --git a/packages/chains/chains/1089.ts b/packages/chains/chains/1089.ts index d51e370c431..b1ca3273fcf 100644 --- a/packages/chains/chains/1089.ts +++ b/packages/chains/chains/1089.ts @@ -30,9 +30,9 @@ export default { "chainId": 1089, "networkId": 1089, "icon": { - "url": "ipfs://QmU83haX3TNifDDjBx6RP6ByqES1Kg9VqeJC87X9ipKyCS", - "width": 386, - "height": 397, + "url": "ipfs://QmX6XuoQDTTjYqAmdNJiieLDZSwHHyUx44yQb4E3tmHmEA", + "width": 400, + "height": 400, "format": "png" }, "explorers": [ diff --git a/packages/chains/chains/2241.ts b/packages/chains/chains/2241.ts index 58913ed460e..d752fc9e904 100644 --- a/packages/chains/chains/2241.ts +++ b/packages/chains/chains/2241.ts @@ -1,15 +1,15 @@ import type { Chain } from "../src/types"; export default { - "name": "The Krest Network", + "name": "Krest Network", "chain": "Krest", "icon": { - "url": "ipfs://bafkreid3bhzhughhjwq3rpgiic5zesj5mekqktawt646itdyqtvjxoupca", - "width": 257, - "height": 257, - "format": "svg" + "url": "ipfs://bafkreid732273ib5at7krjdl2t7lteljlepwd3tvifqge7mu7g6naxavhe", + "width": 256, + "height": 256, + "format": "png" }, "rpc": [ - "https://the-krest-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://krest-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://erpc-krest.peaq.network" ], "faucets": [], @@ -35,5 +35,5 @@ export default { } ], "testnet": false, - "slug": "the-krest-network" + "slug": "krest-network" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/225.ts b/packages/chains/chains/225.ts index 22c4a5d3531..8803cea8ff4 100644 --- a/packages/chains/chains/225.ts +++ b/packages/chains/chains/225.ts @@ -9,7 +9,7 @@ export default { "format": "png" }, "rpc": [ - "https://lachain-LA.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://lachain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://rpc-mainnet.lachain.io" ], "faucets": [], @@ -30,5 +30,5 @@ export default { } ], "testnet": false, - "slug": "lachain-LA" + "slug": "lachain" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/274.ts b/packages/chains/chains/274.ts index 1ce1f5db9f0..8b5bb536108 100644 --- a/packages/chains/chains/274.ts +++ b/packages/chains/chains/274.ts @@ -9,7 +9,7 @@ export default { "format": "png" }, "rpc": [ - "https://lachain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", + "https://lachain-lachain.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://rpc1.mainnet.lachain.network", "https://rpc2.mainnet.lachain.network", "https://lachain.rpc-nodes.cedalio.dev" @@ -37,5 +37,5 @@ export default { } ], "testnet": false, - "slug": "lachain" + "slug": "lachain-lachain" } as const satisfies Chain; \ No newline at end of file diff --git a/packages/chains/chains/751230.ts b/packages/chains/chains/751230.ts index a309f7e0551..21371e6fbc8 100644 --- a/packages/chains/chains/751230.ts +++ b/packages/chains/chains/751230.ts @@ -2,7 +2,12 @@ import type { Chain } from "../src/types"; export default { "name": "Bear Network Chain Testnet", "chain": "BRNKCTEST", - "icon": "brnkc", + "icon": { + "url": "ipfs://QmQqhH28QpUrreoRw5Gj8YShzdHxxVGMjfVrx3TqJNLSLv", + "width": 1067, + "height": 1067, + "format": "png" + }, "rpc": [ "https://bear-network-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}", "https://brnkc-test.bearnetwork.net" diff --git a/packages/chains/chains/9990.ts b/packages/chains/chains/9990.ts index 58243501bdb..6172028dafb 100644 --- a/packages/chains/chains/9990.ts +++ b/packages/chains/chains/9990.ts @@ -3,10 +3,10 @@ export default { "name": "Agung Network", "chain": "Agung", "icon": { - "url": "ipfs://bafkreih6nzctk6brx5cqkylxbhvi3vsr6q5ks4th5knolkrlfp4tdia2mu", - "width": 400, - "height": 400, - "format": "svg" + "url": "ipfs://bafkreibkqdof3ztkdhgukwvkacwgrjb27e23hgz5c6mmudzu5hipyvgisa", + "width": 256, + "height": 256, + "format": "png" }, "rpc": [ "https://agung-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}", @@ -27,6 +27,11 @@ export default { "name": "Polkadot.js", "url": "https://polkadot.js.org/apps/?rpc=wss://wsspc1-qa.agung.peaq.network#/explorer", "standard": "none" + }, + { + "name": "Subscan", + "url": "https://agung.subscan.io", + "standard": "none" } ], "testnet": false, diff --git a/packages/chains/src/index.ts b/packages/chains/src/index.ts index ae4ba3d7dc3..23cb9b53ec8 100644 --- a/packages/chains/src/index.ts +++ b/packages/chains/src/index.ts @@ -524,6 +524,7 @@ import c4090 from "../chains/4090"; import c4096 from "../chains/4096"; import c4099 from "../chains/4099"; import c4102 from "../chains/4102"; +import c4139 from "../chains/4139"; import c4141 from "../chains/4141"; import c4181 from "../chains/4181"; import c4201 from "../chains/4201"; @@ -1518,7 +1519,7 @@ export { default as Evanesco } from "../chains/2213" export { default as KavaTestnet } from "../chains/2221" export { default as Kava } from "../chains/2222" export { default as Vchain } from "../chains/2223" -export { default as TheKrestNetwork } from "../chains/2241" +export { default as KrestNetwork } from "../chains/2241" export { default as BombChain } from "../chains/2300" export { default as Arevia } from "../chains/2309" export { default as SomaNetworkTestnet } from "../chains/2323" @@ -1583,6 +1584,7 @@ export { default as FastexChainBahamutOasisTestnet } from "../chains/4090" export { default as BitindiTestnet } from "../chains/4096" export { default as Bitindi } from "../chains/4099" export { default as AiozNetworkTestnet } from "../chains/4102" +export { default as HumansAiTestnet } from "../chains/4139" export { default as TipboxcoinTestnet } from "../chains/4141" export { default as PhiNetworkV1 } from "../chains/4181" export { default as LuksoTestnet } from "../chains/4201" @@ -2118,7 +2120,7 @@ export * from "./types"; export * from "./utils"; export const defaultChains = [c1, c5, c8453, c84531, c137, c80001, c42161, c421613, c10, c420, c56, c97, c250, c4002, c43114, c43113, c1337]; // @ts-expect-error - TODO: fix this later -export const allChains: Chain[] = [c1, c2, c3, c4, c5, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c38, c39, c40, c41, c42, c43, c44, c45, c46, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72, c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84, c85, c86, c87, c88, c89, c90, c91, c92, c93, c94, c95, c96, c97, c98, c99, c100, c101, c102, c103, c104, c105, c106, c107, c108, c109, c110, c111, c112, c113, c114, c117, c118, c119, c120, c121, c122, c123, c124, c125, c126, c127, c128, c134, c135, c136, c137, c138, c139, c141, c142, c144, c148, c150, c151, c152, c153, c154, c155, c156, c160, c161, c162, c163, c165, c167, c168, c169, c170, c172, c180, c186, c188, c189, c193, c195, c196, c197, c198, c199, c200, c201, c204, c208, c210, c211, c212, c217, c225, c226, c230, c236, c242, c246, c248, c250, c255, c256, c258, c259, c262, c269, c271, c274, c280, c288, c295, c296, c297, c298, c301, c303, c309, c311, c313, c314, c321, c322, c324, c333, c335, c336, c338, c345, c361, c363, c364, c365, c369, c371, c385, c400, c401, c411, c416, c418, c420, c424, c427, c443, c444, c456, c462, c499, c500, c501, c512, c513, c516, c520, c529, c530, c534, c542, c555, c558, c568, c570, c592, c595, c596, c597, c599, c600, c601, c614, c634, c647, c648, c666, c667, c668, c669, c686, c700, c707, c708, c719, c721, c741, c742, c766, c776, c777, c786, c787, c788, c789, c800, c803, c808, c813, c818, c820, c841, c842, c859, c868, c876, c877, c880, c888, c900, c901, c902, c903, c909, c910, c917, c927, c943, c956, c970, c971, c972, c977, c980, c985, c989, c990, c997, c998, c1000, c1001, c1003, c1004, c1007, c1008, c1010, c1012, c1022, c1023, c1024, c1028, c1030, c1031, c1038, c1039, c1072, c1079, c1080, c1088, c1089, c1099, c1101, c1107, c1108, c1111, c1112, c1115, c1116, c1117, c1130, c1131, c1133, c1138, c1139, c1140, c1149, c1170, c1177, c1197, c1201, c1202, c1213, c1214, c1229, c1230, c1231, c1234, c1243, c1244, c1246, c1252, c1280, c1284, c1285, c1287, c1288, c1291, c1294, c1297, c1311, c1314, c1319, c1320, c1338, c1339, c1353, c1369, c1379, c1388, c1392, c1433, c1440, c1442, c1452, c1455, c1501, c1506, c1507, c1515, c1559, c1618, c1620, c1657, c1663, c1688, c1701, c1707, c1708, c1718, c1773, c1777, c1804, c1807, c1818, c1819, c1856, c1875, c1881, c1890, c1891, c1898, c1907, c1908, c1945, c1951, c1954, c1967, c1969, c1970, c1971, c1975, c1984, c1985, c1986, c1987, c1994, c1995, c2000, c2001, c2002, c2008, c2009, c2016, c2018, c2019, c2020, c2021, c2022, c2023, c2025, c2031, c2032, c2037, c2038, c2043, c2044, c2047, c2048, c2077, c2088, c2089, c2100, c2101, c2109, c2122, c2124, c2137, c2138, c2151, c2152, c2153, c2154, c2199, c2202, c2203, c2213, c2221, c2222, c2223, c2241, c2300, c2309, c2323, c2330, c2332, c2358, c2399, c2400, c2415, c2484, c2559, c2569, c2606, c2611, c2612, c2613, c2625, c2710, c2888, c2999, c3000, c3001, c3003, c3011, c3031, c3068, c3269, c3270, c3306, c3331, c3333, c3334, c3400, c3434, c3500, c3501, c3601, c3602, c3636, c3637, c3666, c3690, c3693, c3698, c3699, c3737, c3797, c3888, c3889, c3912, c3939, c3966, c3967, c3999, c4000, c4001, c4002, c4051, c4061, c4062, c4090, c4096, c4099, c4102, c4141, c4181, c4201, c4242, c4328, c4337, c4444, c4460, c4689, c4690, c4759, c4777, c4918, c4919, c4999, c5000, c5001, c5002, c5005, c5165, c5177, c5197, c5234, c5315, c5353, c5522, c5551, c5553, c5555, c5616, c5678, c5700, c5729, c5758, c5777, c5851, c5869, c6065, c6066, c6102, c6118, c6119, c6502, c6552, c6565, c6626, c6688, c6789, c6969, c6999, c7000, c7001, c7027, c7070, c7171, c7331, c7332, c7341, c7484, c7518, c7575, c7576, c7668, c7672, c7700, c7701, c7771, c7777, c7878, c7895, c7979, c8000, c8001, c8029, c8080, c8082, c8086, c8098, c8131, c8132, c8133, c8134, c8135, c8136, c8181, c8217, c8272, c8285, c8387, c8453, c8654, c8655, c8723, c8724, c8738, c8768, c8848, c8880, c8881, c8882, c8883, c8888, c8889, c8898, c8899, c8989, c8995, c9000, c9001, c9012, c9100, c9223, c9339, c9527, c9528, c9559, c9700, c9728, c9768, c9779, c9790, c9792, c9818, c9819, c9977, c9990, c9996, c9997, c9999, c10000, c10001, c10024, c10081, c10086, c10101, c10200, c10201, c10243, c10248, c10395, c10507, c10508, c10823, c10946, c10947, c11110, c11111, c11115, c11119, c11235, c11437, c11612, c11888, c11891, c12009, c12051, c12052, c12123, c12306, c12321, c12345, c12611, c12715, c12890, c13000, c13308, c13337, c13381, c13812, c14000, c14853, c15551, c15555, c15557, c16000, c16001, c16507, c16688, c16718, c16888, c17000, c17180, c17777, c18000, c18122, c18159, c18686, c19011, c19845, c20001, c20729, c20736, c21337, c21816, c22023, c22040, c22222, c22776, c23006, c23118, c23294, c23295, c24484, c24734, c25888, c25925, c26026, c26600, c26863, c28528, c30067, c30103, c31102, c31223, c31224, c31337, c32520, c32659, c32769, c33101, c33333, c35011, c35441, c35443, c38400, c38401, c39797, c39815, c41500, c42069, c42161, c42170, c42220, c42261, c42262, c42888, c43110, c43113, c43114, c43288, c44444, c44787, c45000, c46688, c47805, c49049, c49088, c49797, c50001, c50021, c51178, c51712, c53935, c54211, c54321, c55004, c55555, c55556, c56288, c56789, c57000, c58008, c59140, c60000, c60001, c60002, c60103, c61800, c61803, c61916, c62320, c62621, c63000, c63001, c65450, c67588, c69420, c70000, c70001, c70002, c70103, c71111, c71393, c71401, c71402, c73799, c73927, c75000, c77238, c77612, c77777, c78110, c78281, c78430, c78431, c78432, c79879, c80001, c81341, c81342, c81343, c81351, c81352, c81353, c81361, c81362, c81363, c81720, c84531, c84886, c85449, c88002, c88880, c90210, c91002, c92001, c96970, c99099, c99998, c99999, c100000, c100001, c100002, c100003, c100004, c100005, c100006, c100007, c100008, c100009, c100010, c101010, c103090, c108801, c110000, c110001, c110002, c110003, c110004, c110005, c110006, c110007, c110008, c111000, c111111, c112358, c123456, c131419, c142857, c167005, c167006, c167007, c188881, c200101, c200202, c200625, c201018, c201030, c201804, c202020, c202624, c210425, c220315, c221230, c221231, c224168, c230315, c234666, c246529, c246785, c247253, c256256, c266256, c271271, c281121, c314159, c330844, c333331, c333666, c333777, c333888, c333999, c355113, c373737, c381931, c381932, c404040, c420420, c420666, c420692, c421611, c421613, c421614, c424242, c431140, c432201, c432204, c444900, c471100, c474142, c512512, c513100, c534351, c534352, c534353, c534849, c535037, c622277, c641230, c651940, c666666, c751230, c761412, c800001, c827431, c846000, c888888, c900000, c910000, c920000, c920001, c923018, c955305, c1261120, c1313114, c1313500, c1337702, c1337802, c1337803, c2021398, c2099156, c2206132, c3141592, c3441005, c4000003, c4281033, c5167003, c5555555, c5555558, c7225878, c7355310, c7668378, c7762959, c7777777, c8007736, c8794598, c8888881, c8888888, c10067275, c10101010, c11155111, c13371337, c14288640, c16658437, c18289463, c20180430, c20181205, c20201022, c22052002, c27082017, c27082022, c28945486, c29032022, c31415926, c35855456, c43214913, c61717561, c65010000, c65100000, c88888888, c99415706, c192837465, c222000222, c245022926, c245022934, c245022940, c278611351, c311752642, c333000333, c344106930, c356256156, c486217935, c503129905, c1122334455, c1146703430, c1273227453, c1313161554, c1313161555, c1313161556, c1351057110, c1380996178, c1482601649, c1564830818, c1666600000, c1666600001, c1666600002, c1666600003, c1666700000, c1666700001, c1666900000, c1666900001, c2021121117, c2046399126, c2863311531, c3125659152, c4216137055, c11297108099, c11297108109, c111222333444, c197710212030, c197710212031, c383414847825, c666301171999, c6022140761023, c1337, c1440001, c1582, c331769, c331771, c37, c408, c47, c47279324479, c5611, c59144, c8081, c88882, c88888, c91003, c919, c999]; +export const allChains: Chain[] = [c1, c2, c3, c4, c5, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c38, c39, c40, c41, c42, c43, c44, c45, c46, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72, c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84, c85, c86, c87, c88, c89, c90, c91, c92, c93, c94, c95, c96, c97, c98, c99, c100, c101, c102, c103, c104, c105, c106, c107, c108, c109, c110, c111, c112, c113, c114, c117, c118, c119, c120, c121, c122, c123, c124, c125, c126, c127, c128, c134, c135, c136, c137, c138, c139, c141, c142, c144, c148, c150, c151, c152, c153, c154, c155, c156, c160, c161, c162, c163, c165, c167, c168, c169, c170, c172, c180, c186, c188, c189, c193, c195, c196, c197, c198, c199, c200, c201, c204, c208, c210, c211, c212, c217, c225, c226, c230, c236, c242, c246, c248, c250, c255, c256, c258, c259, c262, c269, c271, c274, c280, c288, c295, c296, c297, c298, c301, c303, c309, c311, c313, c314, c321, c322, c324, c333, c335, c336, c338, c345, c361, c363, c364, c365, c369, c371, c385, c400, c401, c411, c416, c418, c420, c424, c427, c443, c444, c456, c462, c499, c500, c501, c512, c513, c516, c520, c529, c530, c534, c542, c555, c558, c568, c570, c592, c595, c596, c597, c599, c600, c601, c614, c634, c647, c648, c666, c667, c668, c669, c686, c700, c707, c708, c719, c721, c741, c742, c766, c776, c777, c786, c787, c788, c789, c800, c803, c808, c813, c818, c820, c841, c842, c859, c868, c876, c877, c880, c888, c900, c901, c902, c903, c909, c910, c917, c927, c943, c956, c970, c971, c972, c977, c980, c985, c989, c990, c997, c998, c1000, c1001, c1003, c1004, c1007, c1008, c1010, c1012, c1022, c1023, c1024, c1028, c1030, c1031, c1038, c1039, c1072, c1079, c1080, c1088, c1089, c1099, c1101, c1107, c1108, c1111, c1112, c1115, c1116, c1117, c1130, c1131, c1133, c1138, c1139, c1140, c1149, c1170, c1177, c1197, c1201, c1202, c1213, c1214, c1229, c1230, c1231, c1234, c1243, c1244, c1246, c1252, c1280, c1284, c1285, c1287, c1288, c1291, c1294, c1297, c1311, c1314, c1319, c1320, c1338, c1339, c1353, c1369, c1379, c1388, c1392, c1433, c1440, c1442, c1452, c1455, c1501, c1506, c1507, c1515, c1559, c1618, c1620, c1657, c1663, c1688, c1701, c1707, c1708, c1718, c1773, c1777, c1804, c1807, c1818, c1819, c1856, c1875, c1881, c1890, c1891, c1898, c1907, c1908, c1945, c1951, c1954, c1967, c1969, c1970, c1971, c1975, c1984, c1985, c1986, c1987, c1994, c1995, c2000, c2001, c2002, c2008, c2009, c2016, c2018, c2019, c2020, c2021, c2022, c2023, c2025, c2031, c2032, c2037, c2038, c2043, c2044, c2047, c2048, c2077, c2088, c2089, c2100, c2101, c2109, c2122, c2124, c2137, c2138, c2151, c2152, c2153, c2154, c2199, c2202, c2203, c2213, c2221, c2222, c2223, c2241, c2300, c2309, c2323, c2330, c2332, c2358, c2399, c2400, c2415, c2484, c2559, c2569, c2606, c2611, c2612, c2613, c2625, c2710, c2888, c2999, c3000, c3001, c3003, c3011, c3031, c3068, c3269, c3270, c3306, c3331, c3333, c3334, c3400, c3434, c3500, c3501, c3601, c3602, c3636, c3637, c3666, c3690, c3693, c3698, c3699, c3737, c3797, c3888, c3889, c3912, c3939, c3966, c3967, c3999, c4000, c4001, c4002, c4051, c4061, c4062, c4090, c4096, c4099, c4102, c4139, c4141, c4181, c4201, c4242, c4328, c4337, c4444, c4460, c4689, c4690, c4759, c4777, c4918, c4919, c4999, c5000, c5001, c5002, c5005, c5165, c5177, c5197, c5234, c5315, c5353, c5522, c5551, c5553, c5555, c5616, c5678, c5700, c5729, c5758, c5777, c5851, c5869, c6065, c6066, c6102, c6118, c6119, c6502, c6552, c6565, c6626, c6688, c6789, c6969, c6999, c7000, c7001, c7027, c7070, c7171, c7331, c7332, c7341, c7484, c7518, c7575, c7576, c7668, c7672, c7700, c7701, c7771, c7777, c7878, c7895, c7979, c8000, c8001, c8029, c8080, c8082, c8086, c8098, c8131, c8132, c8133, c8134, c8135, c8136, c8181, c8217, c8272, c8285, c8387, c8453, c8654, c8655, c8723, c8724, c8738, c8768, c8848, c8880, c8881, c8882, c8883, c8888, c8889, c8898, c8899, c8989, c8995, c9000, c9001, c9012, c9100, c9223, c9339, c9527, c9528, c9559, c9700, c9728, c9768, c9779, c9790, c9792, c9818, c9819, c9977, c9990, c9996, c9997, c9999, c10000, c10001, c10024, c10081, c10086, c10101, c10200, c10201, c10243, c10248, c10395, c10507, c10508, c10823, c10946, c10947, c11110, c11111, c11115, c11119, c11235, c11437, c11612, c11888, c11891, c12009, c12051, c12052, c12123, c12306, c12321, c12345, c12611, c12715, c12890, c13000, c13308, c13337, c13381, c13812, c14000, c14853, c15551, c15555, c15557, c16000, c16001, c16507, c16688, c16718, c16888, c17000, c17180, c17777, c18000, c18122, c18159, c18686, c19011, c19845, c20001, c20729, c20736, c21337, c21816, c22023, c22040, c22222, c22776, c23006, c23118, c23294, c23295, c24484, c24734, c25888, c25925, c26026, c26600, c26863, c28528, c30067, c30103, c31102, c31223, c31224, c31337, c32520, c32659, c32769, c33101, c33333, c35011, c35441, c35443, c38400, c38401, c39797, c39815, c41500, c42069, c42161, c42170, c42220, c42261, c42262, c42888, c43110, c43113, c43114, c43288, c44444, c44787, c45000, c46688, c47805, c49049, c49088, c49797, c50001, c50021, c51178, c51712, c53935, c54211, c54321, c55004, c55555, c55556, c56288, c56789, c57000, c58008, c59140, c60000, c60001, c60002, c60103, c61800, c61803, c61916, c62320, c62621, c63000, c63001, c65450, c67588, c69420, c70000, c70001, c70002, c70103, c71111, c71393, c71401, c71402, c73799, c73927, c75000, c77238, c77612, c77777, c78110, c78281, c78430, c78431, c78432, c79879, c80001, c81341, c81342, c81343, c81351, c81352, c81353, c81361, c81362, c81363, c81720, c84531, c84886, c85449, c88002, c88880, c90210, c91002, c92001, c96970, c99099, c99998, c99999, c100000, c100001, c100002, c100003, c100004, c100005, c100006, c100007, c100008, c100009, c100010, c101010, c103090, c108801, c110000, c110001, c110002, c110003, c110004, c110005, c110006, c110007, c110008, c111000, c111111, c112358, c123456, c131419, c142857, c167005, c167006, c167007, c188881, c200101, c200202, c200625, c201018, c201030, c201804, c202020, c202624, c210425, c220315, c221230, c221231, c224168, c230315, c234666, c246529, c246785, c247253, c256256, c266256, c271271, c281121, c314159, c330844, c333331, c333666, c333777, c333888, c333999, c355113, c373737, c381931, c381932, c404040, c420420, c420666, c420692, c421611, c421613, c421614, c424242, c431140, c432201, c432204, c444900, c471100, c474142, c512512, c513100, c534351, c534352, c534353, c534849, c535037, c622277, c641230, c651940, c666666, c751230, c761412, c800001, c827431, c846000, c888888, c900000, c910000, c920000, c920001, c923018, c955305, c1261120, c1313114, c1313500, c1337702, c1337802, c1337803, c2021398, c2099156, c2206132, c3141592, c3441005, c4000003, c4281033, c5167003, c5555555, c5555558, c7225878, c7355310, c7668378, c7762959, c7777777, c8007736, c8794598, c8888881, c8888888, c10067275, c10101010, c11155111, c13371337, c14288640, c16658437, c18289463, c20180430, c20181205, c20201022, c22052002, c27082017, c27082022, c28945486, c29032022, c31415926, c35855456, c43214913, c61717561, c65010000, c65100000, c88888888, c99415706, c192837465, c222000222, c245022926, c245022934, c245022940, c278611351, c311752642, c333000333, c344106930, c356256156, c486217935, c503129905, c1122334455, c1146703430, c1273227453, c1313161554, c1313161555, c1313161556, c1351057110, c1380996178, c1482601649, c1564830818, c1666600000, c1666600001, c1666600002, c1666600003, c1666700000, c1666700001, c1666900000, c1666900001, c2021121117, c2046399126, c2863311531, c3125659152, c4216137055, c11297108099, c11297108109, c111222333444, c197710212030, c197710212031, c383414847825, c666301171999, c6022140761023, c1337, c1440001, c1582, c331769, c331771, c37, c408, c47, c47279324479, c5611, c59144, c8081, c88882, c88888, c91003, c919, c999]; type ChainsById = { 1: typeof c1, @@ -2647,6 +2649,7 @@ type ChainsById = { 4096: typeof c4096, 4099: typeof c4099, 4102: typeof c4102, +4139: typeof c4139, 4141: typeof c4141, 4181: typeof c4181, 4201: typeof c4201, @@ -3642,7 +3645,7 @@ type ChainIdsBySlug = { "kava-testnet": 2221, "kava": 2222, "vchain": 2223, -"the-krest-network": 2241, +"krest-network": 2241, "bomb-chain": 2300, "arevia": 2309, "soma-network-testnet": 2323, @@ -3707,6 +3710,7 @@ type ChainIdsBySlug = { "bitindi-testnet": 4096, "bitindi": 4099, "aioz-network-testnet": 4102, +"humans-ai-testnet": 4139, "tipboxcoin-testnet": 4141, "phi-network-v1": 4181, "lukso-testnet": 4201, diff --git a/packages/react-native/src/evm/assets/svgs.ts b/packages/react-native/src/evm/assets/svgs.ts index 95d07bb4ddf..5f71c93e798 100644 --- a/packages/react-native/src/evm/assets/svgs.ts +++ b/packages/react-native/src/evm/assets/svgs.ts @@ -1,3 +1,31 @@ +export const SMART_WALLET_ICON = ` + + + + + + + + + + + + + +`; + +export const WALLETCONNECT_ICON = ` + + + + + + + + + +`; + export const LOCAL_WALLET_ICON = ` diff --git a/packages/react-native/src/evm/components/ConnectWallet.tsx b/packages/react-native/src/evm/components/ConnectWallet.tsx index f324eb6557e..15909e3214b 100644 --- a/packages/react-native/src/evm/components/ConnectWallet.tsx +++ b/packages/react-native/src/evm/components/ConnectWallet.tsx @@ -72,8 +72,10 @@ export const ConnectWallet = ({ theme, buttonTitle, modalTitle, + modalTitleIconUrl, extraRows, hideTestnetFaucet, + displayBalanceToken, switchToActiveChain, termsOfServiceUrl, privacyPolicyUrl, @@ -151,12 +153,14 @@ export const ConnectWallet = ({ extraRows={extraRows} hideTestnetFaucet={hideTestnetFaucet} supportedTokens={supportedTokensMemo} + displayBalanceToken={displayBalanceToken} /> ) ) : ( + {activeWallet?.walletId === SmartWallet.id || smartWallet ? ( + { + Linking.openURL( + `https://thirdweb.com/${chain?.slug}/${address}/account`, + ); + }} + flexDirection="row" + alignItems="center" + justifyContent="space-between" + mt="md" + > + + + + Connected to a Smart Wallet + + + + + ) : null} diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/ExportLocalWalletModal.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/ExportLocalWalletModal.tsx index ebc4ca1789e..d46679c260d 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/ExportLocalWalletModal.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/ExportLocalWalletModal.tsx @@ -16,7 +16,6 @@ import * as FileSystem from "expo-file-system"; import { SmartWallet } from "@thirdweb-dev/wallets"; import { usePersonalWalletAddress } from "../../wallets/hooks/usePersonalWalletAddress"; import { shortenWalletAddress } from "../../utils/addresses"; -import { WalletIcon } from "../base/WalletIcon"; import { LocalWallet } from "../../wallets/wallets/LocalWallet"; import { TWModal } from "../base/modal/TWModal"; @@ -150,13 +149,10 @@ export const ExportLocalWalletModal = ({ borderRadius="md" p="lg" > - - - - - - Backup your Wallet - + { "This will download a JSON file containing your wallet information onto your device encrypted with the password." diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx index 1a58153ccf9..aede9dabba6 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsButton.tsx @@ -4,12 +4,13 @@ import Text from "../base/Text"; import { WalletIcon } from "../base/WalletIcon"; import { useWallet } from "@thirdweb-dev/react-core"; import { StyleSheet } from "react-native"; -import { LocalWallet } from "@thirdweb-dev/wallets"; +import { LocalWallet, walletIds } from "@thirdweb-dev/wallets"; import Box from "../base/Box"; import { ConnectWalletDetailsModal } from "./ConnectWalletDetailsModal"; import { useState } from "react"; import { TextBalance } from "../base/TextBalance"; import { SupportedTokens } from "../SendFunds/defaultTokens"; +import { SMART_WALLET_ICON } from "../../assets/svgs"; export type ConnectWalletDetailsProps = { address?: string; @@ -51,6 +52,11 @@ export const WalletDetailsButton = ({ setIsModalVisible(!isModalVisible); }; + const walletIconUrl = + activeWallet?.walletId === walletIds.smartWallet + ? SMART_WALLET_ICON + : activeWallet?.getMeta().iconURL || ""; + return ( <> - + {activeWallet?.walletId === LocalWallet.id ? ( diff --git a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx index 8455771acc5..ccca339b385 100644 --- a/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletDetails/WalletDetailsModalHeader.tsx @@ -10,6 +10,8 @@ import Box from "../base/Box"; import CopyIcon from "../../assets/copy"; import { useState } from "react"; import { TextBalance } from "../base/TextBalance"; +import { walletIds } from "@thirdweb-dev/wallets"; +import { SMART_WALLET_ICON } from "../../assets/svgs"; interface WalletDetailsModalHeaderProps { address?: string; @@ -44,10 +46,15 @@ export const WalletDetailsModalHeader = ({ }, 0); }; + const walletIconUrl = + activeWallet?.walletId === walletIds.smartWallet + ? SMART_WALLET_ICON + : activeWallet?.getMeta().iconURL || ""; + return ( <> - + void; wallets: WalletConfig[]; excludeWalletIds?: string[]; + modalTitleIconUrl?: string; termsOfServiceUrl?: string; privacyPolicyUrl?: string; }; @@ -27,6 +28,7 @@ export function ChooseWallet({ subHeaderText, wallets, onChooseWallet, + modalTitleIconUrl, onClose, excludeWalletIds = [], termsOfServiceUrl, @@ -98,11 +100,21 @@ export function ChooseWallet({ alignContent="center" justifyContent="center" > - + {modalTitleIconUrl !== undefined ? ( + modalTitleIconUrl.length === 0 ? null : ( + + ) + ) : ( + + )} {isConnecting ? ( - + ) : ( Continue as guest diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx index 01c462dc94b..34c75e5bae8 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ChooseWallet/ChooseWalletContent.tsx @@ -74,6 +74,7 @@ export const ChooseWalletContent = ({ recommended={item.recommended} onPress={() => onChooseWallet(item)} mb={marginBottom} + paddingVertical="xxs" /> )} diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx index dea658b701e..1ee740f1dd3 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletButton.tsx @@ -18,6 +18,12 @@ export type ConnectWalletButtonProps = { * @default "Choose your wallet" */ modalTitle?: string; + /** + * Replace the thirdweb icon next to modalTitle and set your own iconUrl + * + * Set to empty string to hide the icon + */ + modalTitleIconUrl?: string; /** * Set a custom terms of service url */ @@ -31,6 +37,7 @@ export type ConnectWalletButtonProps = { export const ConnectWalletButton = ({ modalTitle, + modalTitleIconUrl, termsOfServiceUrl, privacyPolicyUrl, buttonTitle, @@ -72,6 +79,7 @@ export const ConnectWalletButton = ({ view: "ConnectWalletFlow", data: { modalTitle, + modalTitleIconUrl, termsOfServiceUrl, privacyPolicyUrl, walletConfig: diff --git a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx index 6918b29c18c..c56b9cb9e39 100644 --- a/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx +++ b/packages/react-native/src/evm/components/ConnectWalletFlow/ConnectWalletFlow.tsx @@ -16,9 +16,13 @@ import { useAppTheme } from "../../styles/hooks"; export const ConnectWalletFlow = () => { const { modalState, setModalState } = useModalState(); - const { modalTitle, privacyPolicyUrl, termsOfServiceUrl, walletConfig } = ( - modalState as ConnectWalletFlowModal - ).data; + const { + modalTitle, + modalTitleIconUrl, + privacyPolicyUrl, + termsOfServiceUrl, + walletConfig, + } = (modalState as ConnectWalletFlowModal).data; const [modalVisible, setModalVisible] = useState(false); const [activeWallet, setActiveWallet] = useState(); @@ -142,6 +146,7 @@ export const ConnectWalletFlow = () => { ) : ( - - - Import JSON Wallet - + { "The application can authorize any transactions on behalf of the wallet without any approvals. We recommend only connecting to trusted applications." @@ -202,6 +202,7 @@ export const LocalWalletImportModal = ({ placeholderTextColor: theme.colors.textSecondary, onChangeText: onPrivateKeyEntered, }} + containerProps={{ pl: "xxs" }} /> - Paste the wallet address or scan the QR code to send funds to this + Copy the wallet address or scan the QR code to send funds to this wallet. - Current Network + Your address ) : ( - + )} {tokenName} diff --git a/packages/react-native/src/evm/components/SendFunds/SendButton.tsx b/packages/react-native/src/evm/components/SendFunds/SendButton.tsx index 33000f55a22..1324de8f90a 100644 --- a/packages/react-native/src/evm/components/SendFunds/SendButton.tsx +++ b/packages/react-native/src/evm/components/SendFunds/SendButton.tsx @@ -24,7 +24,7 @@ import { useChainId, useWallet, } from "@thirdweb-dev/react-core"; -import { SupportedTokens, TokenInfo } from "./defaultTokens"; +import { SupportedTokens, TokenInfo, defaultTokens } from "./defaultTokens"; import { useMutation } from "@tanstack/react-query"; import { utils } from "ethers"; import LoadingTextAnimation from "../base/LoadingTextAnimation"; @@ -82,9 +82,24 @@ export const SendFundsModal = ({ onClose, supportedTokens, }: SendFundsModalProps) => { - const [token, setToken] = useState(); const [showTokenSelector, setShowTokenSelector] = useState(false); + const chainId = useChainId(); + let defaultToken: TokenInfo | undefined = undefined; + if ( + // if we know chainId + chainId && + // if there is a list of tokens for this chain + supportedTokens[chainId] && + // if the list of tokens is not the default list + supportedTokens[chainId] !== defaultTokens[chainId] + ) { + // use the first token in the list as default selected + defaultToken = supportedTokens[chainId][0]; + } + + const [token, setToken] = useState(defaultToken); + const onTokenSelectorPress = () => { setShowTokenSelector(true); }; @@ -204,10 +219,7 @@ const SendFundsForm = ({ borderRadius="md" p="lg" > - + Select Token @@ -228,11 +240,7 @@ const SendFundsForm = ({ {token?.icon ? ( ) : ( - + )} { - return ; +export const ActiveDot = ({ + width = 28, + height = 28, +}: { + width?: number; + height?: number; +}) => { + return ; }; const styles = StyleSheet.create({ dot: { - width: 28, - height: 28, borderRadius: 50, - top: "60%", - right: 0, backgroundColor: "#00d395", - position: "absolute", }, }); diff --git a/packages/react-native/src/evm/components/base/ChainIcon.tsx b/packages/react-native/src/evm/components/base/ChainIcon.tsx index e12950766a9..0fb1a8bdf4d 100644 --- a/packages/react-native/src/evm/components/base/ChainIcon.tsx +++ b/packages/react-native/src/evm/components/base/ChainIcon.tsx @@ -1,4 +1,3 @@ -import { ActiveDot } from "./ActiveDot"; import ImageSvgUri from "./ImageSvgUri"; import { StyleSheet, View } from "react-native"; @@ -8,16 +7,14 @@ const defaultChainIcon = export type ChainIconProps = { chainIconUrl?: string; size: number; - active?: boolean; }; -export const ChainIcon = ({ chainIconUrl, size, active }: ChainIconProps) => { +export const ChainIcon = ({ chainIconUrl, size }: ChainIconProps) => { const src = chainIconUrl || defaultChainIcon; return ( - {active ? : null} ); }; diff --git a/packages/react-native/src/evm/components/base/NetworkButton.tsx b/packages/react-native/src/evm/components/base/NetworkButton.tsx index 70763bff7a2..4754e29f0f6 100644 --- a/packages/react-native/src/evm/components/base/NetworkButton.tsx +++ b/packages/react-native/src/evm/components/base/NetworkButton.tsx @@ -72,7 +72,7 @@ export const NetworkButton = ({ <> - + { return ( diff --git a/packages/react-native/src/evm/components/base/modal/TWModal.tsx b/packages/react-native/src/evm/components/base/modal/TWModal.tsx index 91658d7dfaf..83afeadfcc9 100644 --- a/packages/react-native/src/evm/components/base/modal/TWModal.tsx +++ b/packages/react-native/src/evm/components/base/modal/TWModal.tsx @@ -1,5 +1,7 @@ import Modal, { ModalProps } from "react-native-modal"; +const MAX_WIDTH = 500; + // Populate with the data... export function TWModal(props: Partial) { return ( @@ -8,6 +10,7 @@ export function TWModal(props: Partial) { avoidKeyboard useNativeDriver hideModalContentWhileAnimating={true} + style={{ maxWidth: MAX_WIDTH }} > {props.children} diff --git a/packages/react-native/src/evm/utils/modalTypes.ts b/packages/react-native/src/evm/utils/modalTypes.ts index e2e3b7cd5a9..decf5a0c490 100644 --- a/packages/react-native/src/evm/utils/modalTypes.ts +++ b/packages/react-native/src/evm/utils/modalTypes.ts @@ -52,6 +52,7 @@ export type ClosedModal = { // connect wallet flow export type ConnectWalletFlowData = { modalTitle?: string; + modalTitleIconUrl?: string; termsOfServiceUrl?: string; privacyPolicyUrl?: string; walletConfig?: WalletConfig; diff --git a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx index ed8be53fb57..9051399ab7d 100644 --- a/packages/react-native/src/evm/wallets/wallets/magic-link.tsx +++ b/packages/react-native/src/evm/wallets/wallets/magic-link.tsx @@ -82,12 +82,12 @@ const MagicSelectionUI: React.FC> = (props) => { }} containerProps={{ paddingHorizontal: "sm", - paddingVertical: "md", + paddingVertical: "sm", }} /> {isAnimating ? ( - + )} - + {item.name.split(" ")[0]} diff --git a/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletConnectUI.tsx b/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletConnectUI.tsx index 87e384b81a4..fea9d9374ca 100644 --- a/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletConnectUI.tsx +++ b/packages/react-native/src/evm/wallets/wallets/wallet-connect/WalletConnectUI.tsx @@ -20,8 +20,8 @@ import { } from "@thirdweb-dev/react-core"; import { WalletConnect } from "./WalletConnect"; import { useAppTheme } from "../../../styles/hooks"; -import { ConnectWalletHeader } from "../../../components/ConnectWalletFlow/ConnectingWallet/ConnectingWalletHeader"; import { WalletConnectButton } from "./WalletConnectButton"; +import { ModalHeaderTextClose } from "../../../components/base"; type WCWallet = { iconURL: string; @@ -158,10 +158,11 @@ export function WalletConnectUI({ - {loading ? ( @@ -183,9 +184,9 @@ export function WalletConnectUI({ flexDirection="row" borderRadius="md" alignItems="center" + marginHorizontal="md" mb="sm" padding="xs" - width={"100%"} >