|
1 | 1 | # thirdweb
|
2 | 2 |
|
| 3 | +## 5.76.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#5533](https://github.com/thirdweb-dev/js/pull/5533) [`43fbcac`](https://github.com/thirdweb-dev/js/commit/43fbcac25e9383743f1f42af9da7fe1c1eae12b4) Thanks [@kien-ngo](https://github.com/kien-ngo)! - The Connected-details button now shows USD value next to the token balance. |
| 8 | + |
| 9 | + ### Breaking change to the AccountBalance |
| 10 | + |
| 11 | + The formatFn props now takes in an object of type `AccountBalanceInfo`. The old `formatFn` was inflexible because it only allowed you to format the balance value. |
| 12 | + With this new version, you have access to both the balance and symbol. |
| 13 | + |
| 14 | + ```tsx |
| 15 | + import { AccountBalance, type AccountBalanceInfo } from "thirdweb/react"; |
| 16 | + |
| 17 | + <AccountBalance |
| 18 | + // Show the symbol in lowercase, before the balance |
| 19 | + formatFn={(props: AccountBalanceInfo) => |
| 20 | + `${props.symbol.toLowerCase()} ${props.balance}` |
| 21 | + } |
| 22 | + />; |
| 23 | + ``` |
| 24 | + |
| 25 | + AccountBalance now supports showing the token balance in fiat value (only USD supported at the moment) |
| 26 | + |
| 27 | + ```tsx |
| 28 | + <AccountBalance showBalanceInFiat="USD" /> |
| 29 | + ``` |
| 30 | + |
| 31 | + The `formatFn` prop now takes in an object of type `AccountBalanceInfo` and outputs a string |
| 32 | + |
| 33 | + ```tsx |
| 34 | + import { AccountBalance, type AccountBalanceInfo } from "thirdweb/react"; |
| 35 | + |
| 36 | + <AccountBalance |
| 37 | + formatFn={(props: AccountBalanceInfo) => |
| 38 | + `${props.balance}---${props.symbol.toLowerCase()}` |
| 39 | + } |
| 40 | + />; |
| 41 | + |
| 42 | + // Result: 11.12---eth |
| 43 | + ``` |
| 44 | + |
| 45 | + ### ConnectButton also supports displaying balance in fiat since it uses AccountBalance internally |
| 46 | + |
| 47 | + ```tsx |
| 48 | + <ConnectButton |
| 49 | + // Show USD value on the button |
| 50 | + detailsButton={{ |
| 51 | + showBalanceInFiat: "USD", |
| 52 | + }} |
| 53 | + // Show USD value on the modal |
| 54 | + detailsModal={{ |
| 55 | + showBalanceInFiat: "USD", |
| 56 | + }} |
| 57 | + /> |
| 58 | + ``` |
| 59 | + |
| 60 | + ### Export utils functions: |
| 61 | + |
| 62 | + formatNumber: Round up a number to a certain decimal place |
| 63 | + |
| 64 | + ```tsx |
| 65 | + import { formatNumber } from "thirdweb/utils"; |
| 66 | + const value = formatNumber(12.1214141, 1); // 12.1 |
| 67 | + ``` |
| 68 | + |
| 69 | + shortenLargeNumber: Shorten the string for large value. Mainly used for the AccountBalance's `formatFn` |
| 70 | + |
| 71 | + ```tsx |
| 72 | + import { shortenLargeNumber } from "thirdweb/utils"; |
| 73 | + const numStr = shortenLargeNumber(1_000_000_000); |
| 74 | + ``` |
| 75 | + |
| 76 | + ### Fix to ConnectButton |
| 77 | + |
| 78 | + The social image of the Details button now display correctly for non-square image. |
| 79 | + |
| 80 | + ### Massive test coverage improvement for the Connected-button components |
| 81 | + |
| 82 | +- [#5655](https://github.com/thirdweb-dev/js/pull/5655) [`f69d1aa`](https://github.com/thirdweb-dev/js/commit/f69d1aad2d154a05ebc61a1d7545bd9e5aab17be) Thanks [@kien-ngo](https://github.com/kien-ngo)! - Improve NFT Components |
| 83 | + - Add custom resolver methods to NFTMedia, NFTName and NFTDescription |
| 84 | + - Add caching for the NFT-info-getter method to improve performance |
| 85 | + - Small fix to handle falsy values for NFT media src, name and description |
| 86 | + - Improve test coverage by extracting internal logics and testing them |
| 87 | + |
| 88 | +### Patch Changes |
| 89 | + |
| 90 | +- [#5660](https://github.com/thirdweb-dev/js/pull/5660) [`d5a68c8`](https://github.com/thirdweb-dev/js/commit/d5a68c85111809bf39e57f5fb39b5458c1f3fe9a) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Fix: Correctly cleans the "Custom Auth" profile type label |
| 91 | + |
| 92 | +- [#5672](https://github.com/thirdweb-dev/js/pull/5672) [`3b53732`](https://github.com/thirdweb-dev/js/commit/3b5373293202b8ff13cc1502bef3cc9dffaa5afa) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Fix ox hardset version |
| 93 | + |
| 94 | +- [#5653](https://github.com/thirdweb-dev/js/pull/5653) [`df734ba`](https://github.com/thirdweb-dev/js/commit/df734baf97ec2e976fedb124ecfbac7119c0bc5f) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - More helpful error messages for enclave and userop errors |
| 95 | + |
| 96 | +- [#5656](https://github.com/thirdweb-dev/js/pull/5656) [`f680496`](https://github.com/thirdweb-dev/js/commit/f680496ccb1c639fab644fb54e9a962627cf3228) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Fix connecting to cb wallet browser extension when already on the same chain |
| 97 | + |
| 98 | +- [#5671](https://github.com/thirdweb-dev/js/pull/5671) [`dcd5822`](https://github.com/thirdweb-dev/js/commit/dcd5822ee707fa52f1c3e02c75992485f83922f0) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Allow signature minting for LoyaltyCard contracts by passing the contractType |
| 99 | + |
| 100 | +- [#5673](https://github.com/thirdweb-dev/js/pull/5673) [`c55f02f`](https://github.com/thirdweb-dev/js/commit/c55f02fa75a7f8959bbe69eac6cebfc7927ed865) Thanks [@ElasticBottle](https://github.com/ElasticBottle)! - always include gas price information even if it's 0 for enclave wallets |
| 101 | + |
| 102 | +- [#5617](https://github.com/thirdweb-dev/js/pull/5617) [`c48e0c9`](https://github.com/thirdweb-dev/js/commit/c48e0c9320830aa69c0e9567d985ed8a94eeaaf1) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Fix: Disconnect smart account when account signer is disconnected |
| 103 | + |
| 104 | +- [#5668](https://github.com/thirdweb-dev/js/pull/5668) [`485dcc6`](https://github.com/thirdweb-dev/js/commit/485dcc6020089a80d994c24882f389c24a0af039) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Fix add chain not triggering for certain wallets |
| 105 | + |
3 | 106 | ## 5.75.0
|
4 | 107 |
|
5 | 108 | ### Minor Changes
|
|
0 commit comments