File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/thirdweb/src/wallets/injected Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Add signAuthorization support to 1193 provider
Original file line number Diff line number Diff line change 1+ import * as ox__Authorization from "ox/Authorization" ;
12import type { EIP1193Provider } from "viem" ;
23import {
34 getTypesForEIP712Domain ,
@@ -14,6 +15,7 @@ import {
1415import type { Chain } from "../../chains/types.js" ;
1516import { getCachedChain , getChainMetadata } from "../../chains/utils.js" ;
1617import type { ThirdwebClient } from "../../client/client.js" ;
18+ import type { AuthorizationRequest } from "../../transaction/actions/eip7702/authorization.js" ;
1719import { getAddress } from "../../utils/address.js" ;
1820import {
1921 type Hex ,
@@ -265,6 +267,13 @@ function createAccount({
265267 params : [ messageToSign , getAddress ( account . address ) ] ,
266268 } ) ;
267269 } ,
270+ async signAuthorization ( authorization : AuthorizationRequest ) {
271+ const payload = ox__Authorization . getSignPayload ( authorization ) ;
272+ return await provider . request ( {
273+ method : "eth_sign" ,
274+ params : [ getAddress ( account . address ) , payload ] ,
275+ } ) ;
276+ } ,
268277 async signTypedData ( typedData ) {
269278 if ( ! provider || ! account . address ) {
270279 throw new Error ( "Provider not setup" ) ;
You can’t perform that action at this time.
0 commit comments