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

org.knowm.xchange.examples.binance.BinanceDemoUtils Maven / Gradle / Ivy

Go to download

Provides a set of examples that demonstrate how to use XChange in client applications

The newest version!
package org.knowm.xchange.examples.binance;

import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.binance.BinanceExchange;

public class BinanceDemoUtils {

  public static Exchange createExchange() {

    Exchange exchange = ExchangeFactory.INSTANCE.createExchange(BinanceExchange.class);
    ExchangeSpecification binanceSpec = exchange.getDefaultExchangeSpecification();

    binanceSpec.setApiKey("");
    binanceSpec.setSecretKey("");
    binanceSpec.setExchangeSpecificParametersItem("Portfolio_Margin_Enabled", true);

    exchange.applySpecification(binanceSpec);

    return exchange;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy