@@ -105,18 +105,12 @@ const convertSessionSpec = (wasmSpec: WasmSessionSpec): SessionSpec => {
105105 else if (limit .limitType === " Lifetime" ) limitType = LimitType .Lifetime ;
106106 else if (limit .limitType === " Allowance" ) limitType = LimitType .Allowance ;
107107 else {
108- const numericLimitType = Number (limit .limitType );
109- if (Number .isNaN (numericLimitType )) {
110- // eslint-disable-next-line no-console
111- console .warn (
112- " Unexpected limitType value received from WASM:" ,
113- limit .limitType ,
114- );
115- // Fallback to a safe default to avoid propagating an invalid enum value
116- limitType = LimitType .Unlimited ;
117- } else {
118- limitType = numericLimitType as LimitType ;
119- }
108+ const error = new Error (
109+ ` Unexpected limitType value received from WASM: ${limit .limitType } ` ,
110+ );
111+ // eslint-disable-next-line no-console
112+ console .error (error );
113+ throw error ;
120114 }
121115
122116 // Validate and convert BigInt values with try-catch
@@ -193,13 +187,20 @@ const {
193187 if (address .value === null ) {
194188 throw new Error (" Account address is null" );
195189 }
190+
191+ // Ensure entryPoint is provided by the chain configuration
192+ const { entryPoint } = contracts as { entryPoint? : Address };
193+ if (! entryPoint ) {
194+ throw new Error (` EntryPoint address is not configured for chain ${defaultChain .id } ` );
195+ }
196+
196197 // Use the new listActiveSessions function from the SDK
197198 const { sessions : activeSessions } = await listActiveSessions ({
198199 account: address .value ,
199200 rpcUrl ,
200201 contracts: {
201202 sessionValidator: contracts .sessionValidator ,
202- entryPoint: ( contracts as { entryPoint ? : Address }). entryPoint || " 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108 " ,
203+ entryPoint: entryPoint as Address ,
203204 accountFactory: contracts .factory ,
204205 webauthnValidator: contracts .webauthnValidator ,
205206 eoaValidator: contracts .eoaValidator ,
0 commit comments