1use crate::{send::{CraftClawbackReq, CraftClawbackRes, CraftSendReq, CraftSendRes, InviteHistoryReq, InvitesPage, PendingInvitesReq}, JupiterClient, JupiterError};
2
3
4
5
6
7
8#[derive(Clone)]
9pub struct SendService<'a>{
10 client: &'a JupiterClient,
11}
12
13
14
15impl<'a> SendService<'a> {
16 pub fn new(client: &'a JupiterClient) -> Self {
17 Self { client }
18 }
19
20 pub async fn craft_send(
21 &self,
22 req: &CraftSendReq,
23 ) -> Result<CraftSendRes, JupiterError> {
24 let path = "/send/v1/craft-send";
25 self.client.post(&path, req).await
26 }
27
28 pub async fn craft_clawback(
29 &self,
30 req: &CraftClawbackReq,
31 ) -> Result<CraftClawbackRes, JupiterError> {
32 let path = "/send/v1/craft-send";
33 self.client.post(&path, req).await
34 }
35
36 pub async fn pending_invites(
37 &self,
38 req: &PendingInvitesReq,
39 ) -> Result<InvitesPage, JupiterError> {
40 let path = "/send/v1/pending-invites";
41 self.client.post(&path, req).await
42 }
43
44 pub async fn invite_history(
45 &self,
46 req: &InviteHistoryReq,
47 ) -> Result<InvitesPage, JupiterError> {
48 let path = "/send/v1/invite-history";
49 self.client.post(&path, req).await
50 }
51
52}