Skip to content

Commit

Permalink
Merge pull request #11 from negi-grass/feature-coincheck
Browse files Browse the repository at this point in the history
Support coincheck
  • Loading branch information
negi-grass authored Jan 23, 2023
2 parents a683a56 + 800c1d4 commit be5a85b
Show file tree
Hide file tree
Showing 11 changed files with 508 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ autoexamples = false
all-features = true

[features]
full = ["binance", "bitflyer", "bybit"]
full = ["binance", "bitflyer", "bybit", "coincheck"]
binance = ["dep:crypto-botters-binance"]
bitflyer = ["dep:crypto-botters-bitflyer"]
bybit = ["dep:crypto-botters-bybit"]
coincheck = ["dep:crypto-botters-coincheck"]

[dependencies]
generic-api-client = { version = "0.1", path = "generic-api-client" }
crypto-botters-api = { version = "0.1", path = "crypto-botters-api" }
crypto-botters-binance = { version = "0.3", path = "crypto-botters-binance", optional = true }
crypto-botters-bitflyer = { version = "0.3", path = "crypto-botters-bitflyer", optional = true }
crypto-botters-bybit = { version = "0.1", path = "crypto-botters-bybit", optional = true }
crypto-botters-coincheck = { version = "0.1", path = "crypto-botters-coincheck", optional = true }

[dev-dependencies]
crypto-botters = { path = ".", features = ["full"] }
Expand Down Expand Up @@ -139,3 +141,15 @@ path = "examples/bybit/bybit_spot_v3_websocket_public.rs"
[[example]]
name = "bybit_spot_v3_websocket_private"
path = "examples/bybit/bybit_spot_v3_websocket_private.rs"

[[example]]
name = "coincheck_http_public"
path = "examples/coincheck/coincheck_http_public.rs"

[[example]]
name = "coincheck_http_private"
path = "examples/coincheck/coincheck_http_private.rs"

[[example]]
name = "coincheck_websocket_public"
path = "examples/coincheck/coincheck_websocket_public.rs"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ you would pass an array of `BybitOption`s.
Some options are the same across requests. For example, you will probably use the same API key for each request.
For those options, you can set **default options** for `Client`. Default options are applied to all requests.

In the above example, `client.default_option(BinanceOption::Key(key));` sets the option for Binance API key as a default option.
In the above example, `client.update_default_option(BinanceOption::Key(key));` sets the option for Binance API key as a default option.
Because of this, passing an option for API key in `post_no_body()` is not required.

### Response type
Expand Down Expand Up @@ -235,7 +235,7 @@ async fn main() {
そのようなオプションは**デフォルトオプション**として`Client`に設定できます。デフォルトオプションは、その`Client`
使って送られるすべてのリクエストに適用されます。

この例では、`client.default_option(BinanceOption::Key(key));`でAPIキーのオプションをデフォルトオプションとして設定
この例では、`client.update_default_option(BinanceOption::Key(key));`でAPIキーのオプションをデフォルトオプションとして設定
しています。このため、`post_no_body()`にAPIキーのオプションを指定する必要がなくなっています。

### レスポンスの型
Expand Down
1 change: 0 additions & 1 deletion crypto-botters-bitflyer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ where
let error = match serde_json::from_slice(&response_body) {
Ok(parsed_error) => BitFlyerHandlerError::ApiError(parsed_error),
Err(error) => {
dbg!(response_body);
log::error!("Failed to parse error response due to an error: {}", error);
BitFlyerHandlerError::ParseError
}
Expand Down
24 changes: 24 additions & 0 deletions crypto-botters-coincheck/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "crypto-botters-coincheck"
version = "0.1.0"
authors = ["negi_grass"]
edition = "2021"
description = "A crate for interacting with the coincheck API."
license = "MIT"
readme = "README.md"
homepage = "https://github.com/negi-grass/crypto-botters"
documentation = "https://docs.rs/crypto-botters-coincheck"
repository = "https://github.com/negi-grass/crypto-botters"
keywords = ["cryptocurrency", "coincheck", "trading", "client", "websocket"]
categories = ["api-bindings", "asynchronous", "cryptography::cryptocurrencies", "authentication"]

[dependencies]
generic-api-client = { version = "0.1", path = "../generic-api-client" }
crypto-botters-api = { version = "0.1", path = "../crypto-botters-api" }
serde = { version = "1.0.151", features = ["derive"] }
serde_json = "1.0.91"
serde_urlencoded = "0.7.1"
hmac = "0.12.1"
sha2 = "0.10.6"
hex = "0.4.3"
log = "0.4.17"
9 changes: 9 additions & 0 deletions crypto-botters-coincheck/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
日本語は下にあります

# English
This crate is meant to be used by crates of the [crypto-botters project](https://github.com/negi-grass/crypto-botters),
and you should not directly use this crate. Use [crypto-botters](https://crates.io/crates/crypto-botters).

# 日本語
このクレートは[crypto-botters プロジェクト](https://github.com/negi-grass/crypto-botters)のクレートが使うためのものです。
このクレートは直接使わず、[crypto-botters](https://crates.io/crates/crypto-botters)を使うようにしてください。
Loading

0 comments on commit be5a85b

Please sign in to comment.