@@ -18,6 +18,7 @@ import {
1818import { smartWallet } from "../wallets/smart/smart-wallet.js" ;
1919import { generateAccount } from "../wallets/utils/generateAccount.js" ;
2020import * as Engine from "./index.js" ;
21+ import { verifyTypedData } from "src/auth/verify-typed-data.js" ;
2122
2223describe . runIf (
2324 process . env . TW_SECRET_KEY &&
@@ -78,6 +79,36 @@ describe.runIf(
7879 expect ( signature ) . toBeDefined ( ) ;
7980 } ) ;
8081
82+ it ( "should sign typed data for EOA execution options" , async ( ) => {
83+ const eoaServerWallet = Engine . serverWallet ( {
84+ address : process . env . ENGINE_CLOUD_WALLET_ADDRESS as string ,
85+ chain : arbitrumSepolia ,
86+ client : TEST_CLIENT ,
87+ vaultAccessToken : process . env . VAULT_TOKEN as string ,
88+ executionOptions : {
89+ type : "eoa" ,
90+ address : process . env . ENGINE_CLOUD_WALLET_ADDRESS_EOA as string ,
91+ } ,
92+ } ) ;
93+
94+ const signature = await eoaServerWallet . signTypedData ( {
95+ ...typedData . basic ,
96+ } ) ;
97+
98+ expect ( signature ) . toBeDefined ( ) ;
99+
100+ const is_valid = await verifyTypedData ( {
101+ address : process . env . ENGINE_CLOUD_WALLET_ADDRESS_EOA as string ,
102+ chain : arbitrumSepolia ,
103+ client : TEST_CLIENT ,
104+ ...typedData . basic ,
105+
106+ signature,
107+ } ) ;
108+
109+ expect ( is_valid ) . toBe ( true ) ;
110+ } ) ;
111+
81112 it ( "should send a tx with regular API" , async ( ) => {
82113 const tx = await sendTransaction ( {
83114 account : serverWallet ,
0 commit comments