binance-exchange / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
MIT License
831 stars 628 forks source link

testnet streaming fails #379

Closed jnorthrup closed 3 years ago

jnorthrup commented 3 years ago

this is kotlin on jvm.

class Fail {
    fun go(){    val bFac = BinanceApiClientFactory.newInstance( true,   /*testnetstreaming */    **_true_** )
        val traderClient = bFac.newRestClient()
    }
}

fun main() {
Fail().go()
}

this is the output


Exception in thread "main" java.lang.IllegalArgumentException: Illegal URL: wss://testnet.binance.vision/stream
    at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:456)
    at com.binance.api.client.impl.BinanceApiServiceGenerator.createService(BinanceApiServiceGenerator.java:67)
    at com.binance.api.client.impl.BinanceApiRestClientImpl.<init>(BinanceApiRestClientImpl.java:27)
    at com.binance.api.client.BinanceApiClientFactory.newRestClient(BinanceApiClientFactory.java:101)
    at com.fnreport.org.bereft.Fail.go(Fail.kt:8)
    at com.fnreport.org.bereft.FailKt.main(Fail.kt:13)
    at com.fnreport.org.bereft.FailKt.main(Fail.kt)

F.A.Q. How can I use the Spot Test Network? Step 1: Log in on this website, and generate an API Key.

Step 2: Follow the official documentation of the Spot API, replacing the URLs of the endpoints with the following values:

Spot API URL Spot Test Network URL https://api.binance.com/api https://testnet.binance.vision/api wss://stream.binance.com:9443/ws wss://testnet.binance.vision/ws wss://stream.binance.com:9443/stream wss://testnet.binance.vision/stream

joaopsilva commented 3 years ago

Fixed.