Releases: thirdweb-dev/js
[email protected]
Patch Changes
-
#5688
da5d8ec
Thanks @joaquim-verges! - Autoconnect previously linked wallets -
#5682
5b24faf
Thanks @gregfromstl! - Fix ecosystem wallet AA detection in Pay modal -
#5674
8020bdb
Thanks @devfelipenunes! - This pull request adds the complete Portuguese (Brazil) translation for the wallet connection module. It includes translations for connecting a wallet, sending/receiving funds, network management, and other wallet-related actions. This improves the user experience for Portuguese-speaking users.
[email protected]
Minor Changes
-
#5533
43fbcac
Thanks @kien-ngo! - The Connected-details button now shows USD value next to the token balance.Breaking change to the AccountBalance
The formatFn props now takes in an object of type
AccountBalanceInfo
. The oldformatFn
was inflexible because it only allowed you to format the balance value.
With this new version, you have access to both the balance and symbol.import { AccountBalance, type AccountBalanceInfo } from "thirdweb/react"; <AccountBalance // Show the symbol in lowercase, before the balance formatFn={(props: AccountBalanceInfo) => `${props.symbol.toLowerCase()} ${props.balance}` } />;
AccountBalance now supports showing the token balance in fiat value (only USD supported at the moment)
<AccountBalance showBalanceInFiat="USD" />
The
formatFn
prop now takes in an object of typeAccountBalanceInfo
and outputs a stringimport { AccountBalance, type AccountBalanceInfo } from "thirdweb/react"; <AccountBalance formatFn={(props: AccountBalanceInfo) => `${props.balance}---${props.symbol.toLowerCase()}` } />; // Result: 11.12---eth
ConnectButton also supports displaying balance in fiat since it uses AccountBalance internally
<ConnectButton // Show USD value on the button detailsButton={{ showBalanceInFiat: "USD", }} // Show USD value on the modal detailsModal={{ showBalanceInFiat: "USD", }} />
Export utils functions:
formatNumber: Round up a number to a certain decimal place
import { formatNumber } from "thirdweb/utils"; const value = formatNumber(12.1214141, 1); // 12.1
shortenLargeNumber: Shorten the string for large value. Mainly used for the AccountBalance's
formatFn
import { shortenLargeNumber } from "thirdweb/utils"; const numStr = shortenLargeNumber(1_000_000_000);
Fix to ConnectButton
The social image of the Details button now display correctly for non-square image.
Massive test coverage improvement for the Connected-button components
-
#5655
f69d1aa
Thanks @kien-ngo! - Improve NFT Components- Add custom resolver methods to NFTMedia, NFTName and NFTDescription
- Add caching for the NFT-info-getter method to improve performance
- Small fix to handle falsy values for NFT media src, name and description
- Improve test coverage by extracting internal logics and testing them
Patch Changes
-
#5660
d5a68c8
Thanks @gregfromstl! - Fix: Correctly cleans the "Custom Auth" profile type label -
#5672
3b53732
Thanks @gregfromstl! - Fix ox hardset version -
#5653
df734ba
Thanks @joaquim-verges! - More helpful error messages for enclave and userop errors -
#5656
f680496
Thanks @joaquim-verges! - Fix connecting to cb wallet browser extension when already on the same chain -
#5671
dcd5822
Thanks @joaquim-verges! - Allow signature minting for LoyaltyCard contracts by passing the contractType -
#5673
c55f02f
Thanks @ElasticBottle! - always include gas price information even if it's 0 for enclave wallets -
#5617
c48e0c9
Thanks @gregfromstl! - Fix: Disconnect smart account when account signer is disconnected -
#5668
485dcc6
Thanks @joaquim-verges! - Fix add chain not triggering for certain wallets
@thirdweb-dev/[email protected]
Patch Changes
- #5670
e702490
Thanks @arcoraven! - Add modelName, sessionId, requestId to usage
[email protected]
Minor Changes
- #5598
16e5347
Thanks @gregfromstl! - Update underlying APIs to use Ox for transaction serialization
Patch Changes
-
#5639
ed0886a
Thanks @jnsdls! - default account components to not retry on failure -
#5640
5070e76
Thanks @jnsdls! - acceptreact 19
as peer explicitly -
#5487
5574c15
Thanks @joaquim-verges! - BETA support for 7579 modular smart accountsYou can now create modular smart wallets using the 7579 preset.
Keep in mind that this is in BETA, and there might be breaking API changes.
import { sepolia } from "thirdweb/chains"; import { smartWallet, Config } from "thirdweb/wallets/smart"; const modularSmartWallet = smartWallet( Config.erc7579({ chain: sepolia, sponsorGas: true, factoryAddress: "0x...", // the 7579 factory address validatorAddress: "0x...", // the default validator module address }), });
-
#5630
0aa2416
Thanks @kien-ngo! - Add erc20Value to buyFromListing transaction -
#5641
d1716fc
Thanks @joaquim-verges! - Support ERC6492 for smart account signatures
[email protected]
Minor Changes
-
#5634
d1aa380
Thanks @joaquim-verges! - ERC20 Token Paymaster supportYou can now use ERC20 Token Paymasters with Smart Wallets.
import { base } from "thirdweb/chains"; import { TokenPaymaster, smartWallet } from "thirdweb/wallets"; const wallet = smartWallet({ chain: base, sponsorGas: true, // only sponsor gas for the first ERC20 approval overrides: { tokenPaymaster: TokenPaymaster.BASE_USDC, }, });
Patch Changes
-
#5593
68ad62f
Thanks @ElasticBottle! - updatetype
ingetUser
Profiles
to match tyepscript types -
#5621
279cb6f
Thanks @gregfromstl! - Feature: Propagate failed sign in error message to the UI -
#5596
c893239
Thanks @ElasticBottle! - add fallback chain for ecosystem smart accounts -
#5620
13d63ab
Thanks @gregfromstl! - Fix: Hides Sign in with Wallet button when linking a profile -
#5618
33c23e7
Thanks @gregfromstl! - Fix: Removed the auth prop from useConnectModal as it is currently not supported
[email protected]
Minor Changes
-
#5457
57fa96b
Thanks @kien-ngo! - Add 2 new Pay functions: convertFiatToCrypto and convertCryptoToFiatExamples:
Convert fiat (USD) to crypto
import { convertFiatToCrypto } from "thirdweb/pay"; import { ethereum } from "thirdweb/chains"; // Convert 2 cents to ETH const result = await convertFiatToCrypto({ from: "USD", // the token address. For native token, use NATIVE_TOKEN_ADDRESS to: "0x...", // the chain (of the chain where the token belong to) chain: ethereum, // 2 cents fromAmount: 0.02, }); // Result: 0.0000057 (a number)
Convert crypto to fiat (USD)
import { convertCryptoToFiat } from "thirdweb/pay"; // Get Ethereum price const result = convertCryptoToFiat({ fromTokenAddress: NATIVE_TOKEN_ADDRESS, to: "USD", chain: ethereum, fromAmount: 1, }); // Result: 3404.11 (number)
Patch Changes
-
#5594
b7c8854
Thanks @joaquim-verges! - Support for Expo 52 and React Native 0.76 -
#5595
9b45aae
Thanks @ElasticBottle! - Display error message when failing to fetch account status from endpoint outside of unauthorized requests -
#5592
c3d7b66
Thanks @gregfromstl! - Properly updates active smart wallet when switching signer account on EOA wallet -
#5577
b117cb1
Thanks @joaquim-verges! - Show warning when sponsorship policy rejects a transaction -
#5531
1e9a6c7
Thanks @joaquim-verges! - Handle 0 value for maxPriorityFeePerGas in 712 transactions
@thirdweb-dev/[email protected]
Patch Changes
- #5594
b7c8854
Thanks @joaquim-verges! - Support for Expo 52 and React Native 0.76
[email protected]
Minor Changes
-
#5495
d1845f3
Thanks @kien-ngo! - Add headless components: ChainProvider, ChainIcon & ChainName -
#5529
7488102
Thanks @gregfromstl! - Adds LoyaltyCard extensions and support for ERC721 deployment.import { deployERC721Contract } from "thirdweb/deploys"; const loyaltyCardContractAddress = await deployERC721Contract({ chain: "your-chain-id", // replace with your chain ID client: yourThirdwebClient, // replace with your Thirdweb client instance account: yourAccount, // replace with your account details type: "LoyaltyCard", params: { name: "MyLoyaltyCard", symbol: "LOYAL", description: "A loyalty card NFT contract", image: "path/to/image.png", // replace with your image path defaultAdmin: "0xYourAdminAddress", // replace with your admin address royaltyRecipient: "0xYourRoyaltyRecipient", // replace with your royalty recipient address royaltyBps: 500n, // 5% royalty trustedForwarders: ["0xTrustedForwarderAddress"], // replace with your trusted forwarder addresses saleRecipient: "0xYourSaleRecipient", // replace with your sale recipient address platformFeeBps: 200n, // 2% platform fee platformFeeRecipient: "0xYourPlatformFeeRecipient", // replace with your platform fee recipient address }, });
Patch Changes
@thirdweb-dev/[email protected]
Patch Changes
- #5542
8aa454c
Thanks @arcoraven! - feat: add promptTokens and completionTokens fields to usage
[email protected]
Minor Changes
-
#5501
ac42c45
Thanks @gregfromstl! - Added new deployment utility functions to help manage infrastructure contracts and initialization:getInitializeTransaction
: Prepare initialization transaction for contract deploymentgetOrDeployInfraForPublishedContract
: Get or deploy required infrastructure for published contracts
import { getInitializeTransaction, getOrDeployInfraForPublishedContract, } from "thirdweb"; // Get initialization transaction const initTx = await getInitializeTransaction({ client, chain, account, implementationContract, deployMetadata, initializeParams: { name: "My Contract", symbol: "CNTRCT", }, }); // Get or deploy infrastructure const infra = await getOrDeployInfraForPublishedContract({ chain, client, account, contractId: "MyContract", constructorParams: params, });