thirdweb@5.99.0
·
418 commits
to main
since this release
Minor Changes
-
#7003
58e343c
Thanks @joaquim-verges! - Breaking change: EIP-5792 supportWe've significantly improved our EIP-5792 apis, which come with some breaking changes:
New Functions Added
-
useSendAndConfirmCalls
- Description: Hook to send and wait for confirmation of EIP-5792 calls
- Returns: React Query mutation object with transaction receipts
- Example:
const { mutate: sendAndConfirmCalls, data: result } = useSendAndConfirmCalls(); await sendAndConfirmCalls({ client, calls: [tx1, tx2], }); console.log("Transaction hash:", result.receipts?.[0]?.transactionHash);
-
useWaitForCallsReceipt
- Description: Hook to wait for the receipt of EIP-5792 calls, perfect for splitting submitting the call and waiting for receipt
- Returns: React Query object with call receipts
- Example:
const { mutate: sendCalls, data: result } = useSendCalls(); const { data: receipt, isLoading } = useWaitForCallsReceipt(result);
Breaking Changes
useSendCalls
ChangesBefore
// mutation returns id a string const sendCalls = useSendCalls({ client });
After
// no longer needs client // mutation returns an object with id const sendCalls = useSendCalls();
Waiting for call receipts is now done separately, via the
useWaitForCallsReceipt
.Before
const { mutate: sendCalls, data: receipt } = useSendCalls({ client, waitForBundle: true, });
After
const { mutate: sendCalls, data: result } = useSendCalls(); const { data: receipt, isLoading } = useWaitForCallsReceipt(result);
You can also use the helper
useSendAndConfirmCalls
to combine both submitting and waiting for confirmation.const { mutate: sendAndConfirmCalls, data: receipt } = useSendAndConfirmCalls();
sendCalls
ChangesBefore:
// Old output type type SendCallsResult = string;
After:
// New output type type SendCallsResult = { id: string; client: ThirdwebClient; chain: Chain; wallet: Wallet; };
-