Releases: thirdweb-dev/js
[email protected]
Patch Changes
-
#8299
85fe949Thanks @alecananian! - [React Native] Fixed Send Funds screen not allowing decimal amounts -
#8296
e978809Thanks @MananTank! - Do not require connecting wallet inBuyWidgetifreceiverAddressis set -
#8298
899051fThanks @joaquim-verges! - Add EIP-5792 support for EIP1193.toProvider()
[email protected]
Minor Changes
-
#8289
b30369fThanks @jnsdls! - ###getContractMetadata()now returns a record withunknownvalues instead ofany.before:
const metadata = await getContractMetadata({ contract }); metadata; // Record<string, any> metadata.name; // string metadata.symbol; // string
after:
const metadata = await getContractMetadata({ contract }); metadata; // Record<string, unknown> metadata.name; // string | null metadata.symbol; // string | null
Metadata is not (and was never) strictly defined outside of
nameandsymboland may contain any type of data in the record.
This is not a runtime change but it may break type inference in existing apps that relied on the previous return type.Recommended fix:
You should type-guard any key you access from "metadata".const metadata = await getContractMetadata({ contract }); if ("foo" in metadata && typeof metadata.foo === "string") { metadata.foo; // string }
Quick fix:
If adding type assertions is not something you can do in the short term you can also assert the type directly.
This is as "unsafe" as the type was before.const metadata = await getContractMetadata({ contract }); const foo = metadata.foo as string;
Patch Changes
- #8280
ceba683Thanks @MananTank! - Fix process not defined error when using "thirdweb/contract" import in Vite
@thirdweb-dev/[email protected]
@thirdweb-dev/[email protected]
@thirdweb-dev/[email protected]
@thirdweb-dev/[email protected]
@thirdweb-dev/[email protected]
@thirdweb-dev/[email protected]
@thirdweb-dev/[email protected]
Patch Changes
- #8290
f2121e9Thanks @0xFirekeeper! - added support for userId across wallet apis
[email protected]
Patch Changes
-
#8266
5ff6063Thanks @MananTank! - autofocus token search input when token selector modal opens inBuyWidget,SwapWidgetandBridgeWidgetcomponents -
#8279
72fbb15Thanks @joaquim-verges! - Resolve TokenIcon automatically when available
@thirdweb-dev/[email protected]
@thirdweb-dev/[email protected]