Skip to content

thirdweb@5.97.0

Compare
Choose a tag to compare
@joaquim-verges joaquim-verges released this 06 May 07:04
· 481 commits to main since this release
dfa3ee0

Minor Changes

  • #6956 08cff4b Thanks @gregfromstl! - feat(bridge): Add chains endpoint to retrieve Universal Bridge supported chains

    import { Bridge } from "thirdweb";
    
    const chains = await Bridge.chains({
      client: thirdwebClient,
    });

    Returned chains include chain information such as chainId, name, icon, and nativeCurrency details.

Patch Changes

  • #6953 736c3f8 Thanks @gregfromstl! - Adds the maxSteps option to Buy.quote, Buy.prepare, Sell.quote, and Sell.prepare functions. This allows users to limit quotes to routes with a specific number of steps or fewer. For example:

    const quote = await bridge.Buy.quote({
      originChainId: 1,
      originTokenAddress: "0x...",
      destinationChainId: 137,
      destinationTokenAddress: "0x...",
      amount: 1000000n,
      maxSteps: 2,
    });
    
    const preparedQuote = await bridge.Buy.prepare({
      originChainId: 1,
      originTokenAddress: "0x...",
      destinationChainId: 137,
      destinationTokenAddress: "0x...",
      amount: 1000000n,
      sender: "0x...",
      receiver: "0x...",
      maxSteps: 2,
    });
    
    const quote = await bridge.Sell.quote({
      originChainId: 1,
      originTokenAddress: "0x...",
      destinationChainId: 137,
      destinationTokenAddress: "0x...",
      amount: 1000000n,
      maxSteps: 3,
    });
    
    const preparedQuote = await bridge.Sell.prepare({
      originChainId: 1,
      originTokenAddress: "0x...",
      destinationChainId: 137,
      destinationTokenAddress: "0x...",
      amount: 1000000n,
      sender: "0x...",
      receiver: "0x...",
      maxSteps: 3,
    });
  • #6952 055e451 Thanks @gregfromstl! - +Deprecate legacy Pay functions

  • #6955 6dd2b09 Thanks @gregfromstl! - Added the sortBy option to Bridge.routes

    import { Bridge } from "thirdweb";
    
    const routes = await Bridge.routes({
      originChainId: 1,
      originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
      limit: 10,
      offset: 0,
      sortBy: "popularity",
      client: thirdwebClient,
    });
  • #6900 e9d0b6e Thanks @MananTank! - Only attempt autoconnect once