Files
Jonas Danielsandgithub-actions[bot] 6bf1dad28b Version Packages (#2896)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-01 21:55:20 +12:00

32 KiB

thirdweb

5.15.0

Minor Changes

Patch Changes

5.14.0

Minor Changes

Patch Changes

5.13.0

Minor Changes

  • #2853 56c139c Thanks @joaquim-verges! - Add account abstraction options to useConnect and handle smart wallet autoconnection outside of UI components

Patch Changes

5.12.0

Minor Changes

Patch Changes

  • #2848 41be954 Thanks @jnsdls! - add celo chains to known op stack chains

  • #2850 aa0b8c4 Thanks @MananTank! - Fix "All wallets" UI in Connect

    • Remove duplicated entry for "inApp"
    • Remove wallets specified by developer

5.11.0

Minor Changes

  • #2679 560d8ad Thanks @ElasticBottle! - Add support for connecting in-app wallet using phone number

    Usage in TypeScript

    import { createThirdwebClient, createWallet } from "thirdweb";
    import { preAuthenticate } from "thirdweb/wallets/in-app";
    
    const client = createThirdwebClient({ clientId: "..." });
    
    const phoneNumber = '+123456789';
    
    // Send OTP to given phone number
    async function sendOTP() {
      await preAuthenticate({
        strategy: "phone",
        phoneNumber,
        client,
      });
    }
    
    async function connect() {
      // create a in-app wallet instance
      const wallet = createWallet('inApp');
      // if the OTP is correct, the wallet will be connected else an error will be thrown
      const account = await wallet.connect({
        client,
        strategy: "phone";
        phoneNumber,
        verificationCode: '...' // Pass the OTP entered by the user
      });
    
      console.log('connected to', account);
    }
    

    Usage in React

    import { createThirdwebClient } from "thirdweb";
    import { preAuthenticate } from "thirdweb/wallets/in-app";
    import { useConnect } from "thirdweb/react";
    
    const client = createThirdwebClient({ clientId: "..." });
    
    function Component() {
      const { connect } = useConnect();
      const [phoneNumber, setPhoneNumber] = useState(''); // get phone number from user
      const [otp, setOtp] = useState(''); // get OTP from user
    
      // Send OTP to given phone number
      async function sendOTP() {
        await preAuthenticate({
          strategy: "phone",
          phoneNumber,
          client,
        });
      }
    
      async function connect() {
        // create a in-app wallet instance
        const wallet = createWallet('inApp');
        // if the OTP is correct, the wallet will be connected else an error will be thrown
        await wallet.connect({
          client,
          strategy: "phone";
          phoneNumber,
          verificationCode: otp
        });
    
        // set the wallet as active
        connect(wallet)
      }
    
      // render UI to get OTP and phone number from user
      return <div> ...  </div>
    }
    
  • #2818 948f155 Thanks @jnsdls! - Gasless transactions in Typescript

    import { sendTransaction } from "thirdweb";
    
    const result = sendTransaction({
      transaction,
      account,
      gasless: {
        provider: "engine",
        relayerUrl: "https://...",
        relayerForwarderAddress: "0x...",
      },
    });
    

    Gasless transactions in React

    import { useSendTransaction } from "thirdweb/react";
    
    const { mutate } = useSendTransaction({
      gasless: {
        provider: "engine",
        relayerUrl: "https://...",
        relayerForwarderAddress: "0x...",
      },
    });
    
    // Call mutate with the transaction object
    mutate(transaction);
    

Patch Changes

5.10.1

Patch Changes

5.10.0

Minor Changes

Patch Changes

5.9.0

Minor Changes

  • #2793 4dbcbd1 Thanks @jnsdls! - thirdweb/react

    Add a new optional auth prop to <ConnectButton /> to allow specifying a SIWE auth flow after users connect their wallets.

    <ConnectButton
      client={client}
      auth={{
        isLoggedIn: async (address) => {
          // check if the user is logged in by calling your server, etc.
          // then return a boolean value
          return true || false;
        },
        getLoginPayload: async ({ address, chainId }) => {
          // send the address (and optional chainId) to your server to generate the login payload for the user to sign
          // you can use the `generatePayload` function from `thirdweb/auth` to generate the payload
          // once you have retrieved the payload return it from this function
    
          return; // <the login payload here>
        },
        doLogin: async (loginParams) => {
          // send the login params to your server where you can validate them using the `verifyPayload` function
          // from `thirdweb/auth`
          // you can then set a cookie or return a token to save in local storage, etc
          // `isLoggedIn` will automatically get called again after this function resolves
        },
        doLogout: async () => {
          //  do anything you need to do such as clearing cookies, etc when the user should be logged out
          // `isLoggedIn` will automatically get called again after this function resolves
        },
      }}
    />
    

Patch Changes

5.8.0

Minor Changes

Patch Changes

5.7.0

Minor Changes

  • #2803 a54c745 Thanks @jnsdls! - Added new extensions for "English Auctions" in thirdweb/extensions/marketplace module:

    • bidInAuction
    • cancelAuction
    • buyoutAuction
    • collectAuctionPayout
    • collectAuctionTokens
    • executeSale
  • #2767 300e4c8 Thanks @MananTank! - Open "Pay Modal" UI when sending transaction using the useSendTransaction hook if the user does not have enough funds to execute the transaction to prompt the user to buy tokens

    useSendTransaction now takes an optional config option to customize the "Pay Modal" UI

    const sendTransaction = useSendTransaction({
      payModal: {
        locale: "en_US",
        theme: "light",
      },
    });
    

    You may also explicitly disable the "Pay Modal" UI by setting the payModal option to false

    const sendTransaction = useSendTransaction({
      payModal: false,
    });
    
  • #2788 f5abbe8 Thanks @joaquim-verges! - Added deployPublishedContract

Patch Changes

5.6.0

Minor Changes

  • #2760 8197b3c Thanks @gregfromstl! - Adds serializeTransaction and updates sign return object to include yParity

  • #2766 65e4ddc Thanks @joaquim-verges! - Added ERC721 extensions:

    • claimTo with allowlist support
    • lazyMint
    • setClaimConditions
  • #2771 df338f5 Thanks @jnsdls! - Added ERC20 extensions:

    • claimTo with allowlist support
    • setClaimConditions
  • #2757 9d46fce Thanks @jnsdls! - add extensions for contract roles in the thirdweb/extensions/permissions namespace

Patch Changes

5.5.0

Minor Changes

  • #2752 39c6fbc Thanks @jnsdls! - add concatHex utility function

  • #2744 db05717 Thanks @joaquim-verges! - Added 1155 extensions:

    • claimTo with allowlist support
    • lazyMint
    • setClaimConditions
  • #2749 eb919ed Thanks @jnsdls! - - storage: upload now returns a single uri when a single file is passed to the files array.

    • extensions: added suport for royalty, platformFee and primarySale extensions

Patch Changes

  • #2748 007770c Thanks @MananTank! - - Show ENS name and avatar in ConnectButton's Details Modal

    • Add wallet ID alias "embedded" for "inApp" to avoid breaking change
    createWallet("embedded"); // supported but deprecated
    
    createWallet("inApp"); // recommended
    
  • #2759 07f98a5 Thanks @MananTank! - - Improved Swap UI in ConnectButton Details Modal

    • Prevent Modal from closing when clicking on "Switch Network" in the Swap UI
    • Fix wrong network name shown in Transaction History
  • #2756 e6b5d9c Thanks @jnsdls! - improve resolveScheme reliability and handle cases where getNFT for ERC1155 was breaking on missing totalSupply method

  • #2678 9453f74 Thanks @kumaryash90! - Custom gas settings for any evm deployments

5.4.2

Patch Changes

5.4.1

Patch Changes

5.4.0

Minor Changes

Patch Changes

  • #2731 1d4fdd6 Thanks @jnsdls! - export ChainMetadata type from thirdweb/chains

  • #2712 02583f8 Thanks @jnsdls! - fix watchBlockNumber polling when fully unsubscribing and later re-subscribing

5.3.1

Patch Changes

5.3.0

Minor Changes

Patch Changes

  • #2689 740a675 Thanks @jnsdls! - ---

    Marketplace Extensions

    Added initial support for the Marketplace extensions, available via the thirdweb/extensions/marketplace module.

    Direct Listings

    Write

    • createListing

    Read

    • totalListings
    • getListing
    • getAllListings
    • getAllValidListings

    Events

    • buyerApprovedForListingEvent
    • cancelledListingEvent
    • currencyApprovedForListingEvent
    • newListingEvent
    • newSaleEvent
    • updatedListingEvent

    English Auctions

    Write

    • createAuction

    Read

    • totalAuctions
    • getAuction
    • getAllAuctions
    • getAllValidAuctions

    Events

    • auctionClosedEvent
    • cancelledAuctionEvent
    • newAuctionEvent
    • newBidEvent

    Types

    • DirectListing
    • EnglishAuction

    ERC721 Extensions

    • Added isERC721 to the thirdweb/extensions/erc721 module.

    ERC1155 Extensions

    • Added isERC1155 to the thirdweb/extensions/erc1155 module.
  • #2700 f709f13 Thanks @jnsdls! - ENS: add support for resolveName(), resolveAvatar() and resolveText()

  • #2686 a2423ca Thanks @MananTank! - Add modalSize prop on ConnectEmbed to allow "wide" modal size.

  • #2684 4504a8d Thanks @MananTank! - Fix sourcemap warnings in CRA

  • #2677 0e479e2 Thanks @farhanW3! - added 50k overhead to userOp gas estimations

5.2.0

Minor Changes

  • #2667 44d9630 Thanks @joaquim-verges! - API update for ethers5 and ethers5 adapters:

    • Now all adapter functions take a singular object
    • ethers5: fixed adapted signer not containing a provider by default
    • ethers5: added support for sign typed data
  • #2674 97a31f5 Thanks @joaquim-verges! - Add useSendAndConfirmTransaction hook

Patch Changes

  • #2666 127c476 Thanks @gregfromstl! - fix getAddresses for accounts converted to viem

  • #2637 367576c Thanks @MananTank! - - Always start a new session when calling wallet.connect for WalletConnect

    • Fix JSDoc for useConnectedWallets
    • Add accountsChanged event back to Wallet
    • wallet.disconnect method cleanups

5.1.1

Patch Changes

5.1.0

Minor Changes

Patch Changes

5.0.3

Patch Changes

5.0.2

Patch Changes

  • #2585 052892b Thanks @MananTank! - Fix wallet not opened on WC sessions request event on page reload on mobile

  • #2587 6063f40 Thanks @jnsdls! - [CLI] - fix execution on windows and when prettier is not installed

5.0.1

Patch Changes

5.0.0

Major Changes

Patch Changes