Comments (5)
Sure, I'm not currently using futures but it shouldn't be hard to add.
from binance-rs-async.
Here : #4
You can use it but I haven't tested every endpoint for now.
from binance-rs-async.
Didn't see that everything started requiring tokio, I updated the examples accordingly.
The examples are passing so I see no reason to not merge into master. Let me know if you need anymore patches.
from binance-rs-async.
Thank you. But, I am getting runtime panic for this code
use binance::api::*;
use binance::futures::general::*;
use futures::executor::block_on;
async fn get_all_symbols() {
let general: FuturesGeneral = Binance::new(None, None);
match general.exchange_info().await {
Ok(answer) => println!("Exchange information: {:?}", answer),
Err(e) => println!("Error: {:?}", e),
}
}
fn main() {
block_on(get_all_symbols());
}
thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x
runtime', ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.7.0/src/runtime/blocking/pool.rs:84:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
from binance-rs-async.
I solved that by adding tokio = { version = "1", features = ["full"] }
to dependencies and making these changes
use binance::api::*;
use binance::futures::general::*;
use futures::executor::block_on;
+use tokio;
async fn get_all_symbols() {
let general: FuturesGeneral = Binance::new(None, None);
match general.exchange_info().await {
Ok(answer) => println!("Exchange information: {:?}", answer),
Err(e) => println!("Error: {:?}", e),
}
}
+#[tokio::main]
+async fn async_main() {
+
+ block_on(get_all_symbols());
+
+}
fn main() {
- block_on(get_all_symbols());
+ async_main();
}
from binance-rs-async.
Related Issues (20)
- Stop Loss Orders & Take Profit Orders for futures HOT 3
- NOT working - get_exchange_info HOT 1
- Futures API HOT 2
- not support COIN-M Futures
- Change in API caused deserialization to break model HOT 1
- To support proxy connection to binance websocket HOT 6
- Fix: wallet api bugs HOT 12
- Margin Account cancel_all_orders on open OCO order yields MarginOCOOrderResult instead of MarginOrderCancellationResult HOT 6
- add PartialEq on OrderStatus and similar types HOT 1
- errors while using the wallet feature? HOT 2
- Is futures websocket stream not implemented? HOT 10
- futures position_information implementation HOT 1
- The GET method internally creates a new `reqwest::Client` each time.
- Configure timeout of the client. HOT 5
- Dependency Dashboard
- Proxy support? HOT 11
- Version 1.3.2 didn't match with the available ones HOT 2
- Signature for this request in not valid HOT 2
- How to solve recvWindow error?
- tokio-tungstenite updating to version 0.20 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binance-rs-async.