mirror of
https://github.com/floor-licker/polyfill-rs.git
synced 2026-08-17 06:28:07 +00:00
feat: achieve 100% API parity with baseline polymarket-rs-client implementation, add comprehensive parity analysis report
This commit is contained in:
@@ -114,6 +114,30 @@ impl ClobClient {
|
||||
self.api_creds = Some(api_creds);
|
||||
}
|
||||
|
||||
/// Get the wallet address
|
||||
pub fn get_address(&self) -> Option<String> {
|
||||
use alloy_primitives::hex;
|
||||
self.signer.as_ref().map(|s| hex::encode_prefixed(s.address().as_slice()))
|
||||
}
|
||||
|
||||
/// Get the collateral token address for the current chain
|
||||
pub fn get_collateral_address(&self) -> Option<String> {
|
||||
let config = crate::orders::get_contract_config(self.chain_id, false)?;
|
||||
Some(config.collateral)
|
||||
}
|
||||
|
||||
/// Get the conditional tokens contract address for the current chain
|
||||
pub fn get_conditional_address(&self) -> Option<String> {
|
||||
let config = crate::orders::get_contract_config(self.chain_id, false)?;
|
||||
Some(config.conditional_tokens)
|
||||
}
|
||||
|
||||
/// Get the exchange contract address for the current chain
|
||||
pub fn get_exchange_address(&self) -> Option<String> {
|
||||
let config = crate::orders::get_contract_config(self.chain_id, false)?;
|
||||
Some(config.exchange)
|
||||
}
|
||||
|
||||
/// Test basic connectivity
|
||||
pub async fn get_ok(&self) -> bool {
|
||||
match self.http_client.get(&format!("{}/ok", self.base_url)).send().await {
|
||||
|
||||
+6
-1
@@ -1075,4 +1075,9 @@ pub struct Rewards {
|
||||
pub type ClientResult<T> = anyhow::Result<T>;
|
||||
|
||||
/// Result type used throughout the client
|
||||
pub type Result<T> = std::result::Result<T, crate::errors::PolyfillError>;
|
||||
pub type Result<T> = std::result::Result<T, crate::errors::PolyfillError>;
|
||||
|
||||
// Type aliases for 100% compatibility with baseline implementation
|
||||
pub type ApiCreds = ApiCredentials;
|
||||
pub type CreateOrderOptions = OrderOptions;
|
||||
pub type OrderArgs = OrderRequest;
|
||||
Reference in New Issue
Block a user