2323
2424
2525class Accounts :
26+ """
27+ Accounts client for interacting with the DeltaDeFi API.
28+ """
29+
2630 def __init__ (self , api_client ):
31+ """
32+ Initialize the Accounts client.
33+
34+ Args:
35+ api_client: An instance of the ApiClient.
36+ """
2737 self .api_client = api_client
2838
2939 def sign_in (self , data : SignInRequest ) -> SignInResponse :
40+ """
41+ Sign in to the DeltaDeFi API.
42+
43+ Args:
44+ data: A SignInRequest object containing the authentication key and wallet address.
45+
46+ Returns:
47+ A SignInResponse object containing the sign-in response.
48+ """
3049 auth_key = data ["auth_key" ]
3150 wallet_address = data ["wallet_address" ]
3251 headers = {
@@ -42,6 +61,12 @@ def sign_in(self, data: SignInRequest) -> SignInResponse:
4261 return response .json ()
4362
4463 def createNewApiKey (self ) -> CreateNewAPIKeyResponse :
64+ """
65+ Create a new API key.
66+
67+ Returns:
68+ A CreateNewAPIKeyResponse object containing the new API key.
69+ """
4570 response = requests .get (
4671 f"{ self .api_client .base_url } /accounts/new-api-key" ,
4772 headers = self .api_client .headers ,
@@ -50,6 +75,12 @@ def createNewApiKey(self) -> CreateNewAPIKeyResponse:
5075 return response .json ()
5176
5277 def getDepositRecords (self ) -> GetDepositRecordsResponse :
78+ """
79+ Get deposit records.
80+
81+ Returns:
82+ A GetDepositRecordsResponse object containing the deposit records.
83+ """
5384 response = requests .get (
5485 f"{ self .api_client .base_url } /accounts/deposit-records" ,
5586 headers = self .api_client .headers ,
@@ -58,6 +89,12 @@ def getDepositRecords(self) -> GetDepositRecordsResponse:
5889 return response .json ()
5990
6091 def getWithdrawalRecords (self ) -> GetWithdrawalRecordsResponse :
92+ """
93+ Get withdrawal records.
94+
95+ Returns:
96+ A GetWithdrawalRecordsResponse object containing the withdrawal records.
97+ """
6198 response = requests .get (
6299 f"{ self .api_client .base_url } /accounts/withdrawal-records" ,
63100 headers = self .api_client .headers ,
@@ -66,6 +103,12 @@ def getWithdrawalRecords(self) -> GetWithdrawalRecordsResponse:
66103 return response .json ()
67104
68105 def getOrderRecords (self ) -> GetOrderRecordResponse :
106+ """
107+ Get order records.
108+
109+ Returns:
110+ A GetOrderRecordResponse object containing the order records.
111+ """
69112 response = requests .get (
70113 f"{ self .api_client .base_url } /accounts/order-records" ,
71114 headers = self .api_client .headers ,
@@ -74,6 +117,12 @@ def getOrderRecords(self) -> GetOrderRecordResponse:
74117 return response .json ()
75118
76119 def getAccountBalance (self ) -> GetAccountBalanceResponse :
120+ """
121+ Get account balance.
122+
123+ Returns:
124+ A GetAccountBalanceResponse object containing the account balance.
125+ """
77126 response = requests .get (
78127 f"{ self .api_client .base_url } /accounts/balance" ,
79128 headers = self .api_client .headers ,
@@ -84,6 +133,15 @@ def getAccountBalance(self) -> GetAccountBalanceResponse:
84133 def buildDepositTransaction (
85134 self , data : BuildDepositTransactionRequest
86135 ) -> BuildDepositTransactionResponse :
136+ """
137+ Build a deposit transaction.
138+
139+ Args:
140+ data: A BuildDepositTransactionRequest object containing the deposit transaction details.
141+
142+ Returns:
143+ A BuildDepositTransactionResponse object containing the built deposit transaction.
144+ """
87145 response = requests .post (
88146 f"{ self .api_client .base_url } /accounts/deposit/build" ,
89147 json = data ,
@@ -95,6 +153,15 @@ def buildDepositTransaction(
95153 def buildWithdrawalTransaction (
96154 self , data : BuildWithdrawalTransactionRequest
97155 ) -> BuildWithdrawalTransactionResponse :
156+ """
157+ Build a withdrawal transaction.
158+
159+ Args:
160+ data: A BuildWithdrawalTransactionRequest object containing the withdrawal transaction details.
161+
162+ Returns:
163+ A BuildWithdrawalTransactionResponse object containing the built withdrawal transaction.
164+ """
98165 response = requests .post (
99166 f"{ self .api_client .base_url } /accounts/withdrawal/build" ,
100167 json = data ,
@@ -106,6 +173,15 @@ def buildWithdrawalTransaction(
106173 def submitDepositTransaction (
107174 self , data : SubmitDepositTransactionRequest
108175 ) -> SubmitDepositTransactionResponse :
176+ """
177+ Submit a deposit transaction.
178+
179+ Args:
180+ data: A SubmitDepositTransactionRequest object containing the deposit transaction details.
181+
182+ Returns:
183+ A SubmitDepositTransactionResponse object containing the submitted deposit transaction.
184+ """
109185 response = requests .post (
110186 f"{ self .api_client .base_url } /accounts/deposit/submit" ,
111187 json = data ,
@@ -117,6 +193,15 @@ def submitDepositTransaction(
117193 def submitWithdrawalTransaction (
118194 self , data : SubmitWithdrawalTransactionRequest
119195 ) -> SubmitWithdrawalTransactionResponse :
196+ """
197+ Submit a withdrawal transaction.
198+
199+ Args:
200+ data: A SubmitWithdrawalTransactionRequest object containing the withdrawal transaction details.
201+
202+ Returns:
203+ A SubmitWithdrawalTransactionResponse object containing the submitted withdrawal transaction.
204+ """
120205 response = requests .post (
121206 f"{ self .api_client .base_url } /accounts/withdrawal/submit" ,
122207 json = data ,
@@ -126,6 +211,12 @@ def submitWithdrawalTransaction(
126211 return response .json ()
127212
128213 def getTermsAndCondition (self ) -> GetTermsAndConditionResponse :
214+ """
215+ Get terms and conditions.
216+
217+ Returns:
218+ A GetTermsAndConditionResponse object containing the terms and conditions.
219+ """
129220 response = requests .get (
130221 f"{ self .api_client .base_url } /accounts/terms-and-condition" ,
131222 headers = self .api_client .headers ,
0 commit comments