package top.baogutang.admin.config;

import com.binance.connector.client.SpotClient;
import com.binance.connector.client.WebSocketStreamClient;
import com.binance.connector.client.impl.SpotClientImpl;
import com.binance.connector.client.impl.WebSocketStreamClientImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.baogutang.common.properties.MarketCandlersProperties;

import javax.annotation.Resource;

/**
 * @description:
 * @author: nikooh
 * @date: 2024/08/23 : 15:45
 */
@Configuration
public class SpotClientConfiguration {

    @Resource
    private MarketCandlersProperties marketCandlersProperties;

    @Bean(name = "spotClient")
    public SpotClient spotClient() {
        return new SpotClientImpl(marketCandlersProperties.getApiKey(),
                marketCandlersProperties.getApiSecret());
    }

    @Bean(name = "webSocketStreamClient")
    public WebSocketStreamClient webSocketStreamClient() {
        return new WebSocketStreamClientImpl();
    }
}
