pub struct MulticallBuilder { /* private fields */ }Expand description
Accumulator for a Multicall3 batch to be run via a self-call into a
7702-delegated TridentAccount EOA.
Implementations§
Source§impl MulticallBuilder
impl MulticallBuilder
Sourcepub fn new() -> MulticallBuilder
pub fn new() -> MulticallBuilder
New builder with multicall3 set to the canonical Multicall3 address.
Sourcepub fn with_multicall3(self, addr: Address) -> MulticallBuilder
pub fn with_multicall3(self, addr: Address) -> MulticallBuilder
Override the Multicall3 address (tests / non-canonical chains).
Sourcepub fn call<C>(self, contract: Address, call: &C) -> MulticallBuilderwhere
C: SolCall,
pub fn call<C>(self, contract: Address, call: &C) -> MulticallBuilderwhere
C: SolCall,
Append a zero-value contract call.
Sourcepub fn call_with_value<C>(
self,
contract: Address,
call: &C,
value: Uint<256, 4>,
) -> MulticallBuilderwhere
C: SolCall,
pub fn call_with_value<C>(
self,
contract: Address,
call: &C,
value: Uint<256, 4>,
) -> MulticallBuilderwhere
C: SolCall,
Append a value-bearing contract call.
Sourcepub fn send_value(self, to: Address, value: Uint<256, 4>) -> MulticallBuilder
pub fn send_value(self, to: Address, value: Uint<256, 4>) -> MulticallBuilder
Append a pure ETH transfer (empty calldata).
Sourcepub fn total_value(&self) -> Uint<256, 4>
pub fn total_value(&self) -> Uint<256, 4>
Sum of per-call values — this is the outer msg.value that will be
sent to satisfy Multicall3’s invariant.
Sourcepub fn aggregate3_calldata(&self) -> Bytes
pub fn aggregate3_calldata(&self) -> Bytes
Inner calldata: ABI-encoded Multicall3.aggregate3Value(calls).
Sourcepub async fn send_with_wallet_provider<P, N>(
self,
provider: P,
) -> Result<PendingTransactionBuilder<N>, MulticallError>
pub async fn send_with_wallet_provider<P, N>( self, provider: P, ) -> Result<PendingTransactionBuilder<N>, MulticallError>
Build + send the outer self-call. Convenience wrapper around
send that uses the provider’s default signer as the
outer-tx signer. That EOA must be 7702-delegated to TridentAccount.
Returns an alloy_provider::PendingTransactionBuilder.
Sourcepub async fn send<P, N>(
self,
provider: P,
tx_signer: Address,
) -> Result<PendingTransactionBuilder<N>, MulticallError>
pub async fn send<P, N>( self, provider: P, tx_signer: Address, ) -> Result<PendingTransactionBuilder<N>, MulticallError>
Build + send the outer self-call.
tx_signer is the EOA that will sign the outer transaction — the
from of the outgoing tx, which is also its to because this is a
self-call. It must be 7702-delegated to TridentAccount, and it
must match the key provider is configured to sign with; otherwise
the provider will fail to sign or the chain will reject the tx.
Returns an alloy_provider::PendingTransactionBuilder.
Sourcepub fn build_transaction_request<N>(
self,
tx_signer: Address,
) -> <N as Network>::TransactionRequestwhere
N: Network,
pub fn build_transaction_request<N>(
self,
tx_signer: Address,
) -> <N as Network>::TransactionRequestwhere
N: Network,
Assemble the outer execute(multicall3, aggregate3Value(...)) tx
request without sending it.
tx_signer is the EOA that will sign the outer transaction; it is
set as the request’s to (self-call) and, at send time, must be
7702-delegated to TridentAccount. value is set to the sum of
per-call values. Gas/fees/nonce are left unset so callers can
inspect, customize, or route the tx through any submission path.
Trait Implementations§
Source§impl Clone for MulticallBuilder
impl Clone for MulticallBuilder
Source§fn clone(&self) -> MulticallBuilder
fn clone(&self) -> MulticallBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for MulticallBuilder
impl Default for MulticallBuilder
Source§fn default() -> MulticallBuilder
fn default() -> MulticallBuilder
Auto Trait Implementations§
impl Freeze for MulticallBuilder
impl RefUnwindSafe for MulticallBuilder
impl Send for MulticallBuilder
impl Sync for MulticallBuilder
impl Unpin for MulticallBuilder
impl UnsafeUnpin for MulticallBuilder
impl UnwindSafe for MulticallBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request