Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-taxis-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Version bump likely needs to be minor (public API surface).

If Account now exposes signAuthorization, this is a public API addition and should be a minor bump per guidelines. Use patch only if the method isn’t part of any exported/public type.

Apply this diff if it is public:

-"thirdweb": patch
+"thirdweb": minor
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"thirdweb": patch
"thirdweb": minor
🤖 Prompt for AI Agents
In .changeset/eighty-taxis-own.md around line 2, the changeset currently lists
"thirdweb": patch but the new Account API exposes signAuthorization which is a
public API addition; change the bump from patch to minor and update any
accompanying description/title in the changeset to reflect a minor release. If
signAuthorization is not exported/public, keep patch; otherwise edit the file to
use "thirdweb": minor and save.

---

Add signAuthorization support to 1193 provider
9 changes: 9 additions & 0 deletions packages/thirdweb/src/wallets/injected/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as ox__Authorization from "ox/Authorization";
import type { EIP1193Provider } from "viem";
import {
getTypesForEIP712Domain,
Expand All @@ -14,6 +15,7 @@
import type { Chain } from "../../chains/types.js";
import { getCachedChain, getChainMetadata } from "../../chains/utils.js";
import type { ThirdwebClient } from "../../client/client.js";
import type { AuthorizationRequest } from "../../transaction/actions/eip7702/authorization.js";
import { getAddress } from "../../utils/address.js";
import {
type Hex,
Expand Down Expand Up @@ -265,6 +267,13 @@
params: [messageToSign, getAddress(account.address)],
});
},
async signAuthorization(authorization: AuthorizationRequest) {
const payload = ox__Authorization.getSignPayload(authorization);
return await provider.request({
method: "eth_sign",
params: [getAddress(account.address), payload],
});
},

Check warning on line 276 in packages/thirdweb/src/wallets/injected/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/wallets/injected/index.ts#L271-L276

Added lines #L271 - L276 were not covered by tests
async signTypedData(typedData) {
if (!provider || !account.address) {
throw new Error("Provider not setup");
Expand Down
Loading