Skip to content

Support IAW auth tokens for EOA signing #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 27, 2025
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
83 changes: 80 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
members = ["aa-core", "core", "executors", "server", "thirdweb-core", "twmq"]
members = ["aa-types", "aa-core", "core", "executors", "server", "thirdweb-core", "twmq"]
resolver = "2"
1 change: 1 addition & 0 deletions aa-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2024"
[dependencies]
alloy = { version = "1.0.8", features = ["serde"] }
tokio = "1.44.2"
engine-aa-types = { path = "../aa-types" }
engine-core = { path = "../core" }
vault-types = { version = "0.1.0", git = "ssh://git@github.com/thirdweb-dev/vault.git", branch = "main" }
vault-sdk = { version = "0.1.0", git = "ssh://git@github.com/thirdweb-dev/vault.git", branch = "main" }
Expand Down
21 changes: 11 additions & 10 deletions aa-core/src/userop/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ use alloy::{
providers::Provider,
rpc::types::{PackedUserOperation, UserOperation},
};
use engine_aa_types::VersionedUserOp;
use engine_core::{
chain::Chain,
credentials::SigningCredential,
error::{AlloyRpcErrorToEngineError, EngineError},
execution_options::aa::{EntrypointAndFactoryDetails, EntrypointVersion},
userop::{UserOpSigner, UserOpSignerParams, UserOpVersion},
userop::{UserOpSigner, UserOpSignerParams},
};

pub struct UserOpBuilderConfig<'a, C: Chain> {
Expand Down Expand Up @@ -40,7 +41,7 @@ impl<'a, C: Chain> UserOpBuilder<'a, C> {
Self { config }
}

pub async fn build(self) -> Result<UserOpVersion, EngineError> {
pub async fn build(self) -> Result<VersionedUserOp, EngineError> {
let mut userop = match self.config.entrypoint_and_factory.version {
EntrypointVersion::V0_6 => UserOpBuilderV0_6::new(&self.config).build().await?,
EntrypointVersion::V0_7 => UserOpBuilderV0_7::new(&self.config).build().await?,
Expand All @@ -61,10 +62,10 @@ impl<'a, C: Chain> UserOpBuilder<'a, C> {
.await?;

match &mut userop {
UserOpVersion::V0_6(userop) => {
VersionedUserOp::V0_6(userop) => {
userop.signature = signature;
}
UserOpVersion::V0_7(userop) => {
VersionedUserOp::V0_7(userop) => {
userop.signature = signature;
}
}
Expand Down Expand Up @@ -114,7 +115,7 @@ impl<'a, C: Chain> UserOpBuilderV0_6<'a, C> {
}
}

async fn build(mut self) -> Result<UserOpVersion, EngineError> {
async fn build(mut self) -> Result<VersionedUserOp, EngineError> {
let prices = self
.chain
.provider()
Expand Down Expand Up @@ -153,7 +154,7 @@ impl<'a, C: Chain> UserOpBuilderV0_6<'a, C> {
.chain
.bundler_client()
.estimate_user_op_gas(
&UserOpVersion::V0_6(self.userop.clone()),
&VersionedUserOp::V0_6(self.userop.clone()),
self.entrypoint,
None,
)
Expand All @@ -172,7 +173,7 @@ impl<'a, C: Chain> UserOpBuilderV0_6<'a, C> {
self.userop.verification_gas_limit = verification_gas_limit;
self.userop.pre_verification_gas = pre_verification_gas;

Ok(UserOpVersion::V0_6(self.userop))
Ok(VersionedUserOp::V0_6(self.userop))
}
}

Expand Down Expand Up @@ -219,7 +220,7 @@ impl<'a, C: Chain> UserOpBuilderV0_7<'a, C> {
}
}

async fn build(mut self) -> Result<UserOpVersion, EngineError> {
async fn build(mut self) -> Result<VersionedUserOp, EngineError> {
// Get gas prices, same as v0.6
let prices = self
.chain
Expand Down Expand Up @@ -272,7 +273,7 @@ impl<'a, C: Chain> UserOpBuilderV0_7<'a, C> {
.chain
.bundler_client()
.estimate_user_op_gas(
&UserOpVersion::V0_7(self.userop.clone()),
&VersionedUserOp::V0_7(self.userop.clone()),
self.entrypoint,
None,
)
Expand Down Expand Up @@ -300,6 +301,6 @@ impl<'a, C: Chain> UserOpBuilderV0_7<'a, C> {
self.userop.paymaster_verification_gas_limit = Some(paymaster_verification_gas_limit);
self.userop.paymaster_post_op_gas_limit = Some(paymaster_post_op_gas_limit);

Ok(UserOpVersion::V0_7(self.userop))
Ok(VersionedUserOp::V0_7(self.userop))
}
}
12 changes: 12 additions & 0 deletions aa-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "engine-aa-types"
version = "0.1.0"
edition = "2024"

[dependencies]
alloy = { version = "1.0.8", features = ["serde"] }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
thiserror = "2.0.12"
schemars = "0.8.22"
utoipa = "5.4.0"
3 changes: 3 additions & 0 deletions aa-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod userop;

pub use userop::*;
Loading