pub struct PolymarketPositionClient { /* private fields */ }Expand description
Deposit Wallet client for split, merge, and redeem position operations.
Implementations§
Source§impl PolymarketPositionClient
impl PolymarketPositionClient
Sourcepub fn new(
private_key: &EvmPrivateKey,
deposit_wallet: &str,
relayer_api_key: RelayerApiKey,
base_url_relayer: Option<String>,
base_url_clob: Option<String>,
timeout_secs: Option<u64>,
proxy_url: Option<ProxyUrl>,
) -> Result<Self>
pub fn new( private_key: &EvmPrivateKey, deposit_wallet: &str, relayer_api_key: RelayerApiKey, base_url_relayer: Option<String>, base_url_clob: Option<String>, timeout_secs: Option<u64>, proxy_url: Option<ProxyUrl>, ) -> Result<Self>
Creates a Deposit Wallet position client.
§Errors
Returns an error if credentials are invalid, the deposit wallet is not distinct from the signer, or an HTTP client cannot be created.
Sourcepub fn with_rpc_url(self, rpc_url: String) -> Self
pub fn with_rpc_url(self, rpc_url: String) -> Self
Sets the Polygon RPC URL used to verify the Deposit Wallet before signing.
Sourcepub fn with_deadline_secs(self, deadline_secs: u64) -> Self
pub fn with_deadline_secs(self, deadline_secs: u64) -> Self
Sets the signed-batch deadline in seconds from now.
Defaults to 1,800 seconds; values below one second are raised to one. Longer deadlines extend the period in which a signed batch can execute and delay expiry-based recovery of an unknown submission. The wait timeout does not shorten this deadline or cancel the signed batch.
Sourcepub fn with_wait_timeout(self, wait_timeout: Duration) -> Self
pub fn with_wait_timeout(self, wait_timeout: Duration) -> Self
Sets how long PolymarketPositionTransaction::wait polls before timing out.
Sourcepub fn with_poll_interval(self, poll_interval: Duration) -> Self
pub fn with_poll_interval(self, poll_interval: Duration) -> Self
Sets the Relayer poll interval used by PolymarketPositionTransaction::wait.
Sourcepub async fn split_position(
&self,
condition_id: &str,
amount: Decimal,
) -> Result<PolymarketPositionTransaction>
pub async fn split_position( &self, condition_id: &str, amount: Decimal, ) -> Result<PolymarketPositionTransaction>
Splits amount pUSD into a complete set of outcome tokens.
§Errors
Returns an error if market metadata is invalid, encoding fails, or Relayer submission is rejected or ambiguous.
Sourcepub async fn merge_positions(
&self,
condition_id: &str,
amount: Decimal,
) -> Result<PolymarketPositionTransaction>
pub async fn merge_positions( &self, condition_id: &str, amount: Decimal, ) -> Result<PolymarketPositionTransaction>
Merges amount complete sets of outcome tokens back into pUSD.
§Errors
Returns an error if market metadata is invalid, encoding fails, or Relayer submission is rejected or ambiguous.
Sourcepub async fn redeem_positions(
&self,
condition_id: &str,
) -> Result<PolymarketPositionTransaction>
pub async fn redeem_positions( &self, condition_id: &str, ) -> Result<PolymarketPositionTransaction>
Redeems both binary outcome balances for a resolved market.
§Errors
Returns an error if market metadata is invalid, encoding fails, or Relayer submission is rejected or ambiguous.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PolymarketPositionClient
impl !UnwindSafe for PolymarketPositionClient
impl Freeze for PolymarketPositionClient
impl Send for PolymarketPositionClient
impl Sync for PolymarketPositionClient
impl Unpin for PolymarketPositionClient
impl UnsafeUnpin for PolymarketPositionClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more