Files
5a648f7e74 Version Packages (#2377)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-02-29 16:17:22 -08:00

158 KiB

@thirdweb-dev/react-native

0.7.8

Patch Changes

0.7.7

Patch Changes

0.7.6

Patch Changes

0.7.5

Patch Changes

0.7.4

Patch Changes

0.7.3

Patch Changes

0.7.2

Patch Changes

0.7.1

Patch Changes

0.7.0

Minor Changes

Patch Changes

0.6.5

Patch Changes

0.6.4

Patch Changes

0.6.3

Patch Changes

0.6.2

Patch Changes

  • #2182 c4f1309d Thanks @iketw! - Reports only react-nativec

  • #2185 324330d3 Thanks @iketw! - Exports standalone ConnectEmbed UI

    Devs can now show the Connect modal UI directly into their apps. This component will render the wallets defined in our ThirdwebProvider.

    <ConnectEmbed
      modalTitleIconUrl="<my-icon-url>"
      modalTitle="Sign In"
      theme={"light"}
      onConnect={() => {
        console.log("wallet connected");
      }}
      container={{
        paddingVertical: "md",
        marginHorizontal: "md",
        borderRadius: "md",
      }}
    />
    
  • Updated dependencies [9a23de2b, e21f7bb1]:

0.6.1

Patch Changes

0.6.0

Minor Changes

  • #2150 6dac95bd Thanks @MananTank! - ### API changed for creating wallet configurator

    ( This is only relevant if you are creating your own wallet configurator - If you are using the wallet configurators provided by thirdweb such as metamaskWallet(), coinbaseWallet() etc - This API change does not affect you )

    We have introduce a few changes to how the wallet configurator should be created:

    Do not use any wallet connection hooks in the wallet configurator. Only use the props passed in the connectUI and selectUI. The wallet configurator's connectUI and selectUI now gets below mentioned additional props so that you can avoid using the wallet connection hooks

    • props.connect - replaces the useConnect hook usage
    • props.connectionStatus - replaces the useConnectionStatus hook usage
    • props.setConnectionStatus - replaces the useSetConnectionStatus hook usage
    • props.setConnectedWallet - replaces the useSetConnectedWallet hook usage
    • props.createWalletInstance - replaces the useCreateWalletInstance hook usage
    • props.connectedWalletAddress - replaces the useAddress hook usage

    Example

    import { WalletConfig } from "@thirdweb-dev/react-native";
    import { MyCustomWallet } from "./MyCustomWallet"; // your custom wallet class
    
    // your custom wallet configurator
    function myCustomWallet(): WalletConfig<MyCustomWallet> {
      return {
        id: "MyCustomWallet",
        meta: {
          name: "FooBar",
          iconURL: "https://link-to-the-wallet-icon.png",
        },
        create(walletOptions) {
          return new MyCustomWallet(walletOptions);
        },
        // only use the props passed in the connectUI and selectUI
        // do not use any wallet connection hooks that read or write to the wallet connection state
        connectUI(props) {
          // const connect = useConnect(); -> old
          const connect = props.connect; // new
    
          return <div> .... </div>;
        },
        selectUI(props) {
          return <div> .... </div>;
        },
      };
    }
    

    onLocallyConnected has been removed from the connectUI props - You no longer need to worry about whether a wallet is part of another wallet's connection flow or not - just use the regular props passed in the connectUI and selectUI and it will be handled automatically.

Patch Changes

0.5.6

Patch Changes

0.5.5

Patch Changes

0.5.4

Patch Changes

0.5.3

Patch Changes

0.5.2

Patch Changes

0.5.1

Patch Changes

0.5.0

Minor Changes

  • #2018 33c9f6b1 Thanks @iketw! - Enforces passing an encryption key for custom jwt auth

    const embedded = useEmbeddedWallet();
    
    embedded.connect({
      jwt: "<token>",
      encryptionKey: "<my-key>",
      strategy: "jwt",
    });
    

Patch Changes

0.4.14

Patch Changes

0.4.13

Patch Changes

0.4.12

Patch Changes

0.4.11

Patch Changes

0.4.10

Patch Changes

0.4.9

Patch Changes

0.4.8

Patch Changes

0.4.7

Patch Changes

0.4.6

Patch Changes

0.4.5

Patch Changes

0.4.4

Patch Changes

0.4.3

Patch Changes

  • #1908 18552f3a Thanks @kien-ngo! - Add hideSwitchToPersonalWallet prop on ConnectWallet component to hide the "Switch to Personal wallet" option in the ConnectWallet modal which is shown when wallet is connected as a Smart Wallet

  • #1912 1a421d3b Thanks @iketw! - Adds Apple as a social sign in option for EmbeddedWallet

    You can now do:

    embeddedWallet({
        auth: {
        options: ['apple'],
        redirectUrl: 'your-apps-redirect-url://',
        },
    }),
    
  • #1943 30ea9c6b Thanks @iketw! - Adds tsdoc warnings to enforce a common comments format

  • #1929 06e59cf9 Thanks @iketw! - Move addresses' utils to the core package

  • #1925 97fdbc8f Thanks @iketw! - [RN] Adds walletConnectReceiver prop to EmbeddedWallet and SmartWallet

    You can pass your own WalletConnect projectId and metadata (highly recommended):

    embeddedWallet({
        auth: {
        options: ['email', 'google'],
        redirectUrl: 'redirect-url',
        },
        walletConnectReceiver: {
            walletConnectWalletMetadata?: WCMetadata;
            walletConnectV2ProjectId?: string;
            walletConnectV2RelayUrl?: string;
        },
    }),
    
    smartWallet(localWallet(), {
        factoryAddress: 'factory-address',
        gasless: true,
        walletConnectReceiver: {
            walletConnectWalletMetadata?: WCMetadata;
            walletConnectV2ProjectId?: string;
            walletConnectV2RelayUrl?: string;
        },
    }),
    

    You can just pass true to the prop and these props will default to our internal WalletConnect projectId and metadata.

    embeddedWallet({
        auth: {
        options: ['email', 'google'],
        redirectUrl: 'redirect-url',
        },
        walletConnectReceiver: true
    }),
    
    smartWallet(localWallet(), {
        factoryAddress: 'factory-address',
        gasless: true,
        walletConnectReceiver: true
    }),
    
  • #1942 6de3a19b Thanks @iketw! - Updated react-native-safe-area-context to 4.74

  • Updated dependencies [3f3a484a, a81a5285, 30ea9c6b, 06e59cf9, 97fdbc8f, 3f3a484a]:

0.4.2

Patch Changes

0.4.1

Patch Changes

0.4.0

Minor Changes

  • #1846 0acc530f Thanks @joaquim-verges! - New API to configure authentication options on embeddedWallet

    // default - google sign in is enabled
    embeddedWallet();
    
    // this is same as
    embeddedWallet({
      auth: {
        options: ["email"],
      },
    });
    
    // add google sign in
    embeddedWallet({
      auth: {
        options: ["email", "google"],
        redirectUrl: "your_app://deeplink",
      },
    });
    

Patch Changes

  • #1885 961ef644 Thanks @joaquim-verges! - Improved useSmartWallet() hook

    Example with metamask:

    const { connect } = useSmartWallet(metamaskWallet(), {
      factoryAddress: factoryAddress,
      gasless: true,
    });
    
    const onClick = async () => {
      // nothing to do here, all handled internally
      await connect();
    };
    
    Example with localWallet:
    
    const { connect } = useSmartWallet(localWallet(), {
        factoryAddress: factoryAddress,
        gasless: true,
    });
    
    const onClick = async () => {
        // function to 'load' the local wallet before using it
        await connect({
            connectPersonalWallet: async (w) => {
                await w.generate();
                await w.connect();
            }
        });
    }
    
    Example with embeddedWallet:
    
    const { connect } = useSmartWallet(embeddedWallet(), {
        factoryAddress: factoryAddress,
        gasless: true,
    });
    
    const onClick = async () => {
        // function to 'auth' the embedded wallet before using it
        await connect({
            connectPersonalWallet: async (w) => {
                const authResult = await w.authenticate({ strategy: "google" });
                await w.connect({ authResult });
            }
        });
    }
    
  • Updated dependencies [a9d32f3c, 0acc530f]:

0.3.16

Patch Changes

  • #1880 7461e2a9 Thanks @iketw! - Fixes wallet icons borders bug

  • #1878 178609a0 Thanks @iketw! - Adds support for Japanese and Spanish

    You can now pass 'ja' or 'es' to our ThirdwebProvider:

    import { ThirdwebProvider } from '@thirdweb-dev/react-native';
    
    <ThirdwebProvider locale={'ja'}>
      <App />
    </ ThirdwebProvider>
    

0.3.15

Patch Changes

0.3.14

Patch Changes

0.3.13

Patch Changes

0.3.12

Patch Changes

0.3.11

Patch Changes

0.3.10

Patch Changes

0.3.9

Patch Changes

0.3.8

Patch Changes

  • #1724 fc62b91e Thanks @iketw! - Adds Google sign in to embeddedWallet in React Native

    You need to add the react-native-inappbrowser-reborn package to your app, then you can do:

    <ThirdwebProvider
      activeChain={activeChain}
      clientId={"your-client-id"}
      supportedWallets={[
        embeddedWallet({
          // if this is true AND oauthOptions is not set we set it to false internally
          email: true,
          // if this is set we enable Sign in with Google
          oauthOptions: {
            redirectUrl: "test15app://",
            providers: ["google"],
          },
        }),
      ]}
    >
      <App />
    </ThirdwebProvider>
    
  • Updated dependencies [526176c4, d1f8e951, 09120c92, 08e9cd20, 6573556d]:

0.3.7

Patch Changes

0.3.6

Patch Changes

0.3.5

Patch Changes

0.3.4

Patch Changes

0.3.3

Patch Changes

0.3.2

Patch Changes

0.3.1

Patch Changes

0.3.0

Minor Changes

Patch Changes

0.2.62

Patch Changes

0.2.61

Patch Changes

  • #1592 1fe867e2 Thanks @iketw! - 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.

    import { metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react-native";
    
    <ThirdwebProvider
      clientId="your-client-id"
      supportedWallets={[
        metamaskWallet({
          recommended: true,
        }),
      ]}
    >
      <App />
    </ThirdwebProvider>;
    
    1. Better theme customization

    You can now more easily customize the theme of the ConnectWallet component:

    import { ConnectWallet, darkTheme } from "@thirdweb-dev/react-native";
    
    <ConnectWallet
      theme={darkTheme({
        colors: {
          textPrimary: "yellow",
          textSecondary: "blue",
        },
      })}
      buttonTitle="Enter web3"
      modalTitle="Sign in"
    />;
    

    Note that you can still pass light or dark if you want to use one of the predefined thems :)

    1. You can now pass your Privacy Policy and Terms of Service urls, they will show up at the bottom of the modal:
    import { ConnectWallet, darkTheme } from "@thirdweb-dev/react-native";
    
    <ConnectWallet
      privacyPolicyUrl="https://your-privacy-policy"
      termsOfServiceUrl="https://your-terms-of-service"
    />;
    
    1. 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.
  • #1550 3f3c63c0 Thanks @MananTank! - ConnectWallet v3 updates

  • Updated dependencies [3fd39cea, 3f3c63c0, 48295c06, 48295c06]:

0.2.60

Patch Changes

0.2.59

Patch Changes

0.2.58

Patch Changes

0.2.57

Patch Changes

0.2.56

Patch Changes

0.2.55

Patch Changes

0.2.54

Patch Changes

0.2.53

Patch Changes

0.2.52

Patch Changes

0.2.51

Patch Changes

0.2.50

Patch Changes

0.2.49

Patch Changes

0.2.48

Patch Changes

0.2.47

Patch Changes

0.2.46

Patch Changes

0.2.45

Patch Changes

0.2.44

Patch Changes

0.2.43

Patch Changes

0.2.42

Patch Changes

0.2.41

Patch Changes

0.2.40

Patch Changes

0.2.39

Patch Changes

0.2.38

Patch Changes

0.2.37

Patch Changes

0.2.36

Patch Changes

0.2.35

Patch Changes

0.2.34

Patch Changes

0.2.33

Patch Changes

0.2.32

Patch Changes

0.2.31

Patch Changes

0.2.30

Patch Changes

0.2.29

Patch Changes

0.2.28

Patch Changes

0.2.27

Patch Changes

0.2.26

Patch Changes

0.2.25

Patch Changes

0.2.24

Patch Changes

0.2.23

Patch Changes

0.2.22

Patch Changes

0.2.21

Patch Changes

0.2.20

Patch Changes

0.2.19

Patch Changes

0.2.18

Patch Changes

  • #1137 dec4c4a8 Thanks @iketw! - [ReactNative] Export WCV1 and WCV2 abstract classes to facilitate creation of wallet connect based wallets

    You can now extend the abstract classes WalletConnectV1 or WalletConnectV2 and set your own metadata when implementing a wallet.

    Find an example below implementing MyWallet that supports the WalletConnectV2 protocol.

    import {
      WCMeta,
      WalletConnectV2,
      WalletOptions,
      WalletConfig,
    } from '@thirdweb-dev/react-native';
    
    export class MyWallet extends WalletConnectV2 {
      static id = 'mywallet' as const; // ID needed to identify your wallet in the SDK.
      static meta = {
        name: 'My Wallet', // Name that will show up in our Connect Modal.
        iconURL:
          'my-wallet-icon-url-ipfs-or-png', // Icon that will show up in our Connect Modal.
        links: { // The WalletConnect mobile links.
          native: 'mywallet://',
          universal: 'https://mywallet.com',
        },
      };
    
      getMeta(): WCMeta {
        return MyWallet.meta;
      }
    }
    
    /**
     * The WalletConnectV2 projectId.
     *
     * We provide a default projectId but recommend you get your own
     * when launching your app in production.
     */
    type MyWalletConfig = { projectId?: string };
    
    export const myWallet = (config?: MyWalletConfig): WalletConfig<WalletConnectV2> => {
      return {
        id: MyWallet.id,
        meta: MyWallet.meta,
        create: (options: WalletOptions) =>
          new MyWallet({
            ...options,
            projectId: config?.projectId,
            walletId: MyWallet.id,
          }),
      };
    };
    

    You can then use your new wallet in the ThirdwebProvider's supportedWallets prop:

    import { ThirdwebProvider } from "@thirdweb-dev/react-native";
    
    <ThirdwebProvider supportedWallets={[myWallet()]}>
      <App />
    </ThirdwebProvider>;
    
  • #1151 2a0294d8 Thanks @MananTank! - Fix wrong balance in ConnectWallet

  • #1135 15ef4779 Thanks @iketw! - [ReactNative] Exports base UI components (react-native/components/base). They can now be used in your application.

  • #1144 9ce3eb6a Thanks @MananTank! - Remove WalletConfig.config object from wallets

  • Updated dependencies [2a443365, 3bf7f375, 6a194262, 16232de9, 54cfd6d8, 8687d6ac, 645b0303, 522453fd, 9a015a23, 6803c3e9, 0cba69ca, 56f85e57, 197a6838, 6a91b6a0, e32faeb5, a5f16b6d, b6728603, ed47fd53, 9ce3eb6a]:

0.2.17

Patch Changes

0.2.16

Patch Changes

0.2.15

Patch Changes

  • #1059 56ad0867 Thanks @iketw! - [ReactNative] Use walletConfig's selectUI to render the wallet item in the Choose your Wallet dialog

  • #1010 bba9767a Thanks @iketw! - [ReactNative-Wallets] Enables SmartWallet to connect to an app, with implementation in React Native

    • Wallets package
    1. Smart Wallet now supports connecting an external app to it. It acts as an actual wallet implementing the WC protocol
    2. There are two WalletConnect handlers to manage V1 and V2 WC connections
    3. Creates a synchronous storage interface used in WCV1
    4. To have your connector support WC, you need to implement the interface: IWalletConnectReceiver.
    5. You can now pass the flag enableConnectApp to the smart wallet config to enable a new field in our modal to connect an app to your smart wallet
    smartWallet({
        factoryAddress: "..."
        thirdwebApiKey: "apiKey"
        gasless: true,
        personalWallets: [localWallet()],
        enableConnectApp: true,
    }),
    
    • React Native
    1. Creates new modals for WC SessionRequests and SessionApprovals
    2. Implements SyncStorage using MMKV
  • #1068 fd7111d5 Thanks @MananTank! - add theme in WalletConfig.selectUI to allow creating selection UI that follows the theme of the wallet Modal

  • #1065 bd86661f Thanks @iketw! - [ReactNative] Add support for signing in with email/phone using magic sdk

    Devs can now add a new supportedWallet:

    import { Goerli } from '@thirdweb-dev/chains';
    import { ThirdwebProvider, magicWallet } from '@thirdweb-dev/react-native';
    
    <ThirdwebProvider
        activeChain={Goerli}
        supportedWallets={[
        magicWallet({
            apiKey: 'magic_api_key',
        }),
    ]}>
    
  • #1088 4f99ccb4 Thanks @iketw! - [RN/Wallets] Adds send_transaction support for wcv1 Connect to App feature

  • #1052 77123a9a Thanks @iketw! - [ReactNative] Adds support for WC QRCode scanning

    Breaking change:

    • Users will need to add the dependency react-native-camera to be able to use this version of the SDK.
  • Updated dependencies [2f1df0b5, 189daf02, afae0873, bba9767a, c6e74ef0, fd7111d5, ee4c7de2, bd86661f, 68fa1896, e21bdd03, f7b352a5, 4a1d7581, bdabbef7, 59206233, 292a321a, 98efd090, 8eecf4c2, bd86661f, f3b2ae3f, d5651006, 4f99ccb4, da576108, c85810ee, 6fd10f94, 5f1e6abb, a034b032, 35984362]:

0.2.14

Patch Changes

0.2.13

Patch Changes

0.2.12

Patch Changes

  • #995 482f6d1b Thanks @iketw! - [ReactNative] update export local wallet modal UI

  • #996 c3645c45 Thanks @MananTank! - - add theme in ConfiguredWallet.connectUI's props - to use theme aware UI for wallets

    • add useWalletConfig hook to get the ConfiguredWallet object for active wallet
    • add hooks useSetConnectedWallet, useSetConnectionStatus
    • rename useActiveChain to useChain - keep the useActiveChain also with deprecated tag
    • make useSafe hook await-able by returning the promise of connect() call
    • add hook useSmartWallet
    • allow rendering custom wallet details button via <ConnectWallet detailsButton={} /> prop
    • Rename "Export" to "Backup" in local wallet UI
  • #1011 470e0a14 Thanks @MananTank! - rename ConfiguredWallet to WalletConfig

    - import { ConfiguredWallet } from '@thirdweb-dev/react';
    + import { WalletConfig } from '@thirdweb-dev/react';
    
  • #1019 8a0dd070 Thanks @iketw! - ## [ReactNative] Adds modalTitle, buttonTitle and detailsButton props to the ConnectWallet component

    You can now customize the following props:

    1. buttonTitle

    The title of the ConnectWallet button which defaults to: "Connect Wallet":

    <ConnectWallet buttonTitle="Connect to claim" />
    
    1. modalTitle

    The title of the ConnectWallet modal which defaults to: "Choose your wallet":

    <ConnectWallet modalTitle="Select a wallet" />
    
    1. detailsButton

    The button that shows the details of the connected wallet. By default it shows the chain icon, wallet balance, account address and wallet icon:

    const customDetailsButton = (
      <View>
        <Text>Connected button details</Text>
        <Text>{shortenWalletAddress(address)}</Text>
      </View>
    );
    
    <ConnectWallet detailsButton={customDetailsButton} />;
    

    Web3Button

    The buttonTitle and modalTitle props are also available in the Web3Button config since we show a ConnectWallet button if you don't have a connected wallet:

    <Web3Button
      connectWalletProps={{
        buttonTitle: "Connect to claim",
        modalTitle: "Pick a wallet",
      }}
      contractAddress="contract-address"
      action={(contract) => contract?.erc1155.claim(0, 1)}
    >
      Claim Factory
    </Web3Button>
    
  • #989 8db78299 Thanks @iketw! - [React/ReactNative] Updated useThirdwebWallet to useWalletContext

  • Updated dependencies [e9b69300, 39bd9630, 49ec2d17, 799d98e8, c3645c45, 470e0a14, b1ede491, 738c0ec6, d495a4b8, 482f6d1b, e4356e76, 9886c858, 8db78299, 4f843833]:

0.2.11

Patch Changes

0.2.10

Patch Changes

  • #981 ea0f9479 Thanks @iketw! - ## [ReactNative] Allow custom wallets be added to the ConnectWallet button modal

    With this new API you can build your own wallet and wallet UI and integrate it into our ConnectWallet modal:

    import type { ConfiguredWallet, ConnectUIProps } from '@thirdweb-dev/react-native';
    import { createAsyncLocalStorage, ConnectUIProps } from '@thirdweb-dev/react-native';
    import { WalletOptions } from '@thirdweb-dev/wallets';
    
    const WALLET_ID = "my-wallet-id";
    
    export const myWallet = (): ConfiguredWallet => {
      const asyncStorage = createAsyncLocalStorage(WALLET_ID);
      const configuredWallet = {
        id: WALLET_ID,
        meta: {
            id: WALLET_ID,
            name: "My Custom Wallet", // This will be displayed in the connect wallet modal
            iconURL: "ipfs or https url to an image or svg" // This will be used to fetch the icon to show in the connect wallet modal
        },
        create: (options: WalletOptions) =>
          new MyWallet({
            ...options,
            walletStorage: asyncStorage,
          }),
        connectUI(props: ConnectUIProps) {
          return <MyWalletUI {...props} />; // This will show up in the modal after the user selects your wallet
        },
      };
    
      return configuredWallet;
    };
    

    You can then add the wallet to your supportedWallets in the ThirdwebProvider:

    import { Goerli } from '@thirdweb-dev/chains';
    import {
      ThirdwebProvider,
      metamaskWallet,
    } from '@thirdweb-dev/react-native';
    
    const activeChain = Goerli;
    
    const App = () => {
      return (
        <ThirdwebProvider
          activeChain={activeChain}
          supportedChains={[activeChain]}
          supportedWallets={[
            myWallet(),
            metamaskWallet(),
          ]}>
          <AppInner />
        </ThirdwebProvider>
      );
    };
    

    This new version exposes some utility functions:

    1. formatWalletConnectDisplayUri

    Formats the wallet connect wc:// url for usage with custom wallet links

    1. shortenWalletAddress

    Shortens a wallet address for display purposes

    1. createAsyncLocalStorage and createSecureStorage

    You can use these methods to get wallet compatible storage types.

    • createAsyncLocalStorage uses MMKV in the background
    • createSecureStorage uses Expo SecureStore in the background
  • #969 12ad7fea Thanks @iketw! - [ReactNative] Remove gap prop for backward compat

  • #966 87021cee Thanks @MananTank! - Connect Wallet UI improvements

    • Allow from EOA => smart wallet / safe
    • Add warning to backup wallet for guest wallet
    • Show "Guest" instead of address for guest wallet
  • #977 93bd5733 Thanks @MananTank! - Fix Connect Wallet Open/Close issues

  • #968 9640e073 Thanks @iketw! - [ReactNative] Add guest mode warnings

  • Updated dependencies [93bdec06, ea0f9479, 05ebbc15, 5305b42d, 4ca557ae, 7d7685e3, 87021cee, eb521d24, af4b5356, 93bd5733, a2df187b, aa9b6acc]:

0.2.9

Patch Changes

0.2.8

Patch Changes

  • #874 49922de9 Thanks @iketw! - [RN] Adds Auth to React Native

    • Adds an optional secureStorage to authConfig
    • Adds expo-secure-store to store the JWT token securely in React Native, passing a default value
    • Stores the token in secure storage to be accessed by subsequent calls
    • Returns the token in useLogin to be used by the user

    How I tested:

    • Tested in Android/iOS/Web

    Usage:

    <ThirdwebProvider
          activeChain="ethereum"
          supportedWallets={[metamaskWallet(), rainbowWallet()]}
          authConfig={{
            domain: https://your-domain.com,
            authUrl: '/api/auth',
          }}>
          <AppInner />
        </ThirdwebProvider>
    
    const { login } = useLogin();
    const { logout } = useLogout();
    const { user, isLoggedIn } = useUser();
    ...
    
    const token = await login();
    
  • #886 51e6b414 Thanks @iketw! - [ReactNative] Fixes Coinbase wallet on iOS

    • Adds connect wallet hooks for the supported wallets:
    1. useMetaMaskWallet
    2. useCoinbaseWallet
    3. useRainbowWallet
    4. useTrustWallet

    Usage:

    const connect = useMetaMaskWallet();
    connect();
    
  • #916 0b1f5229 Thanks @iketw! - [ReactNative] Improve customization of buttons background and text colors

    You can now pass custom background and text colors without having to create the full theme object. Alternatively, you can complete customize the theme:

    import { ConnectWallet, darkTheme } from '@thirdweb-dev/react-native';
    
    <ConnectWallet theme={darkTheme({
       buttonBackgroundColor: '#new-color',
       buttonTextColor: '#another-color'
    })}
    />
    
    import { Web3Button, lightTheme } from '@thirdweb-dev/react-native';
    
    <Web3Button theme={lightTheme({
       buttonBackgroundColor: '#new-color',
       buttonTextColor: '#another-color'
    })}
    />
    

    Customizing theme beyond the button:

    import { ConnectWallet, darkTheme } from '@thirdweb-dev/react-native';
    
    const darkThemeCustom = darkTheme();
    
    <ConnectWallet
        theme={{
        ...darkThemeCustom,
        colors: {
            ...darkThemeCustom.colors,
            backgroundHighlight: 'blue',
        },
        }}
    />
    
  • Updated dependencies [abe88599, 49922de9, 4acb2b55, 82bea3fa, ea04edf4, 77224646, c9ee9b32, 00f4355f, a6610f12, 06cc1df3, 29146e00, 77224646, 430a5f79, 664d1cd0, bfdd8493, c2fec930, 477324ec]:

0.2.7

Patch Changes

0.2.6

Patch Changes

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

  • #584 d01b135d Thanks @MananTank! - [Wallets, RN, React, ReactCore] New Wallets SDK implementation

    Breaking changes:

    React and React Native

    1. Replaced walletConnectors with supportedWallets in the ThirdwebProvider.
      import { coinbaseWallet, metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      - return <ThirdwebProvider walletConnectors={["metamask", "coinbaseWallet"]}>{...}</ThirdwebProvider>
      + return <ThirdwebProvider supportedWallets={[metamaskWallet(), coinbaseWallet()]}>{...}</ThirdwebProvider>
      }
    
    1. magicLinkConnector not yet implemented in this version

    2. Removed desiredChainId, use activeChain instead

    3. DAppMetaData type now requires the url field to be passed in

    4. Removed chainRpc prop from the ThirdwebProvider. You can pass custom rpcs in the Chain object through the activeChain and supportedChains props.

    5. Replaced the useNetwork hook for useChain and useSwitchChain

    6. Updated ConnectWallet button in React:

    • Removed accentColor and colorMode
    • Added a theme prop with dark and light values
    1. Updated the Web3Button button in React:
    • Removed accentColor and colorMode
    • Added a theme prop with dark and light values

    Patch Changes

    • You can now pass a theme prop to the ThirdwebProvider. Values are light and dark
      import { ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      return <ThirdwebProvider theme='light'>{...}</ThirdwebProvider>
      }
    
    • New wallet hooks added

      • useWallet()
      • useConenct()
      • useConnectionStatus()
      • useSwitchChain()
    • Removed wagmi dependency from the react-native-compat package and updated shims

    • New ConnectWallet and Web3Button components in React Native

    • New wallets package with support for the most common wallets. MetaMask, Coinbase, WalletConnect V1 and V2 and PaperWallet

    • Added autoSwitch prop to the ThirdwebProvider to control whether or not to automatically switch to wallet's network to active chain

      import { ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      return <ThirdwebProvider autoSwitch>{...}</ThirdwebProvider>
      }
    
  • #584 d01b135d Thanks @MananTank! - [Wallets] New and updated wallets. [RN] UI Components and Wallets support.

Patch Changes

0.1.9

Patch Changes

0.1.8

Patch Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes