Files
js/packages/thirdweb/CHANGELOG.md
T
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
f424d0ab2d Version Packages (#4741)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-21 22:46:48 +12:00

173 KiB

thirdweb

5.58.3

Patch Changes

5.58.2

Patch Changes

5.58.1

Patch Changes

5.58.0

Minor Changes

  • #4692 0a7448c Thanks @gregfromstl! - Login to an in-app wallet with your Coinbase account

    import { inAppWallet } from "thirdweb/react";
    
    const wallet = inAppWallet();
    
    const account = await wallet.connect({
      strategy: "coinbase",
      chain: mainnet,
      client: thirdwebClient,
    });
    

Patch Changes

5.57.3

Patch Changes

5.57.2

Patch Changes

5.57.1

Patch Changes

  • #4665 6ce7c83 Thanks @joaquim-verges! - Update @mobile-wallet-protocol/client to 0.0.3

  • #4659 406de39 Thanks @jnsdls! - - Allow using valid JWTs for authorization

    • update dependencies
    • simplify updateMetadata extension params for ERC721 and ERC1155

5.57.0

Minor Changes

  • #4631 a468439 Thanks @gregfromstl! - Adds guest account option. These accounts will only persist for the duration of the user's session unless they link an additionaly auth method to recover the account with.

    import { inAppWallet } from "thirdweb/wallets";
    
    const wallet = inAppWallet();
    
    const account = await wallet.connect({
      client,
      strategy: "guest",
    });
    

Patch Changes

5.56.0

Minor Changes

  • #4607 7b94bf5 Thanks @joaquim-verges! - Expose checkModulesCompatibility function

  • #4601 a4a4136 Thanks @joaquim-verges! - useAdminWallet() Hook + automatically auth when using inapp + smart accounts

    Add useAdminWallet() hook to get the admin wallet for a smart wallet

    const activeWallet = useActiveWallet(); // smart wallet
    const adminWallet = useAdminWallet(); // the personal wallet that controls the smart wallet
    

    Automatically auth when using inapp + smart accounts

    When using auth with an inapp + smart wallet, ConnectButton and ConnectEmebed will automatically auth without having to click sign in.

  • #4604 3009a0f Thanks @joaquim-verges! - Expose publishContract extension

Patch Changes

5.55.0

Minor Changes

  • #4571 5058fdb Thanks @gregfromstl! - Adds X authentication

  • #4565 c0778cb Thanks @gregfromstl! - Adds parseAvatarRecord and parseNftUri utilities

    import { parseAvatarRecord } from "thirdweb/extensions/ens";
    import { parseNftUri } from "thirdweb/extensions/common";
    
    const avatarUrl = await parseAvatarRecord({
      client,
      uri: "...",
    });
    
    const nftUri = await parseNftUri({
      client,
      uri: "...",
    });
    

Patch Changes

  • #4582 5d3b395 Thanks @gregfromstl! - Adds the ability to hide certain wallets in the wallet switcher

    <ConnectButton
      client={client}
      detailsModal={{
        // We hide the in-app wallet so they can't switch to it
        hiddenWallets: ["inApp"],
      }}
      accountAbstraction={{
        chain: baseSepolia,
        sponsorGas: true,
      }}
    />
    
  • #4546 3901805 Thanks @edwardysun! - Add preferredProvider to buyWithFiat

5.54.0

Minor Changes

  • #4527 b76a82c Thanks @joaquim-verges! - Update React Native dependencies and add support for React Native 0.75

  • #4499 fe1ff63 Thanks @joaquim-verges! - Breaking Change in deployPublishedContract

    Contract constructor/ initializer params are now passed as a single object instead of an array. The object should have the same shape as the params defined in the contract's ABI.

    Example of old way (using constructorParams or initializeParams):

    const address = await deployPublishedContract({
      account,
      chain,
      client,
      contractId: "Airdrop",
      contractParams: [TEST_ACCOUNT_A.address, ""],
    });
    

    New way (using contractParams):

    const address = await deployPublishedContract({
      account,
      chain,
      client,
      contractId: "Airdrop",
      contractParams: {
        defaultAdmin: TEST_ACCOUNT_A.address,
        contractURI: "",
      },
    });
    
  • #4528 c96e2d9 Thanks @joaquim-verges! - Handle salt parameter for deterministic deploys of published contracts

    You can now pass a salt parameter to the deployPublishedContract function to deploy a contract deterministically.

    const address = await deployPublishedContract({
      client,
      chain,
      account,
      contractId: "Airdrop",
      contractParams: {
        defaultAdmin: "0x...",
        contractURI: "ipfs://...",
      },
      salt: "test", // <--- deterministic deploy
    });
    

    This also works for unpublished contracts, via the deployContract function.

    const address = await deployContract({
      client,
      chain,
      account,
      bytecode: "0x...",
      abi: contractAbi,
      constructorParams: {
        param1: "value1",
        param2: 123,
      },
      salt: "test", // <--- deterministic deploy
    });
    
  • #4541 0596fa2 Thanks @gregfromstl! - Adds getUsers function to query users on the server

    import { getUser } from "thirdweb/wallets";
    
    const user = await getUser({
      client,
      walletAddress: "0x123...",
    });
    

Patch Changes

5.53.0

Minor Changes

  • #4094 f1d087e Thanks @joaquim-verges! - Support for Coinbase Smart Wallet in React Native

    You can now use the Coinbase Smart Wallet in your React Native apps.

    const wallet = createWallet("com.coinbase.wallet", {
      appMetadata: {
        name: "My app name",
      },
      mobileConfig: {
        callbackURL: "https://example.com",
      },
      walletConfig: {
        options: "smartWalletOnly",
      },
    });
    
    await wallet.connect({
      client,
    });
    
  • #4454 c546b65 Thanks @joaquim-verges! - Expose createAndSignUserOp utility function

Patch Changes

5.52.0

Minor Changes

  • #4349 a2d2291 Thanks @gregfromstl! - Adds social profile retrieval for Farcaster, Lens, and ENS.

    import { getSocialProfiles } from "thirdweb/social";
    const profiles = await getSocialProfiles({
      address: "0x...",
      client,
    });
    
    [
      {
        "type": "ens",
        "name": "joenrv.eth",
        "avatar": "ipfs://bafybeic2wvtpv5hpdyeuy6o77yd5fp2ndfygppd6drdxvtfd2jouijn72m",
        "metadata": {
          "name": "joenrv.eth"
        }
      },
      {
        "type": "farcaster",
        "name": "joaquim",
        "bio": "Eng Lead @ thirdweb",
        "avatar": "https://lh3.googleusercontent.com/EUELPFJzdDNcc3qSaEMekh0_W16acnS8MSvWizt-7HPaQhfJsNFC5HA0W4NKcy6CN9zmV7d4Crqg2B8qM9BpiveqVTl2GPBQ16Ax2IQ",
        "metadata": {
          "fid": 2735,
          "bio": "Eng Lead @ thirdweb",
          "pfp": "https://lh3.googleusercontent.com/EUELPFJzdDNcc3qSaEMekh0_W16acnS8MSvWizt-7HPaQhfJsNFC5HA0W4NKcy6CN9zmV7d4Crqg2B8qM9BpiveqVTl2GPBQ16Ax2IQ",
          "username": "joaquim",
          "addresses": [
            "0x2247d5d238d0f9d37184d8332ae0289d1ad9991b",
            "0xf7970369310b541b8a84086c8c1c81d3beb85e0e"
          ]
        }
      },
      {
        "type": "lens",
        "name": "joaquim",
        "bio": "Lead engineer @thirdweb",
        "avatar": "https://ik.imagekit.io/lens/media-snapshot/557708cc7581172234133c10d473058ace362c5f547fa86cee5be2abe1478e5b.png",
        "metadata": {
          "name": "joaquim",
          "bio": "Lead engineer @thirdweb",
          "picture": "https://ik.imagekit.io/lens/media-snapshot/557708cc7581172234133c10d473058ace362c5f547fa86cee5be2abe1478e5b.png"
        }
      }
    ]
    
    import { useSocialProfiles } from "thirdweb/react";
    const { data: profiles } = useSocialProfiles({
      client,
      address: "0x...",
    });
    
  • #3413 87d6b6a Thanks @joaquim-verges! - Support for modular contracts

    Deploy and Interact with modular contracts programmatically

    Deploy a modular contract

    import {
      ClaimableERC721,
      BatchMetadataERC721,
      deployModularContract,
    } from "thirdweb/modules";
    
    const deployed = deployModularContract({
       client,
       chain,
       account,
       core: "ERC721",
       params: {
         name: "My Modular NFT Contract",
       },
       modules: [
         ClaimableERC721.module({
            primarySaleRecipient: ...,
         }),
         BatchMetadataERC721.module(),
       ],
    });
    

    Interact with a modular contract

    import { ClaimableERC721 } from "thirdweb/modules";
    
    const contract = getContract({
      client,
      chain,
      address,
    });
    
    const transaction = ClaimableERC721.mint({
      contract,
      to: account.address,
      quantity: 1,
    });
    
    await sendTransaction({
      transaction,
      account,
    });
    

Patch Changes

5.51.0

Minor Changes

Patch Changes

5.50.1

Patch Changes

  • #4388 82a30af Thanks @edwardysun! - Update setting default source chain and token

  • #4375 edb95d0 Thanks @jnsdls! - [Extensions] expose permission detection logic

  • #4390 d74e61b Thanks @MananTank! - Fix Swap Fees layout in fees drawer in pay UI

  • #4319 73e5dc7 Thanks @joaquim-verges! - Fix direct payments to the same wallet

  • #4382 9e8d3e6 Thanks @MananTank! - Add props for hiding "Send", "Receive" and "Send" buttons in Connect Details Modal UI for ConnectButton component. By default, all buttons are visible in the modal.

    <ConnectButton
      detailsModal={{
        hideSendFunds: false,
        hideReceiveFunds: true,
        hideBuyFunds: false,
      }}
    />
    
  • #4363 066aede Thanks @kien-ngo! - Allow to specify "from" and "to" props for the ClaimButton

5.50.0

Minor Changes

Patch Changes

5.49.0

Minor Changes

  • #4179 42d5c65 Thanks @kien-ngo! - Add NFT prebuilt components

    import { getContract } from "thirdweb";
    import { NFT } from "thirdweb/react";
    
    const contract = getContract({
      address: "0x...",
      chain: ethereum,
      client: yourThirdwebClient,
    });
    
    <NFT contract={contract} tokenId={0n}>
      <Suspense fallback={"Loading media..."}>
        <NFT.Media />
      </Suspense>
    </NFT>;
    

Patch Changes

5.48.3

Patch Changes

5.48.2

Patch Changes

  • #4250 41fbdaf Thanks @gregfromstl! - Add overload to signMessage to pass an account rather than a private key

    import { signMessage } from "thirdweb/utils";
    await signMessage({
      message: "Hello, world!",
      account,
    });
    
  • #4267 7a2de70 Thanks @alecananian! - Added hideSwitchWallet param to wallet details modal

  • #4224 1405598 Thanks @IDubuque! - Added support for direct transfers in Pay

  • #4269 120d61f Thanks @MananTank! - Show wallet balance with upto 5 decimal places in UI components

  • #4274 a0aea23 Thanks @gregfromstl! - Fix popup and window auth modes conflicting on firefox

  • #4244 44e8e7b Thanks @MananTank! - - Pay UI now selects the fiat currency based on the user's location / timezone

    • Add Japanese Yen (JPY) as a supported fiat currency for thirdweb Pay
    • Added option to configure the default fiat currency for the Pay UI

    Examples

    <PayEmbed
      client={client}
      payOptions={{
        buyWithFiat: {
          prefillSource: {
            currency: "CAD",
          },
        },
      }}
    />
    
    <ConnectButton
      client={client}
      detailsModal={{
        payOptions: {
          buyWithFiat: {
            prefillSource: {
              currency: "JPY",
            },
          },
        },
      }}
    />
    
    const sendTransaction = useSendTransaction({
      payModal: {
        buyWithFiat: {
          prefillSource: {
            currency: "CAD",
          },
        },
      },
    });
    
    <TransactionButton
      transaction={() => someTx}
      payModal={{
        buyWithFiat: {
          prefillSource: {
            currency: "CAD",
          },
        },
      }}
    >
      some tx
    </TransactionButton>
    

5.48.1

Patch Changes

  • #4237 b38308d Thanks @gregfromstl! - Enable external redirects for electron support

    import { authenticate } from "thirdweb/wallets/in-app";
    
    const result = await authenticate({
      client,
      strategy: "google",
      redirectUrl: "https://example.org",
      mode: "window",
    });
    
  • #4213 6c87d7b Thanks @MananTank! - Fix "conditionally rendereed hooks error" in various components in thirdweb/react and thirdweb/react-native

  • #4214 0a1bce8 Thanks @gregfromstl! - Fix custom image metadata on in-app wallets

  • #4239 d93ec63 Thanks @joaquim-verges! - Fix passkey domain not being respected on login

5.48.0

Minor Changes

Patch Changes

  • #4128 ef9cc55 Thanks @kien-ngo! - Expose max() & min() util methods for bigints

  • #4172 cb591aa Thanks @joaquim-verges! - Only show pay modal if active wallet does not have enough funds for a paid transaction

  • #4177 bd46699 Thanks @kien-ngo! - Expsose GaslessConfigs type

    const gaslessOptions: GaslessOptions = {
      provider: "engine",
      relayerUrl: "https://thirdweb.engine-***.thirdweb.com/relayer/***",
      relayerForwarderAddress: "0x...",
    };
    
  • #4211 4abf7a7 Thanks @MananTank! - Fix Conditionally rendered hook error when Buying funds using fiat

5.47.1

Patch Changes

5.47.0

Minor Changes

Patch Changes

5.46.1

Patch Changes

5.46.0

Minor Changes

  • #4045 3c32b99 Thanks @gregfromstl! - Update SIWE interface

    import { inAppWallet, createWallet } from "thirdweb/wallets";
    import { mainnet } from "thirdweb/chains";
    
    const rabby = createWallet("io.rabby");
    const wallet = inAppWallet();
    
    const account = await wallet.connect({
      client: MY_CLIENT,
      strategy: "wallet",
      wallet: rabby,
      chain: mainnet,
    });
    
  • #4077 ef9c7df Thanks @joaquim-verges! - Passkey login support in React Native

Patch Changes

  • #4033 141fd53 Thanks @kien-ngo! - Add more Split contract extensions

  • #3998 db8695d Thanks @kien-ngo! - Add NFT extension: updateTokenURI

  • #4101 03a809a Thanks @MananTank! - Add onPurchaseSuccess callback to PayEmbed, ConnectButton, TransactionButton and useSendTransaction and gets called when user completes the purchase using thirdweb pay.

    <PayEmbed
      client={client}
      payOptions={{
        onPurchaseSuccess(info) {
          console.log("purchase success", info);
        },
      }}
    />
    
    <ConnectButton
      client={client}
      detailsModal={{
        payOptions: {
          onPurchaseSuccess(info) {
            console.log("purchase success", info);
          },
        },
      }}
    />
    
    <TransactionButton
      transaction={...}
      payModal={{
        onPurchaseSuccess(info) {
          console.log("purchase success", info);
        },
      }}
    >
      Some Transaction
    </TransactionButton>
    
    const sendTransaction = useSendTransaction({
      payModal: {
        onPurchaseSuccess(info) {
          console.log("purchase success", info);
        },
      },
    });
    
  • #4047 7a68e3b Thanks @gregfromstl! - Switch to the proper chain prior to signing SIWE payloads

  • #4092 0ca1a79 Thanks @gregfromstl! - UI cosmetic improvements

  • #4091 b9ed753 Thanks @MananTank! - Fix connection with Safe using WalletConnect link

  • #4070 e5a046e Thanks @kien-ngo! - Add contract util method: getCompilerMetadata()

5.45.1

Patch Changes

5.45.0

Minor Changes

  • #3870 bbb4f1c Thanks @gregfromstl! - Adds useProfiles hook to fetch linked profiles for the current wallet.

    import { useProfiles } from "thirdweb/react";
    
    const { data: profiles } = useProfiles();
    
    console.log("Type:", profiles[0].type); // "discord"
    console.log("Email:", profiles[0].email); // "[email protected]"
    
  • #3870 bbb4f1c Thanks @gregfromstl! - Adds SIWE authentication on in-app wallets

    import { inAppWallet } from "thirdweb/wallets";
    
    const wallet = inAppWallet();
    const account = await wallet.connect({
      client,
      walletId: "io.metamask",
      chainId: 1, // can be anything unless using smart accounts
    });
    

    This will give you a new in-app wallet, not the injected provider wallet.

  • #3797 f74d523 Thanks @gregfromstl! - Wallets can now add additional profiles to an account. Once added, any connected profile can be used to access the same wallet.

    const wallet = inAppWallet();
    
    await wallet.connect({ strategy: "google" });
    const profiles = await linkProfile(wallet, { strategy: "discord" });
    

    Both the Google and Discord accounts will now be linked to the same wallet.

    If the Discord account is already linked to this or another wallet, this will throw an error.

    You can retrieve all profiles linked to a wallet using the getProfiles method.

    import { inAppWallet, getProfiles } from "thirdweb/wallets";
    
    const wallet = inAppWallet();
    wallet.connect({ strategy: "google" });
    
    const profiles = getProfiles(wallet);
    

    This would return an array of profiles like this:

    [
      {
        type: "google",
        details: {
          email: "[email protected]",
        },
      },
      {
        type: "discord",
        details: {
          email: "[email protected]",
        },
      },
    ];
    
  • #3995 5367eed Thanks @kien-ngo! - Add thirdweb Split contract extensions

  • #3993 c31f25c Thanks @kien-ngo! - Add thirdweb Vote contract extensions

  • #3870 bbb4f1c Thanks @gregfromstl! - Adds account linking to the Connect UI

Patch Changes

5.44.1

Patch Changes

5.44.0

Minor Changes

  • c9e14e3 Thanks @jnsdls! - Adds telegram login option for in-app wallets

    import { inAppWallet } from "thirdweb";
    
    const wallet = inAppWallet();
    
    await wallet.connect({
      strategy: "telegram",
    });
    

Patch Changes

  • c9e14e3 Thanks @jnsdls! - Added Celo Alfajores Testnet within the chain-definitions

  • c9e14e3 Thanks @jnsdls! - Add type field on DirectListing and EnglishAuction types.

5.43.2

Patch Changes

5.43.1

Patch Changes

5.43.0

Minor Changes

  • #3875 337c8c9 Thanks @jnsdls! - add German localization

  • #3881 e7d6161 Thanks @kien-ngo! - Add CreateDirectListing button for Marketplace v3

    import { CreateDirectListingButton } from "thirdweb/react";
    
    <CreateDirectListingButton
      contractAddress="0x..." // contract address for the marketplace-v3
      chain={...} // the chain which the marketplace contract is deployed on
    
      // These props below are the same props for `createListing`
      // to get the full list, check the docs link above
      tokenId={0n}
      assetContractAddress="0x..." // The NFT contract address whose NFT(s) you want to sell
      pricePerToken={"0.1"} // sell for 0.1 <native token>
    >
      Sell NFT
    </CreateDirectListingButton>
    

Patch Changes

5.42.0

Minor Changes

  • #3847 e27ebef Thanks @kien-ngo! - Add prebuilt component: BuyDirectListingButton for Marketplace v3

    import { BuyDirectListingButton } from "thirdweb/react";
    
    <BuyDirectListingButton
      contractAddress="0x..." // contract address of the marketplace v3
      chain={...} // the chain which the marketplace contract is deployed on
      client={...} // thirdweb client
      listingId={100n} // the listingId or the item you want to buy
      quantity={1n} // optional - see the docs to learn more
    >
      Buy NFT
    </BuyDirectListingButton>
    
  • #3857 d5e5467 Thanks @gregfromstl! - Adds useChainMetadata to retrieve metadata for a chain such as name, icon, available faucets, block explorers, etc.

    import { useChainMetadata } from "thirdweb/react";
    
    const { data: chainMetadata } = useChainMetadata(defineChain(11155111));
    
    console.log("Name:", chainMetadata.name); // Sepolia
    console.log("Faucets:", chainMetadata.faucets); // ["https://thirdweb.com/sepolia/faucet"]
    console.log("Explorers:", chainMetadata.explorers); // ["https://sepolia.etherscan.io/"]
    

Patch Changes

  • #3846 cdb2970 Thanks @kien-ngo! - Handle ERC20 approval for the ClaimButton

  • #3843 91edae5 Thanks @kien-ngo! - Expose multicall & erc1155:encodeSafeTransferFrom extension

  • #3867 109575e Thanks @gregfromstl! - Fix wallet social login button styling

  • #3854 7ec421f Thanks @kien-ngo! - Add util function: parseAbiParams

    import { parseAbiParams } from "thirdweb/utils";
    
    const example1 = parseAbiParams(
      ["address", "uint256"],
      ["0x.....", "1200000"],
    ); // result: ["0x......", 1200000n]
    
  • #3869 bd44ce9 Thanks @joaquim-verges! - Export more wallet creation and connection types

5.41.0

Minor Changes

  • #3827 b0a303d Thanks @gregfromstl! - Adds SIWF for in-app wallets

    await wallet.connect({
      strategy: "farcaster",
      client: CLIENT,
    });
    

Patch Changes

5.40.0

Minor Changes

  • #3750 4a4a061 Thanks @joaquim-verges! - New PayEmbed modes and revamp TransactionButton flow

    You can now configure the PayEmbed component to build 3 different flows:

    • Fund wallets: Inline component that allows users to buy any currency. (default)
    <PayEmbed
      client={client}
      payOptions={{
        mode: "fund_wallet",
      }}
    />
    
    • Direct payments: Take payments from Fiat or Crypto directly to your seller wallet.
    <PayEmbed
      client={client}
      payOptions={{
        mode: "direct_payment",
        paymentInfo: {
          sellerAddress: "0x...",
          chain: base,
          amount: "0.1",
        },
        metadata: {
          name: "Black Hoodie (Size L)",
          image: "https://example.com/image.png",
        },
      }}
    />
    
    • Transaction payments: Let your users pay for onchain transactions with fiat or crypto on any chain.
    <PayEmbed
      client={client}
      payOptions={{
        mode: "transaction",
        transaction: claimTo({
          contract,
          tokenId: 0n,
          to: toAddress,
        }),
        metadata: nft?.metadata,
      }}
    />
    

    You can also configure the TransactionButton component to show metadata to personalize the transaction payment flow:

    <TransactionButton
      transaction={() => {
        return transfer({
          contract,
          amount: 10n,
          to: toAddress,
        });
      }}
      payModal={{
        metadata: {
          name: "Buy me a coffee",
          image: "https://example.com/image.png",
        },
      }}
    />
    
  • #3822 3848327 Thanks @gregfromstl! - Adds the ability to open OAuth windows as a redirect. This is useful for embedded applications such as telegram web apps.

    Be sure to include your domain in the allowlisted domains for your client ID.

    import { inAppWallet } from "thirdweb/wallets";
    const wallet = inAppWallet({
      auth: {
        mode: "redirect",
      },
    });
    

Patch Changes

  • #3813 6081ac7 Thanks @kien-ngo! - Expose types: NFTInput and NFTMetadata

  • #3815 87dc9a5 Thanks @MananTank! - Allow clicking on other wallet when a wallet is connected and sign in is required in ConnectEmbed component.

5.39.0

Minor Changes

  • #3785 105e523 Thanks @kien-ngo! - Add ClaimButton for claiming tokens from all thirdweb Drop contracts

    Higher level abstraction to claim tokens from all thirdweb Drop contracts

    import { ClaimButton } from "thirdweb/react";
    import { ethereum } from "thirdweb/chains";
    
    <ClaimButton
      contractAddress="0x..."
      chain={ethereum}
      client={client}
      claimParams={{
        type: "ERC721",
        quantity: 1n,
      }}
    >
      Claim now
    </ClaimButton>;
    

Patch Changes

5.38.0

Minor Changes

  • #3766 9f555ca Thanks @kien-ngo! - Add more chains: Astria EVM Dusknet (912559), Blast Sepolia (168587773), Celo (42220), Cronos (25), Degen (666666666), Fantom Testnet (4002), Fantom (250), Frame Tesnet (68840142), Gnosis Chiado Testnet (10200), Gnosis (100), GodWoken (71402), GodWoken Testnet (71401), Hokum Testnet (20482050), Localhost (1337), Loot chain (5151706), Manta Pacific (169), Manta Pacific Testnet (3441005), Moonbeam (1284), Palm Testnet (11297108099), Palm (11297108109), Polygon zkEvm Testnet (1442), Polygon zkEVM (1101), Rari Testnet (1918988905), Rari chain (1380012617), Scroll Alpha Testnet (534353), Scroll Sepolia Testnet (534353), Scroll (534352), Xai Sepolia (37714555429), Xai Mainnet(660279), zk Candy Sepolia (302)

Patch Changes

5.37.0

Minor Changes

  • #3678 31ee4e5 Thanks @ElasticBottle! - Add discord login as an option of thirdweb in app wallet and ecosystem wallet logins

    import { inAppWallet } from "thirdweb/wallets";
    const wallet = inAppWallet();
    const account = await wallet.connect({
      client,
      chain,
      strategy: "discord",
    });
    
  • #3716 ec3405b Thanks @gregfromstl! - Adds Discord login to the React Native SDK

Patch Changes

5.36.0

Minor Changes

Patch Changes

  • #3730 db2cadf Thanks @MananTank! - Update buffer calculation of transaction if gas estimation fails for Pay Modal

  • #3735 6cc3038 Thanks @joaquim-verges! - Add optional 'from' in readContract()

  • #3719 05df89c Thanks @joaquim-verges! - Add support for ERC20 paymaster for smart accounts

  • #3728 0a5af48 Thanks @MananTank! - Fix chain with custom RPC not used if the chain object is passed in the chains prop to ConnectButton, ConnectEmbed or PayEmbed components.

    This also fixes dashboard not using custom chain's RPC since it passes the chain object via chains prop

5.35.0

Minor Changes

Patch Changes

5.34.3

Patch Changes

5.34.2

Patch Changes

5.34.1

Patch Changes

  • #3634 4d24208 Thanks @MananTank! - Fix random behavior when connecting smart wallet where it sometimes does not add the personal wallet in the list of connected wallets

  • #3637 02fff7d Thanks @joaquim-verges! - Loosen react native peer dep version restriction

5.34.0

Minor Changes

Patch Changes

  • #3602 21aaec8 Thanks @jnsdls! - improve

  • #3633 636fe40 Thanks @joaquim-verges! - Fix uploading files on mobile with directory

  • #3621 5470dd9 Thanks @MananTank! - Pay UI improvements

    • Only perform token amount rounding when rendering the amount - not in state
    • increase the rendered decimals for token amount whereever we have enough space available in UI
    • Fix "Minimum required amount" error message for Buy with fiat when token amount is so low that server calculates its value as 0 USD - which prevents calculation of minimum required token amount
    • Show token symbol in Minimum required amount error message
  • #3603 342d74e Thanks @jnsdls! - export JWT utils, fix naming of decodeJWT

  • #3611 f103a90 Thanks @MananTank! - Fix Transaction Button callbacks not called when tx is executed in Pay Modal

  • #3630 41b9a53 Thanks @MananTank! - Fix Search in Network Selector screen

5.33.0

Minor Changes

Patch Changes

  • #3597 34b9bbe Thanks @gregfromstl! - Fix wallet disconnect events not being emitted

  • #3608 2ab8b3c Thanks @MananTank! - Set selection data on wallet selection with no custom selection UI - This fixes UI bug in Connect wide modal that has both inApp and ecosystem wallets added

5.32.3

Patch Changes

5.32.2

Patch Changes

5.32.1

Patch Changes

5.32.0

Minor Changes

  • #3570 1a2e056 Thanks @joaquim-verges! - ConnectButton and ConnectEmbed components for React Native

    ConnectButton and ConnectEmbed components for React Native

    Same behavior as the web, you can use these prebuilt components to quickly provide wallet connection flows to your users.

    You can use it the same way as you would in the web, with the same supported properties and configuration flags.

    import { ConnectButton } from "thirdweb/react";
    
    <ConnectButton
        client={client}
    />
    

    and same for ConnectEmbed

    import { ConnectEmbed } from "thirdweb/react";
    
    <ConnectEmbed
        client={client}
    />
    

Patch Changes

  • #3574 f526d73 Thanks @MananTank! - * Fix broken inApp wallet connection flow in Compact size Connect UI

    • Fix missing back button in inApp wallet connection flow in Compact size Connect UI
  • #3575 5953131 Thanks @MananTank! - Reset wallet selection data on wallet selection

  • #3569 e5f772d Thanks @edwardysun! - Support localhost as a domain override option for the Pay service

5.31.1

Patch Changes

5.31.0

Minor Changes

Patch Changes

5.30.0

Minor Changes

  • #3451 2244631 Thanks @gregfromstl! - Adds getTransactionStore to retrieve a transaction store for a given address

  • #3381 6429acc Thanks @gregfromstl! - Adds support for Dawn wallet

  • #3270 b24e9b2 Thanks @gregfromstl! - Adds ecosystemWallet to TS SDK

    Usage

    import { ecosystemWallet } from "thirdweb/wallets";
    
    const wallet = ecosystemWallet("ecosystem.hooli", {
      partnerId: "pied-piper",
    });
    
  • #3428 fab5cd4 Thanks @jnsdls! - Adds watchAsset support in injected wallet accounts

  • #3428 fab5cd4 Thanks @jnsdls! - - Add purchaseData parameter in getBuyWithFiatQuote and getBuyWithCryptoQuote functions and UI components to store Extra details for the purchase which can be retrieved later via the status API or Webhook

    • Add a required fromAddress parameter in getBuyWithFiatQuote
  • #3429 a3a4008 Thanks @gregfromstl! - Adds WalletConnect disconnect screen

  • #3428 fab5cd4 Thanks @jnsdls! - Added onDisconnect option in useWalletDetailsModal's open method to add a callback when the user disconnects the wallet by clicking the disconnect button in the wallet details modal.

    import { useWalletDetailsModal } from "thirdweb/react";
    
    function Example() {
      const detailsModal = useWalletDetailsModal();
    
      return (
        <button
          onClick={() => {
            detailsModal.open({
              client,
              onDisconnect: ({ wallet, account }) => {
                console.log("disconnected", wallet, account);
              },
            });
          }}
        >
          Show wallet details
        </button>
      );
    }
    

    onDisconnect prop of ConnectButton now gets called with the disconnected wallet and account as arguments

    <ConnectButton
      onDisconnect={({ wallet, account }) => {
        console.log("disconnected", wallet, account);
      }}
    />
    
  • #3270 b24e9b2 Thanks @gregfromstl! - Adds ecosystem wallet UI

Patch Changes

5.29.6

Patch Changes

5.29.5

Patch Changes

5.29.4

Patch Changes

5.29.3

Patch Changes

5.29.2

Patch Changes

5.29.1

Patch Changes

5.29.0

Minor Changes

  • #3273 7afd2da Thanks @gregfromstl! - Adds options refetchInterval and retry params to useReadContract

  • #3231 dbf74aa Thanks @joaquim-verges! - TransactionButton react native implementation

  • #3271 3a1fd98 Thanks @joaquim-verges! - Align inAppWallet secret sharing implementation with web and previous RN SDK

  • #3229 e7b9b9f Thanks @MananTank! - Add useWalletDetailsModal hook to open Wallet Details Modal without using <ConnectButton /> component

    import { createThirdwebClient } from "thirdweb";
    import { useWalletDetailsModal } from "thirdweb/react";
    
    const client = createThirdwebClient({
      clientId: "<your_client_id>",
    });
    
    function Example() {
      const { open } = useWalletDetailsModal();
    
      function handleClick() {
        open({ client, theme: "light" });
      }
    
      return <button onClick={handleClick}> Show Wallet Details </button>;
    }
    

Patch Changes

  • #3278 5698b0c Thanks @0xFirekeeper! - [v4 & v5] zkCandy Sepolia AA Support

  • #3263 f2004b5 Thanks @gregfromstl! - Add potential error message for eip155 failure

  • #3266 e763ace Thanks @joaquim-verges! - Fix sign typed data with inAppWallet when the domain contains a salt param

  • #3264 3948f43 Thanks @MananTank! - - Remove the feature that sets another connected wallet as active when disconnecting the current active wallet.

    • Do not save personal wallet as a separate wallet in connected wallets list.
  • #3256 923a5ec Thanks @gregfromstl! - Automatic retries on watchContractEvents

  • #3280 7dec4d0 Thanks @MananTank! - Fix in-app wallet sending another verification code on window focus when using ConnectEmbed.

    Fix the underlying issue of useAutoConnect running again on window focus.

    Add refetchOnWindowFocus: false on few more useQuery instances to avoid unnecessary refetches

  • #3235 824a631 Thanks @gregfromstl! - Adds EIP-5792 hook exports to thirdweb/react

  • #3241 37ec4ca Thanks @jnsdls! - fix ipfs resolveScheme bug for v1 ipfs schemes

  • #3240 d488223 Thanks @MananTank! - Fix custom theme not used in ConnectEmbed loading screen

  • #3251 ce45a79 Thanks @MananTank! - Allow selecting fiat currency in Pay UI

5.28.0

Minor Changes

  • #3198 ca31a6c Thanks @gregfromstl! - Exports toSerializableTransaction to convert preparedTransaction into a fully serializable transaction. Exports estimateGasCost to estimate the gas cost of a transaction in ether and wei. Exports getGasPrice to get the currect gas price for a chain.

    toSerializableTransaction

    import { prepareTransaction, toSerializableTransaction } from "thirdweb";
    
    const transaction = await prepareTransaction({
      transaction: {
        to: "0x...",
        value: 100,
      },
    });
    const serializableTransaction = await toSerializableTransaction({
      transaction,
    });
    
    account.sendTransaction(serializableTransaction);
    

    estimateGasCost

    import { estimateGasCost } from "thirdweb";
    
    const gasCost = await estimateGasCost({ transaction });
    

    getGasPrice

    import { getGasPrice } from "thirdweb";
    
    const gasPrice = await getGasPrice({ client, chain });
    

Patch Changes

5.27.0

Minor Changes

  • #3181 a346111 Thanks @gregfromstl! - Adds headless functions for creating and managing a WalletConnect session with a connected wallet

    createWalletConnectClient

    import { createWalletConnectClient } from "thirdweb/wallets/wallet-connect";
    
    createWalletConnectClient({
      client: client,
      wallet: wallet,
      onConnect: (session: any) => {
        alert("Connected");
      },
      onDisconnect: (session: any) => {
        alert("Disconnected");
      },
    });
    

    createWalletConnectSession

    import { createWalletConnectSession } from "thirdweb/wallets/wallet-connect";
    
    createWalletConnectSession({
      walletConnectClient: wcClient,
      uri: "wc:...",
    });
    

    getWalletConnectSessions

    import {
      getWalletConnectSession,
      type WalletConnectSession,
    } from "thirdweb/wallets/wallet-connect";
    
    const sessions: WalletConnectSession[] = await getWalletConnectSessions();
    

    disconnectWalletConnectClient

    import { disconnectWalletConnectClient } from "thirdweb/wallets/wallet-connect";
    
    disconnectWalletConnectClient({ session, walletConnectClient: wcClient });
    
  • #3105 51e7ada Thanks @joaquim-verges! - First party support for zkSync native account abstraction

    You can now use smart accounts on zkSync and zkSync sepolia without any extra setup.

    const wallet = smartWallet({
      chain: zkSync,
      sponsorGas: true,
    });
    
    const smartAccount = await wallet.connect({
      client,
      personalAccount,
    });
    
    // now your can perform transactions normally, gas will be sponsored
    sendTransaction({ transaction, account: smartAccount });
    
  • #3105 51e7ada Thanks @joaquim-verges! - ZkSync transaction support

Patch Changes

5.26.0

Minor Changes

  • #3161 b569eb4 Thanks @gregfromstl! - Adds waitForBundle function to await a sendCalls bundle's complete confirmation.

    Usage

    import { waitForBundle } from "thirdweb/wallets/eip5792";
    const result = await waitForBundle({
      client,
      chain,
      wallet,
      bundleId: "0x123...",
    });
    
  • #3161 b569eb4 Thanks @gregfromstl! - Adds EIP-5792 react hooks

    useSendCalls

    useSendCalls will automatically revalidate all reads from contracts that are interacted with.

    import { useSendCalls } from "thirdweb/react";
    
    const sendTx1 = approve({
      contract: USDT_CONTRACT,
      amount: 100,
      spender: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6",
    });
    const sendTx2 = approve({
      contract: USDT_CONTRACT,
      amount: 100,
      spender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
    });
    const { mutate: sendCalls, data: bundleId } = useSendCalls({ client });
    await sendCalls({
      wallet,
      client,
      calls: [sendTx1, sendTx2],
    });
    

    Await the bundle's full confirmation:

    const { mutate: sendCalls, data: bundleId } = useSendCalls({
      client,
      waitForResult: true,
    });
    await sendCalls({
      wallet,
      client,
      calls: [sendTx1, sendTx2],
    });
    

    Sponsor transactions with a paymaster:

    const { mutate: sendCalls, data: bundleId } = useSendCalls();
    await sendCalls({
      client,
      calls: [sendTx1, sendTx2],
      capabilities: {
        paymasterService: {
          url: `https://${CHAIN.id}.bundler.thirdweb.com/${client.clientId}`,
        },
      },
    });
    

    useCapabilities

    import { useCapabilities } from "thirdweb/react";
    const { data: capabilities, isLoading } = useCapabilities();
    

    useCallsStatus

    import { useCallsStatus } from "thirdweb/react";
    const { data: status, isLoading } = useCallsStatus({ bundleId, client });
    

Patch Changes

5.25.1

Patch Changes

5.25.0

Minor Changes

  • #3140 fc1b658 Thanks @gregfromstl! - Show in-app wallet users an option to export their private key. Enabled by default.

    Usage

    To hide the private key export:

    import { inAppWallet } from "thirdweb/wallets";
    const wallet = inAppWallet({
      hidePrivateKeyExport: true,
    });
    
  • #3154 99d11bb Thanks @gregfromstl! - Adds the ability to copy the wallet connect connection link as an alternative to scanning the QR code

  • #3150 9c417d9 Thanks @gregfromstl! - Adds onDisconnect callback to connect button

    Usage

    <ConnectButton
      client={THIRDWEB_CLIENT}
      onDisconnect={() => console.log("disconnect")}
      theme={theme === "light" ? "light" : "dark"}
    />
    

Patch Changes

5.24.0

Minor Changes

  • #2943 2774d1f Thanks @MananTank! - Added useConnectModal hook.

    Add useConnectModal hook that allows you to open the Connect UI in a Modal to prompt the user to connect wallet.

    import { createThirdwebClient } from "thirdweb";
    import { useConnectModal } from "thirdweb/react";
    
    const client = createThirdwebClient({
      clientId: "<your_client_id>",
    });
    
    function Example() {
      const { connect, isConnecting } = useConnectModal();
    
      async function handleConnect() {
        const wallet = await connect({ client }); // opens the connect modal
        console.log("connected to", wallet);
      }
    
      return <button onClick={handleConnect}> Connect </button>;
    }
    
  • #3127 5031e44 Thanks @gregfromstl! - Adds contract extensions for delayed reveal NFTs

  • #3118 546d2db Thanks @gregfromstl! - Adds React Native to the thirdweb create CLI

  • #3126 764bce2 Thanks @joaquim-verges! - WalletConnect in React Native + useAutoConnect hook

    Support WalletConnect compatible wallets in React Native

    You can now connect any of the 300+ WalletConnect compatible mobile wallets from react native.

    import { useConnect } from "thirdweb/react";
    import { createWallet } from "thirdweb/wallets";
    
    const { connect, isConnecting } = useConnect();
    
    const connectMetamask = async () => {
      await connect(async () => {
        const wallet = createWallet("io.metamask");
        await wallet.connect({
          client,
          chain,
        });
        return wallet;
      });
    };
    

    Exposed useAutoConnect hook

    You can now use a hook to trigger autoconnecting to the last connected wallet

    import { useAutoConnect } from "thirdweb/react";
    
    const { data: autoConnected, isLoading } = useAutoConnect({
      client,
      accountAbstraction,
      wallets,
      onConnect,
      timeout,
    });
    
  • #3125 c3a92bf Thanks @gregfromstl! - Added useWalletBalance() hook

    Adds the useWalletBalance hook. The hook will default to the native token balance if no tokenAddress is provided.

    Usage

    import { useWalletBalance } from "thirdweb/react";
    
    const { data, isLoading, isError } = useWalletBalance({
      chain: walletChain,
      tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      address: activeAccount?.address,
      client,
    });
    

Patch Changes

5.23.0

Minor Changes

  • #3103 a2275c4 Thanks @gregfromstl! - Adds unstyled prop to TransactionButton to remove default styles

    <TransactionButton
      transaction={() => {}}
      onSuccess={handleSuccess}
      onError={handleError}
      unstyled
      className="bg-white text-black rounded-md p-4 flex items-center justify-center"
    >
      Confirm Transaction
    </TransactionButton>
    
  • #3083 5994685 Thanks @MananTank! - Add support for deep-linking to Metamask app instead of using WalletConnect on mobile devices when using Connect UI (ConnectButton / ConnectEmbed) components.

    <ConnectButton
      client={client}
      wallets={[
        createWallet("io.metamask", {
          preferDeepLink: true,
        }),
      ]}
    />
    
  • #3064 f55fa4c Thanks @joaquim-verges! - In-app wallet support for react native

Patch Changes

5.22.1

Patch Changes

5.22.0

Minor Changes

  • #3001 726618b Thanks @gregfromstl! - Adds basic EIP-5792 support for wallets with functions getCapabilities, sendCalls, showCallsStatus, getCallsStatus.

    Example Usage

    getCapabilities

    Returns the capabilities of the wallet according to EIP-5792.

    import { getCapabilities } from "thirdweb/wallets/eip5792";
    
    const capabilities = await getCapabilities({ wallet });
    

    sendCalls

    Sends the given calls to the wallet for execution, and attempts to fallback to normal execution if the wallet does not support EIP-5792.

    import { sendCalls } from "thirdweb/wallets/eip5792";
    
    const transfer1 = transfer({
      contract: USDC_CONTRACT,
      amount: 5000,
      to: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6",
    });
    
    const transfer2 = transfer({
      contract: USDT_CONTRACT,
      amount: 1000,
      to: "0x33d9B8BEfE81027E2C859EDc84F5636cbb202Ed6",
    });
    
    const bundleId = await sendCalls({
      wallet,
      client,
      calls: [transfer1, transfer2],
    });
    

    showCallsStatus

    Requests the wallet to show the status of a given bundle ID.

    import { showCallsStatus } from "thirdweb/wallets/eip5792";
    
    await showCallsStatus({ wallet, bundleId });
    

    getCallsStatus

    Returns the status of the given bundle ID and the transaction receipts if completed.

    import { getCallsStatus } from "thirdweb/wallets/eip5792";
    
    const status = await getCallsStatus({ wallet, bundleId });
    

Patch Changes

5.21.0

Minor Changes

  • #3034 99fa2da Thanks @gregfromstl! - Adds the ability to set a custom logo for the social login modal

    import { inAppWallet } from "thirdweb/wallets";
    const wallet = inAppWallet({
      metadata: {
        image: {
          src: "https://example.com/logo.png",
          alt: "My logo",
          width: 100,
          height: 100,
        },
      },
    });
    

Patch Changes

5.20.0

Minor Changes

  • #2912 9caa9d7 Thanks @joaquim-verges! - Updated Connect Modal UI + Passkey support

    • Passkey is now an auth option for inAppWallet
    • Connect UI component UI refresh
    const wallet = inAppWallet();
    const hasPasskey = await hasStoredPasskey(client);
    await wallet.connect({
      client,
      strategy: "passkey",
      type: hasPasskey ? "sign-in" : "sign-up",
    });
    
  • #3018 5083464 Thanks @gregfromstl! - Adds support for Core wallet extension

Patch Changes

5.19.1

Patch Changes

  • #3005 0006e54 Thanks @joaquim-verges! - - useSendTransaction now switches chain if needed
    • Fix chain switching with in-app smart accounts
    • Fix tx simulation for pay modal

5.19.0

Minor Changes

Patch Changes

5.18.1

Patch Changes

5.18.0

Minor Changes

  • #2985 55081d8 Thanks @jnsdls! - ### "Credit Card" payment method added in thirdweb Pay for Fiat on-ramp

    PayEmbed component added to embed thirdweb Pay UI

    <PayEmbed
      client={client}
      style={{
        width: "360px",
      }}
    />
    

    thirdweb Pay UI customization available in PayEmbed and ConnectButton

    payOptions prop in PayEmbed and ConnectButton > detailsModal allows you custimize :

    • Enable/Disable payment methods
    • Set default amount for Buy token
    • Set Buy token/chain to be selected by default
    • Set Source token/chain to be selected by default for Crypto payment method
    • Disable editing for Buy token/chain/amount and Source token/chain
    <ConnectButton
      client={client}
      detailsModal={{
        payOptions: yourOptions,
      }}
    />
    
    <PayEmbed
      client={client}
      detailsModal={{
        payOptions: yourOptions,
      }}
    />
    

    Fiat on-ramp functions and hooks added

    • getBuyWithFiatQuote, useBuyWithFiatQuote to get a quote for buying crypto with fiat currency
    • getBuyWithFiatStatus, useBuyWithFiatStatus to get status of "Buy with fiat" transaction
    • getBuyWithFiatHistory, useBuyWithFiatHistory to get "Buy with fiat" transaction history
    • getPostOnRampQuote, usePostOnRampQuote to get quote for swapping on-ramp token to destination token after doing on-ramp
    • Add getBuyHistory and useBuyHistory to get both "Buy with Fiat" and "Buy with Crypto" transaction history in a single list

5.17.0

Minor Changes

  • #2931 24c1670 Thanks @joaquim-verges! - New smartAccount prop for inAppWallet()

    You can now convert an inAppWallet to a smart account simply by passing the smartAccount prop.

    const wallet = inAppWallet({
      smartAccount: {
        chain: sepolia,
        sponsorGas: true,
      },
    });
    
    await wallet.connect({
      client,
      strategy: "google",
    });
    

    Note: beware that when toggling this flag on and off, you will get a different address (admin EOA vs smart account).

Patch Changes

  • #2959 3377fc9 Thanks @MananTank! - Fix custom details button not opening the details modal in ConnectButton

  • #2955 fd1bd7e Thanks @kien-ngo! - Add resolve method for Arweave URIs

  • #2950 d4808fd Thanks @gregfromstl! - Export getUserPhoneNumber and getAuthenticatedUser in-app wallet functions

  • #2972 b1ca05e Thanks @gregfromstl! - Fix issue with nonce set to 0 on toSerializableTransaction

  • #2966 4de8802 Thanks @gregfromstl! - Fixes issue with contract compilation in hardhat

  • #2962 5b6b241 Thanks @gregfromstl! - Makes multiple bugfixes on the deployPublishedContract code path

    • Contracts with no constructor can now deploy as abi inputs defaults to [] when encoding the parameters
    • Properly finds contract versions when specified
    • Defaults to standard deployment if no deployType is specified
  • #2965 ae10776 Thanks @kien-ngo! - Add Arweave URI support to

  • #2969 d660b6c Thanks @gregfromstl! - Fixes deterministic deploys of contracts with no constructor

  • #2958 02a0ca9 Thanks @gregfromstl! - Fixes inconsistent block numbers when fetching events.

    getContractEvents will now properly handle blockRange interaction with fromBlock and toBlock given they are both inclusive (i.e. it will only return logs for the number of blocks specified in blockRange).

5.16.1

Patch Changes

  • #2936 a692154 Thanks @MananTank! - Fix OTP input entered by by clicking on “from messages” option in iOS safari

  • #2934 bdb919f Thanks @gregfromstl! - Updates the CLI create command to use the v5 templates for Next.js and Vite

    Other templates will be updated in the future from within their existing repositories

    Removes React Native starters from the CLI menu Removes JS template support from the CLI

  • #2941 795a59e Thanks @gregfromstl! - Can now optionally specify blockRange on getContractEvents in combination with toBlock and fromBlock.

    Usage

    Specify a blockRange, defaulting toBlock to the current block number.

    await getContractEvents({
      contract: myContract,
      blockRange: 123456n,
      events: [preparedEvent, preparedEvent2],
    });
    

    Specify a block range with toBlock.

    await getContractEvents({
      contract: myContract,
      toBlock: endBlock,
      blockRange: 123456n,
      events: [preparedEvent, preparedEvent2],
    });
    

    Specify a block range starting from fromBlock (great for pagination).

    await getContractEvents({
      contract: myContract,
      fromBlock: lastBlockFetched,
      blockRange: 123456n,
      events: [preparedEvent, preparedEvent2],
    });
    
  • #2945 b64c8e7 Thanks @gregfromstl! - Removes deprecated template options from the CLI, specifically PWA Vite, Express, and React

  • #2951 49d4494 Thanks @gregfromstl! - Increase gas on MarketplaceV3 writes

  • #2948 44680c6 Thanks @gregfromstl! - Adds extraGas override to transactions. Useful when gas estimates are faulty or to ensure a transaction goes through.

    Usage

    const transaction = prepareTransaction({
      to: "0x1234567890123456789012345678901234567890",
      chain: ethereum,
      client: thirdwebClient,
      value: toWei("1.0"),
      gasPrice: 30n,
      extraGas: 50_000n,
    });
    
  • #2932 86105c9 Thanks @gregfromstl! - TransactionButton throws error on reverted transaction

  • #2946 ec149f3 Thanks @gregfromstl! - Read RPC url from viem chain in viem chain adapter

  • #2928 cea736c Thanks @gregfromstl! - Filters invalid listings and auctions from marketplace

  • #2949 0e19911 Thanks @kien-ngo! - Docs update: fix typos and add code snippet

  • #2944 82e8911 Thanks @joaquim-verges! - Show auth provider icon in connect UI when connected to in app wallet

  • #2933 8e0a3ce Thanks @MananTank! - ### Integrate Pay Modal with TransactionButton

    By default, the Pay Modal is integrated with the TransactionButton component. If the user performs a transaction and does not have enough funds to execute it and if thirdweb pay is available for that blockchain, the Pay Modal will be displayed to allow user to buy the required amount of tokens

    A new prop payModal is added to the TransactionButton component customize the Pay Modal UI or disable it entirely

    Example: Disable Pay Modal

    <TransactionButton payModal={false}> Example 1 </TransactionButton>
    

    Example: Customize Pay Modal UI

    <TransactionButton
      payModal={{
        theme: "light",
      }}
    >
      Example 2
    </TransactionButton>
    

    Disable Pay Modal for certain configurations in useSendTransaction hook

    If useSendTransaction hook is passed gasless: true configuration or if current active wallet is a smart wallet with sponsorGas: true configuration - the Pay Modal will be disabled

  • #2929 9f817cf Thanks @joaquim-verges! - Tweaked connected modal UI layout

5.16.0

Minor Changes

  • #2917 5b0c37a Thanks @joaquim-verges! - Factory address is now optional in accountAbstraction and smartWallet options.

    • Defaults to a global permissionless factory deployed on all chains.
    • Also enables switching chains for smart wallets, as long as the factory is deployed
  • #2915 664082e Thanks @joaquim-verges! - New prepareDeterministicDeployTransaction extension for deploying published contracts with the same address on multiple chains

  • #2921 d77b6f6 Thanks @gregfromstl! - Adds the 'use client' directive to all client-only components

  • #2919 47de345 Thanks @jnsdls! - Add support for several additional wallets

Patch Changes

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