Skip to content
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

[Feature] Make TransactionRequest signable #1162

Open
yash-atreya opened this issue Aug 20, 2024 · 2 comments
Open

[Feature] Make TransactionRequest signable #1162

yash-atreya opened this issue Aug 20, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@yash-atreya
Copy link
Member

Component

rpc

Describe the feature you would like

Motivation

Currently a TransactionRequest cannot be signed using sign_transaction(signer), in order to do this we have to use the specific tx type we are trying to send from alloy_consensus. See: https://github.com/alloy-rs/examples/pull/129/files#diff-bd449423ea78c0a809dc015e99f4290e3ea5102dbcef24a70351ae6784a4f750R54-R79

Solution

Additional context

No response

@yash-atreya yash-atreya added the enhancement New feature or request label Aug 20, 2024
@klkvr
Copy link
Member

klkvr commented Aug 26, 2024

Looks like this is already possible when using NetworkWallet:

fn sign_request(
&self,
request: N::TransactionRequest,
) -> impl_future!(<Output = alloy_signer::Result<N::TxEnvelope>>) {
async move {
let sender = request.from().unwrap_or_else(|| self.default_signer_address());
let tx = request.build_unsigned().map_err(alloy_signer::Error::other)?;
self.sign_transaction_from(sender, tx).await
}
}

Wondering if we should simplify this somehow?

@Mohiiit
Copy link

Mohiiit commented Sep 21, 2024

Hey, Can I pick this up?

@yash-atreya yash-atreya added this to the 1.0 milestone Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants