public class AuthenticationInterceptor extends Object implements okhttp3.Interceptor
| 构造器和说明 |
|---|
AuthenticationInterceptor(String apiKey,
String secret,
String passPhrase,
Integer apiKeyVersion)
Constructor of API - keys are loaded from VM options, environment variables, resource files
|
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
genSignature(okhttp3.Request request,
String apiSecret,
String timestamp)
Generates signature info.
|
static String |
getRequestBody(okhttp3.Request request)
Get http request body info.
|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain) |
protected void |
validateCredentials()
Validation we have API keys set up
|
public AuthenticationInterceptor(String apiKey, String secret, String passPhrase, Integer apiKeyVersion)
apiKey - The API key.secret - The API secret.passPhrase - The API passphrase.KucoinApiException - in case of any errorprotected void validateCredentials()
throws KucoinApiException
KucoinApiException - in case of any errorpublic okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
intercept 在接口中 okhttp3.InterceptorIOExceptionpublic static String genSignature(okhttp3.Request request, String apiSecret, String timestamp)
request - The HTTP request.apiSecret - API secret.timestamp - Timestamp.public static String getRequestBody(okhttp3.Request request)
request - The requestCopyright © 2023. All rights reserved.