pub struct TridentClientBuilder { /* private fields */ }Expand description
Builds a TridentClient by registering one chain-handler builder per
domain and connecting to the delivery service.
Chain-family-specific entry points (e.g. with_evm_chain from the evm
module) wrap the generic internal chain-registration call.
Implementations§
Source§impl TridentClientBuilder
impl TridentClientBuilder
Sourcepub fn new(endpoint: Endpoint) -> Self
pub fn new(endpoint: Endpoint) -> Self
Creates an empty builder targeting the given delivery-service gRPC endpoint.
Sourcepub fn with_expiry_margin(self, domain: Domain, margin: u64) -> Self
pub fn with_expiry_margin(self, domain: Domain, margin: u64) -> Self
Sets the flat number of blocks added on top of the server’s minimum
spend-intent expiry height for domain when the SDK auto-resolves
the expiry. Domains without an entry fall back to 10% of the server’s
minimum.
Sourcepub async fn connect(self) -> Result<TridentClient, TridentClientBuilderError>
pub async fn connect(self) -> Result<TridentClient, TridentClientBuilderError>
Connects to the delivery service and materializes a TridentClient.
Fetches the deployment list from the server and, for each registered domain, invokes the corresponding chain-handler builder with the server-reported deposit and delivery contract addresses. Fails if a deployment is missing either contract address, if a chain-handler builder rejects its inputs, or if a registered domain has no matching deployment.
Source§impl TridentClientBuilder
impl TridentClientBuilder
Sourcepub fn with_evm_chain(
self,
domain: Domain,
provider: impl Provider<AnyNetwork> + 'static,
signer: impl Signer + Send + Sync + 'static,
) -> Self
pub fn with_evm_chain( self, domain: Domain, provider: impl Provider<AnyNetwork> + 'static, signer: impl Signer + Send + Sync + 'static, ) -> Self
Registers an EVM chain domain with its provider and signer.
The signer’s address is used as src_spender for spends originating
from this domain and as the sender for
crate::TridentClient::deposit.
Auto Trait Implementations§
impl !Freeze for TridentClientBuilder
impl !RefUnwindSafe for TridentClientBuilder
impl !UnwindSafe for TridentClientBuilder
impl Send for TridentClientBuilder
impl Sync for TridentClientBuilder
impl Unpin for TridentClientBuilder
impl UnsafeUnpin for TridentClientBuilder
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> 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