Skip to content

Commit fd94e47

Browse files
Version Packages
1 parent f680496 commit fd94e47

File tree

6 files changed

+88
-83
lines changed

6 files changed

+88
-83
lines changed

.changeset/curly-cycles-hammer.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/dirty-goats-invent.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fair-plants-pretend.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

.changeset/strong-meals-remain.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/thirdweb/CHANGELOG.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,92 @@
11
# thirdweb
22

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+
### Patch Changes
83+
84+
- [#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
85+
86+
- [#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
87+
88+
- [#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
89+
390
## 5.75.0
491

592
### Minor Changes

packages/thirdweb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thirdweb",
3-
"version": "5.75.0",
3+
"version": "5.76.0",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/thirdweb-dev/js.git#main"

0 commit comments

Comments
 (0)