pub struct RelayClient {
pub relayer_url: String,
pub chain_id: u64,
pub contract_config: ContractConfig,
pub relay_tx_type: RelayerTxType,
/* private fields */
}Fields§
§relayer_url: String§chain_id: u64§contract_config: ContractConfig§relay_tx_type: RelayerTxTypeImplementations§
Source§impl RelayClient
impl RelayClient
pub fn new(relayer_url: impl Into<String>, chain_id: u64) -> Self
pub fn new_with_type( relayer_url: impl Into<String>, chain_id: u64, relay_tx_type: RelayerTxType, ) -> Self
Sourcepub fn with_relay_tx_type(self, relay_tx_type: RelayerTxType) -> Self
pub fn with_relay_tx_type(self, relay_tx_type: RelayerTxType) -> Self
Override the relay transaction type (SAFE / PROXY) after construction. This is useful when you want to pick the type dynamically (e.g., via config/env).
pub fn with_signer( self, signer: Box<dyn AbstractSigner + Send + Sync>, typed: Box<dyn AbstractSignerForCreate + Send + Sync>, ) -> Self
pub fn with_builder_api_key(self, creds: BuilderApiKeyCreds) -> Self
Sourcepub fn with_gas_estimate_rpc(self, rpc: impl Into<String>) -> Self
pub fn with_gas_estimate_rpc(self, rpc: impl Into<String>) -> Self
Override the RPC used for gas estimation (defaults to BLOCK_RPC_URL env or polygon-rpc.com).
pub async fn get_nonce( &self, signer_address: &str, signer_type: &str, ) -> Result<NoncePayload>
pub async fn get_relay_payload( &self, signer_address: &str, signer_type: &str, ) -> Result<RelayPayload>
pub async fn get_transaction( &self, transaction_id: &str, ) -> Result<Vec<RelayerTransaction>>
pub async fn get_transactions(&self) -> Result<Vec<RelayerTransaction>>
pub async fn get_deployed(&self, safe_address: &str) -> Result<bool>
pub async fn deploy(&self) -> Result<RelayerTransactionResponse>
Sourcepub async fn execute_transactions(
&self,
txns: Vec<Transaction>,
metadata: Option<String>,
) -> Result<RelayerTransactionResponse>
pub async fn execute_transactions( &self, txns: Vec<Transaction>, metadata: Option<String>, ) -> Result<RelayerTransactionResponse>
按 relayTxType 分发执行(对齐 TS execute 行为)
pub async fn execute( &self, txns: Vec<SafeTransaction>, metadata: Option<String>, ) -> Result<RelayerTransactionResponse>
Sourcepub async fn execute_with_safe(
&self,
txns: Vec<SafeTransaction>,
metadata: Option<String>,
safe_address: Option<String>,
) -> Result<RelayerTransactionResponse>
pub async fn execute_with_safe( &self, txns: Vec<SafeTransaction>, metadata: Option<String>, safe_address: Option<String>, ) -> Result<RelayerTransactionResponse>
Execute transactions with an optional explicit Safe address
If safe_address is provided, it will be used directly instead of deriving from signer address.
This is useful when the Safe address is already known (e.g., from Polymarket account).
pub async fn execute_proxy_transactions( &self, txns: Vec<ProxyTransaction>, metadata: Option<String>, ) -> Result<RelayerTransactionResponse>
pub async fn poll_until_state( &self, transaction_id: &str, states: &[RelayerTransactionState], fail_state: Option<RelayerTransactionState>, max_polls: usize, poll_freq_ms: u64, ) -> Result<Option<RelayerTransaction>>
Auto Trait Implementations§
impl Freeze for RelayClient
impl !RefUnwindSafe for RelayClient
impl Send for RelayClient
impl Sync for RelayClient
impl Unpin for RelayClient
impl UnsafeUnpin for RelayClient
impl !UnwindSafe for RelayClient
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more