66
77import java .util .Optional ;
88
9+ import io .gopluslabs .client .response .*;
10+
911public class GoPlusClient {
1012
1113
1214 /**
1315 * get token
1416 *
1517 * @param request request
16- * @return ResponseWrapperGetAccessTokenResponse
18+ * @return AccessToken
1719 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1820 */
19- public static ResponseWrapperGetAccessTokenResponse getAccessToken (AccessTokenRequest request ) throws ApiException {
21+ public static AccessToken getAccessToken (AccessTokenRequest request ) throws ApiException {
2022
2123 TokenControllerApi api = Optional .ofNullable (request .getTimeout ())
2224 .map (timeout -> new TokenControllerApi (createApiClient (timeout )))
@@ -26,149 +28,164 @@ public static ResponseWrapperGetAccessTokenResponse getAccessToken(AccessTokenRe
2628 getAccessTokenRequest .setAppKey (request .getRequest ().getAppKey ());
2729 getAccessTokenRequest .setSign (request .getRequest ().getSign ());
2830 getAccessTokenRequest .setTime (request .getRequest ().getTime ());
29-
30- return api . getAccessTokenUsingPOST ( getAccessTokenRequest );
31+ ResponseWrapperGetAccessTokenResponse accessTokenUsingPOST = api . getAccessTokenUsingPOST ( getAccessTokenRequest );
32+ return AccessToken . of ( accessTokenUsingPOST );
3133 }
3234
3335
3436 /**
3537 * Get the list of chains supported by different functions.
3638 *
3739 * @param request SupportedChainsRequest
38- * @return ResponseWrapperListJSONObject
40+ * @return ChainsList
3941 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
4042 */
41- public static ResponseWrapperListGetChainsList supportedChains (SupportedChainsRequest request ) throws ApiException {
43+ public static ChainsList supportedChains (SupportedChainsRequest request ) throws ApiException {
4244
4345 TokenControllerV1Api api = new TokenControllerV1Api ();
4446 if (request .getTimeout () != null ) {
4547 api .setApiClient (createApiClient (request .getTimeout ()));
4648 }
47-
48- return api . getChainsListUsingGET ( request . getAuthorization (), request . getName () );
49+ ResponseWrapperListGetChainsList chainsListUsingGET = api . getChainsListUsingGET ( request . getAuthorization (), request . getName ());
50+ return ChainsList . of ( chainsListUsingGET );
4951 }
5052
5153 /**
5254 * Get token security and risk data.
5355 *
5456 * @param request TokenSecurityRequest
55- * @return ResponseWrapperTokenSecurity
57+ * @return TokenSecurity
5658 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
5759 */
58- public static ResponseWrapperTokenSecurity tokenSecurity (TokenSecurityRequest request ) throws ApiException {
60+ public static TokenSecurity tokenSecurity (TokenSecurityRequest request ) throws ApiException {
5961
6062 TokenControllerV1Api api = new TokenControllerV1Api ();
6163 if (request .getTimeout ()!=null ){
6264 api .setApiClient (createApiClient (request .getTimeout ()));
6365 }
64-
65- return api .tokenSecurityUsingGET1 (request .getChainId (), request .getAddress (), request .getAuthorization ());
66+ ResponseWrapperTokenSecurity tokenSecurity = api .tokenSecurityUsingGET1 (
67+ request .getChainId (),
68+ request .getAddress (),
69+ request .getAuthorization ()
70+ );
71+ return TokenSecurity .of (tokenSecurity );
6672 }
6773
6874
6975 /**
7076 * Check if the address is malicious
7177 *
7278 * @param request AddressSecurityRequest
73- * @return ResponseWrapperAddressContract
79+ * @return AddressContract
7480 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
7581 */
76- public static ResponseWrapperAddressContract addressSecurity (AddressSecurityRequest request ) throws ApiException {
82+ public static AddressContract addressSecurity (AddressSecurityRequest request ) throws ApiException {
7783
7884 ApproveControllerV1Api api = new ApproveControllerV1Api ();
7985 if (request .getTimeout ()!=null ){
8086 api .setApiClient (createApiClient (request .getTimeout ()));
8187 }
82-
83- return api .addressContractUsingGET1 (request .getAddress (), request .getAuthorization (), request .getChainId ());
88+ ResponseWrapperAddressContract addressContract = api .addressContractUsingGET1 (
89+ request .getAddress (),
90+ request .getAuthorization (),
91+ request .getChainId ()
92+ );
93+ return AddressContract .of (addressContract );
8494
8595 }
8696
8797 /**
8898 * Check if the approval is secure
8999 *
90100 * @param request ApprovalSecurityRequest
91- * @return ResponseWrapperContractApproveResponse
101+ * @return ContractApprove
92102 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
93103 */
94- public static ResponseWrapperContractApproveResponse approvalSecurity (ApprovalSecurityRequest request ) throws ApiException {
104+ public static ContractApprove approvalSecurity (ApprovalSecurityRequest request ) throws ApiException {
95105 ApproveControllerV1Api api = new ApproveControllerV1Api ();
96106 if (request .getTimeout ()!=null ){
97107 api .setApiClient (createApiClient (request .getTimeout ()));
98108 }
99- return api .approvalContractUsingGET (request .getChainId (), request .getAddress (), request .getAuthorization ());
109+ ResponseWrapperContractApproveResponse contractApprove = api .approvalContractUsingGET (
110+ request .getChainId (),
111+ request .getAddress (),
112+ request .getAuthorization ()
113+ );
114+ return ContractApprove .of (contractApprove );
100115 }
101116
102117
103118 /**
104119 * Check risk of all erc20 approvals under one EOA.
105120 *
106121 * @param request Erc20ApprovalSecurityRequest
107- * @return ResponseWrapperListApproveTokenOutListResponse
122+ * @return ApproveTokenOutList
108123 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
109124 */
110- public static ResponseWrapperListApproveTokenOutListResponse erc20ApprovalSecurity (Erc20ApprovalSecurityRequest request ) throws ApiException {
125+ public static ApproveTokenOutList erc20ApprovalSecurity (Erc20ApprovalSecurityRequest request ) throws ApiException {
111126
112127 ApproveControllerV2Api api = new ApproveControllerV2Api ();
113128 if (request .getTimeout ()!=null ){
114129 api .setApiClient (createApiClient (request .getTimeout ()));
115130 }
116-
117- return new ApproveControllerV2Api ().addressTokenApproveListUsingGET1 (
131+ ResponseWrapperListApproveTokenOutListResponse response = api .addressTokenApproveListUsingGET1 (
118132 request .getAddress (),
119133 request .getChainId (),
120134 request .getAuthorization ()
121135 );
136+ return ApproveTokenOutList .of (response );
122137 }
123138
124139 /**
125140 * Check risk of all erc721 approvals under one EOA.
126141 *
127142 * @param request Erc721ApprovalSecurityRequest
128- * @return ResponseWrapperListApproveNFTListResponse
143+ * @return ApproveNFTList
129144 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
130145 */
131- public static ResponseWrapperListApproveNFTListResponse erc721ApprovalSecurity (Erc721ApprovalSecurityRequest request ) throws ApiException {
146+ public static ApproveNFTList erc721ApprovalSecurity (Erc721ApprovalSecurityRequest request ) throws ApiException {
132147 ApproveControllerV2Api api = new ApproveControllerV2Api ();
133148 if (request .getTimeout ()!=null ){
134149 api .setApiClient (createApiClient (request .getTimeout ()));
135150 }
136- return new ApproveControllerV2Api () .addressNFT721ApproveListUsingGET1 (
151+ ResponseWrapperListApproveNFTListResponse response = api .addressNFT721ApproveListUsingGET1 (
137152 request .getAddress (),
138153 request .getChainId (),
139154 request .getAuthorization ()
140155 );
156+ return ApproveNFTList .of (response );
141157 }
142158
143159
144160 /**
145161 * Check risk of all erc1155 approvals under one EOA.
146162 *
147163 * @param request Erc1155ApprovalSecurityRequest
148- * @return ResponseWrapperListApproveNFT1155ListResponse
164+ * @return ApproveNFT1155List
149165 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
150166 */
151- public static ResponseWrapperListApproveNFT1155ListResponse erc1155ApprovalSecurity (Erc1155ApprovalSecurityRequest request ) throws ApiException {
167+ public static ApproveNFT1155List erc1155ApprovalSecurity (Erc1155ApprovalSecurityRequest request ) throws ApiException {
152168 ApproveControllerV2Api api = new ApproveControllerV2Api ();
153169 if (request .getTimeout ()!=null ){
154170 api .setApiClient (createApiClient (request .getTimeout ()));
155171 }
156- return api .addressNFT1155ApproveListUsingGET1 (
172+ ResponseWrapperListApproveNFT1155ListResponse response = api .addressNFT1155ApproveListUsingGET1 (
157173 request .getAddress (),
158174 request .getChainId (),
159175 request .getAuthorization ()
160176 );
177+ return ApproveNFT1155List .of (response );
161178 }
162179
163180
164181 /**
165182 * Get abi decode info
166183 *
167184 * @param request InputDecodeRequest
168- * @return ResponseWrapperParseAbiDataResponse
185+ * @return ParseAbiData
169186 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
170187 */
171- public static ResponseWrapperParseAbiDataResponse inputDecode (InputDecodeRequest request ) throws ApiException {
188+ public static ParseAbiData inputDecode (InputDecodeRequest request ) throws ApiException {
172189 ContractAbiControllerApi api = new ContractAbiControllerApi ();
173190 if (request .getTimeout ()!=null ){
174191 api .setApiClient (createApiClient (request .getTimeout ()));
@@ -181,76 +198,90 @@ public static ResponseWrapperParseAbiDataResponse inputDecode(InputDecodeRequest
181198 parseAbiDataRequest .setContractAddress (request .getBody ().getContractAddress ());
182199 parseAbiDataRequest .setSigner (request .getBody ().getSigner ());
183200
184- return api .getAbiDataInfoUsingPOST (parseAbiDataRequest , request .getAuthorization ());
201+ ResponseWrapperParseAbiDataResponse abiData = api .getAbiDataInfoUsingPOST (parseAbiDataRequest , request .getAuthorization ());
202+ return ParseAbiData .of (abiData );
185203 }
186204
187205
188206 /**
189207 * Get NFT security and risk data.
190208 *
191209 * @param request NftSecurityRequest
192- * @return ResponseWrapperGetNftInfo
210+ * @return NftInfo
193211 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
194212 */
195- public static ResponseWrapperGetNftInfo nftSecurity (NftSecurityRequest request ) throws ApiException {
213+ public static NftInfo nftSecurity (NftSecurityRequest request ) throws ApiException {
196214 NftControllerApi api = new NftControllerApi ();
197215
198216 if (request .getTimeout ()!=null ){
199217 api .setApiClient (createApiClient (request .getTimeout ()));
200218 }
201219
202- return api .getNftInfoUsingGET1 (request .getChainId (), request .getAddress (), request .getAuthorization (), request .getTokenId ());
220+ ResponseWrapperGetNftInfo nftInfo = api .getNftInfoUsingGET1 (
221+ request .getChainId (),
222+ request .getAddress (),
223+ request .getAuthorization (),
224+ request .getTokenId ()
225+ );
226+ return NftInfo .of (nftInfo );
203227 }
204228
205229
206230 /**
207231 * Check risk of dapp through URL
208232 *
209233 * @param request DappSecurityRequest
210- * @return ResponseWrapperDappContractSecurityResponse
234+ * @return DappContractSecurity
211235 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
212236 */
213- public static ResponseWrapperDappContractSecurityResponse dappSecurity (DappSecurityRequest request ) throws ApiException {
237+ public static DappContractSecurity dappSecurity (DappSecurityRequest request ) throws ApiException {
214238 DappControllerApi api = new DappControllerApi ();
215239 if (request .getTimeout ()!=null ){
216240 api .setApiClient (createApiClient (request .getTimeout ()));
217241 }
218242
219- return api .getDappInfoUsingGET (
243+ ResponseWrapperDappContractSecurityResponse response = api .getDappInfoUsingGET (
220244 request .getAuthorization (),
221245 request .getUrl ()
222246 );
247+ return DappContractSecurity .of (response );
223248 }
224249
225250
226251 /**
227252 * Check if the url is a phishing site
228253 *
229254 * @param request PhishingSiteRequest
230- * @return ResponseWrapperPhishingSite
255+ * @return PhishingSite
231256 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
232257 */
233- public static ResponseWrapperPhishingSite phishingSite (PhishingSiteRequest request ) throws ApiException {
258+ public static PhishingSite phishingSite (PhishingSiteRequest request ) throws ApiException {
234259 WebsiteControllerApi api = new WebsiteControllerApi ();
235260 if (request .getTimeout ()!=null ){
236261 api .setApiClient (createApiClient (request .getTimeout ()));
237262 }
238- return api .phishingSiteUsingGET (request .getUrl (), request .getAuthorization ());
263+ ResponseWrapperPhishingSite response = api .phishingSiteUsingGET (request .getUrl (), request .getAuthorization ());
264+ return PhishingSite .of (response );
239265 }
240266
241267 /**
242268 * Rug-pull Detection API Beta
243269 *
244270 * @param request DefiInfoRequest
245- * @return ResponseWrapperGetDefiInfo
271+ * @return DefiInfo
246272 * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
247273 */
248- public static ResponseWrapperGetDefiInfo rugpullDetecting (DefiInfoRequest request ) throws ApiException {
274+ public static DefiInfo rugpullDetecting (DefiInfoRequest request ) throws ApiException {
249275 DefiControllerApi api = new DefiControllerApi ();
250276 if (request .getTimeout ()!=null ){
251277 api .setApiClient (createApiClient (request .getTimeout ()));
252278 }
253- return api .getDefiInfoUsingGET (request .getAddress (), request .getChainId (), request .getAuthorization ());
279+ GetDefiInfoResponse defiInfoUsingGET = api .getDefiInfoUsingGET (
280+ request .getAddress (),
281+ request .getChainId (),
282+ request .getAuthorization ()
283+ );
284+ return DefiInfo .of (defiInfoUsingGET );
254285 }
255286
256287
0 commit comments