Admin Wallet Hooks, New Marketplace Extensions, and more
thirdweb SDK v5.56.0
React
Get the Current Smart Account's Admin Wallet
You can now get the admin wallet for a currently connected smart account with useAdminWallet
.
import { useActiveWallet, useAdminWallet } from "thirdweb/react"
const activeWallet = useActiveWallet(); // smart wallet
const adminWallet = useAdminWallet(); // the personal wallet that controls the smart wallet
TypeScript
Marketplace Extensions
The Marketplace contract is one of our most used contract templates, and to make it even easier to build on-chain marketplace experiences we're constantly adding SDK extensions to interact with the Marketplace contract.
To better understand what your specific Marketplace supports, we've added a number of specific functions to check for supported features on a contract prior to attempting to use them.
isGetListingSupported
isBuyFromListingSupported
isCreateAuctionSupported
isGetAuctionSupported
isGetWinningBidSupported
isBidInAuctionSupported
isCancelAuctionSupported
isCreateAuctionSupported
isCancelListingSupported
Determine Modular Contract Module Compatibility
With the release of Modular Contracts, you now might need to check if a given module is compatible with your core contract prior to installing it. You can now do this using the checkModulesCompatiblity
function.
import { checkModulesCompatibility } from "thirdweb/modules"
const isCompatible = await checkModulesCompatibility({
chain: defineChain(1),
client: THIRDWEB_CLIENT,
coreBytecode: "0x...",
moduleBytecodes: ["0x..."]
});
Publish Contracts
Published contracts are more discoverable, more easily indexed, and more usable across thirdweb's tools than unknown contracts. It allows anyone to pull the contract's ABI and metadata to interact with your contract permissionlessly. You can now programmatically publish any contract to thirdweb's contract registry with publishContract
.
import { publishContract } from "thirdweb"
const transaction = publishContract({
contract,
account,
metadata
});
await sendTransaction({
account,
transaction
});
Bug Fixes and Other Improvements
- Function signatures and contract ABIs are now properly handled in
resolveMethod
- Pay now allows topping up from a different wallet with the same currency
- Our internal ABI types are now publicly exported under
thirdweb/utils
- Balances are now properly invalidated on Pay transaction success
PayEmbed
metadata can now be customized