Skip to content

Commit 95f6575

Browse files
authored
fix: update sendCalls to support EIP-5792 with backward compatibility (#243)
1 parent 7e0d41f commit 95f6575

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/EVM/EVMStepExecutor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,20 @@ export class EVMStepExecutor extends BaseStepExecutor {
442442

443443
calls.push(transferCall)
444444

445-
txHash = (await getAction(
445+
const sendCallsResult = (await getAction(
446446
this.client,
447447
sendCalls,
448448
'sendCalls'
449449
)({
450450
account: this.client.account!,
451451
calls,
452452
})) as Address
453+
// EIP-5792 spec was updated to return an object with id instead of string hash directly
454+
// This check allows backwards compatibility during transition period
455+
txHash =
456+
typeof sendCallsResult === 'object'
457+
? (sendCallsResult as { id: Hash })?.id
458+
: sendCallsResult
453459
txType = 'batched'
454460
} else if (isRelayerTransaction) {
455461
const relayerTypedData = step.typedData.find(

0 commit comments

Comments
 (0)