diff --git a/.changeset/forty-seals-raise.md b/.changeset/forty-seals-raise.md deleted file mode 100644 index e17eebcc46a..00000000000 --- a/.changeset/forty-seals-raise.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -"thirdweb": minor ---- - -Breaking change: EIP-5792 support - -We've significantly improved our EIP-5792 apis, which come with some breaking changes: - -### New Functions Added - -1. **`useSendAndConfirmCalls`** - - - Description: Hook to send and wait for confirmation of EIP-5792 calls - - Returns: React Query mutation object with transaction receipts - - Example: - - ```tsx - const { mutate: sendAndConfirmCalls, data: result } = - useSendAndConfirmCalls(); - await sendAndConfirmCalls({ - client, - calls: [tx1, tx2], - }); - console.log("Transaction hash:", result.receipts?.[0]?.transactionHash); - ``` - -2. **`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: - ```tsx - const { mutate: sendCalls, data: result } = useSendCalls(); - const { data: receipt, isLoading } = useWaitForCallsReceipt(result); - ``` - -### Breaking Changes - -#### `useSendCalls` Changes - -**Before** - -```tsx -// mutation returns id a string -const sendCalls = useSendCalls({ client }); -``` - -**After** - -```tsx -// 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** - -```tsx -const { mutate: sendCalls, data: receipt } = useSendCalls({ - client, - waitForBundle: true, -}); -``` - -**After** - -```tsx -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. - -```tsx -const { mutate: sendAndConfirmCalls, data: receipt } = useSendAndConfirmCalls(); -``` - -#### `sendCalls` Changes - -**Before**: - -```tsx -// Old output type -type SendCallsResult = string; -``` - -**After**: - -```tsx -// New output type -type SendCallsResult = { - id: string; - client: ThirdwebClient; - chain: Chain; - wallet: Wallet; -}; -``` diff --git a/packages/thirdweb/CHANGELOG.md b/packages/thirdweb/CHANGELOG.md index d489ab99700..064e1f05f51 100644 --- a/packages/thirdweb/CHANGELOG.md +++ b/packages/thirdweb/CHANGELOG.md @@ -1,5 +1,105 @@ # thirdweb +## 5.99.0 + +### Minor Changes + +- [#7003](https://github.com/thirdweb-dev/js/pull/7003) [`58e343c`](https://github.com/thirdweb-dev/js/commit/58e343c10ccbab638f612591fb62761abc988b3e) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Breaking change: EIP-5792 support + + We've significantly improved our EIP-5792 apis, which come with some breaking changes: + + ### New Functions Added + + 1. **`useSendAndConfirmCalls`** + + - Description: Hook to send and wait for confirmation of EIP-5792 calls + - Returns: React Query mutation object with transaction receipts + - Example: + + ```tsx + const { mutate: sendAndConfirmCalls, data: result } = + useSendAndConfirmCalls(); + await sendAndConfirmCalls({ + client, + calls: [tx1, tx2], + }); + console.log("Transaction hash:", result.receipts?.[0]?.transactionHash); + ``` + + 2. **`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: + ```tsx + const { mutate: sendCalls, data: result } = useSendCalls(); + const { data: receipt, isLoading } = useWaitForCallsReceipt(result); + ``` + + ### Breaking Changes + + #### `useSendCalls` Changes + + **Before** + + ```tsx + // mutation returns id a string + const sendCalls = useSendCalls({ client }); + ``` + + **After** + + ```tsx + // 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** + + ```tsx + const { mutate: sendCalls, data: receipt } = useSendCalls({ + client, + waitForBundle: true, + }); + ``` + + **After** + + ```tsx + 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. + + ```tsx + const { mutate: sendAndConfirmCalls, data: receipt } = + useSendAndConfirmCalls(); + ``` + + #### `sendCalls` Changes + + **Before**: + + ```tsx + // Old output type + type SendCallsResult = string; + ``` + + **After**: + + ```tsx + // New output type + type SendCallsResult = { + id: string; + client: ThirdwebClient; + chain: Chain; + wallet: Wallet; + }; + ``` + ## 5.98.2 ### Patch Changes diff --git a/packages/thirdweb/package.json b/packages/thirdweb/package.json index 3a1c8b28fb5..30582d60a28 100644 --- a/packages/thirdweb/package.json +++ b/packages/thirdweb/package.json @@ -1,6 +1,6 @@ { "name": "thirdweb", - "version": "5.98.2", + "version": "5.99.0", "repository": { "type": "git", "url": "git+https://github.com/thirdweb-dev/js.git#main" diff --git a/packages/wagmi-adapter/CHANGELOG.md b/packages/wagmi-adapter/CHANGELOG.md index e7f259b2fbf..3cc1a61b7ba 100644 --- a/packages/wagmi-adapter/CHANGELOG.md +++ b/packages/wagmi-adapter/CHANGELOG.md @@ -1,5 +1,7 @@ # @thirdweb-dev/wagmi-adapter +## 0.2.76 + ## 0.2.75 ## 0.2.74 diff --git a/packages/wagmi-adapter/package.json b/packages/wagmi-adapter/package.json index 8680934e357..19c26f0c668 100644 --- a/packages/wagmi-adapter/package.json +++ b/packages/wagmi-adapter/package.json @@ -1,6 +1,6 @@ { "name": "@thirdweb-dev/wagmi-adapter", - "version": "0.2.75", + "version": "0.2.76", "repository": { "type": "git", "url": "git+https://github.com/thirdweb-dev/js.git#main"