cyberarbitarge / binance.rs Goto Github PK
View Code? Open in Web Editor NEWbinance rust connector
License: Apache License 2.0
binance rust connector
License: Apache License 2.0
At a glance, the template code is below
#[derive(Debug, RestApi, Default)]
#[rest(uri="rest_api/path")
#[rest(method="GET")
#[rest(signature="USER_DATA")]
pub struct SomeRestApiName {
// we belive that every field should implement the Default trait as default value
// else use Option as optional semantic
field1: String,
field2: Option<i32>,
// other fields
}
Then we should get the api class with builder as below:
impl RestApi for SomeRestApiName {
fn uri(&self) -> String { // return the uri in attribute }
fn method(&self) -> reqwest::Method { // return the method in attribute }
fn wait_to_sign(&self) -> Option<String> {
// hmacsha256 for USER_DATA in binance defined
}
fn query() -> Option<String>
fn body() -> Option<String>
}
impl SomeRestApiName {
pub fn new() -> Self; // Default ?
pub fn field1(mut self, type) -> Self;
pub fn field2(mut self, type) -> Self;
}
So we could use this directly in Client look like this
async fn main() {
async {
let mut request = SomeRestApiName::new()
.field1(xxxx)
.field2(xxx);
client.execute(&request).unwrap();
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.