funpay_client/client/
mod.rs

1use crate::error::FunPayError;
2use crate::models::OfferEditParams;
3use async_trait::async_trait;
4use serde_json::Value;
5
6#[async_trait]
7pub trait FunpayGateway: Send + Sync {
8    async fn get_home(
9        &self,
10        golden_key: &str,
11        user_agent: &str,
12    ) -> Result<(String, Vec<String>), FunPayError>;
13    async fn get_chat_page(
14        &self,
15        golden_key: &str,
16        user_agent: &str,
17        chat_id: &str,
18    ) -> Result<(String, Vec<String>), FunPayError>;
19    async fn get_orders_trade(
20        &self,
21        golden_key: &str,
22        user_agent: &str,
23    ) -> Result<String, FunPayError>;
24    async fn get_order_page(
25        &self,
26        golden_key: &str,
27        user_agent: &str,
28        order_id: &str,
29    ) -> Result<String, FunPayError>;
30    async fn post_runner(
31        &self,
32        golden_key: &str,
33        user_agent: &str,
34        csrf: &str,
35        phpsessid: Option<&str>,
36        objects_json: &str,
37        request_json: Option<&str>,
38    ) -> Result<Value, FunPayError>;
39    async fn post_offer_save(
40        &self,
41        golden_key: &str,
42        user_agent: &str,
43        phpsessid: Option<&str>,
44        csrf: &str,
45        offer_id: i64,
46        node_id: i64,
47        params: &OfferEditParams,
48    ) -> Result<Value, FunPayError>;
49    async fn get_offer_edit_page(
50        &self,
51        golden_key: &str,
52        user_agent: &str,
53        node_id: i64,
54        offer_id: i64,
55    ) -> Result<String, FunPayError>;
56    async fn get_lots_trade_page(
57        &self,
58        golden_key: &str,
59        user_agent: &str,
60        node_id: i64,
61    ) -> Result<String, FunPayError>;
62    async fn get_lots_page(
63        &self,
64        golden_key: &str,
65        user_agent: &str,
66        node_id: i64,
67    ) -> Result<String, FunPayError>;
68}
69
70pub mod account;
71pub mod http;
72pub mod poller;
73pub mod urls;