All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kucoin.sdk.rest.adapter.WithdrawalAPIAdapter Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2019 Mek Global Limited.
 */
package com.kucoin.sdk.rest.adapter;

import com.kucoin.sdk.rest.impl.retrofit.AuthRetrofitAPIImpl;
import com.kucoin.sdk.rest.interfaces.WithdrawalAPI;
import com.kucoin.sdk.rest.interfaces.retrofit.WithdrawalAPIRetrofit;
import com.kucoin.sdk.rest.request.WithdrawApplyRequest;
import com.kucoin.sdk.rest.response.Pagination;
import com.kucoin.sdk.rest.response.WithdrawApplyResponse;
import com.kucoin.sdk.rest.response.WithdrawQuotaResponse;
import com.kucoin.sdk.rest.response.WithdrawResponse;

import java.io.IOException;

/**
 * Created by chenshiwei on 2019/1/15.
 */
public class WithdrawalAPIAdapter extends AuthRetrofitAPIImpl implements WithdrawalAPI {

    public WithdrawalAPIAdapter(String baseUrl, String apiKey, String secret, String passPhrase) {
        this.baseUrl = baseUrl;
        this.apiKey = apiKey;
        this.secret = secret;
        this.passPhrase = passPhrase;
    }

    @Override
    public WithdrawQuotaResponse getWithdrawQuotas(String currency) throws IOException {
        return super.executeSync(getAPIImpl().getWithdrawQuotas(currency));
    }

    @Override
    public WithdrawApplyResponse applyWithdraw(WithdrawApplyRequest request) throws IOException {
        return super.executeSync(getAPIImpl().applyWithdraw(request));
    }

    @Override
    public void cancelWithdraw(String withdrawalId) throws IOException {
        super.executeSync(getAPIImpl().cancelWithdraw(withdrawalId));
    }

    @Override
    public Pagination getWithdrawList(String currency, String status, long startAt, long endAt, int currentPage, int pageSize) throws IOException {
        return super.executeSync(getAPIImpl().getWithdrawPageList(currentPage, pageSize, currency, status, startAt, endAt));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy