kaesen 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0981851f6c0c3632b9b25e0228646cd22da6f4dd
4
- data.tar.gz: 3169b9611d6f37c1e963b1d1973338395b57aad3
3
+ metadata.gz: e5b1cd42537e9ba5277bb7c27ba333331e3cb261
4
+ data.tar.gz: 13247c95cc7722a14c051277deb30416284ee74a
5
5
  SHA512:
6
- metadata.gz: 6a1251de775dd42b64ea9914ea40a39aaad252a5bffc0fed0f26ab4c7ec8d213b597510281d0ffbb2f4846081befe8b517b4da645e6d2456383d7df71ef8a6bf
7
- data.tar.gz: 5f1d81cb4cbd759c4a5ac89a8d62e6ad3d5bc2f5ca7865040401c5598ca395fbf9dbbd1f28c7f1640d2714055eb3b2f06fe6e54c81479423f72f082129d9000b
6
+ metadata.gz: a508dbef6da2bc575902aa72aec55f7cb07e92654a6ebccf017f15a2029a7c1df7cdc6b2ef22709604735eaa35e1c88bef86eaef9b9f441691c784ab9cb5644c
7
+ data.tar.gz: 6065eb0d89d374d926b8caa35c6cdf17ac4aebae882416175b38b669fc1ee596441f1225f1afd4e0b76b704c24c2fbefb9e8bbdb35a5da36f503bf2261208aed
data/.gitignore CHANGED
@@ -42,3 +42,51 @@ build/
42
42
 
43
43
  .rbenv-gemsets
44
44
 
45
+ ### https://raw.github.com/github/gitignore/2664dad61f3fda7755acc70ceb5aac4b1e956981/Global/JetBrains.gitignore
46
+
47
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
48
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
49
+
50
+ # User-specific stuff:
51
+ .idea/workspace.xml
52
+ .idea/tasks.xml
53
+ .idea/dictionaries
54
+ .idea/vcs.xml
55
+ .idea/jsLibraryMappings.xml
56
+
57
+ # Sensitive or high-churn files:
58
+ .idea/dataSources.ids
59
+ .idea/dataSources.xml
60
+ .idea/dataSources.local.xml
61
+ .idea/sqlDataSources.xml
62
+ .idea/dynamic.xml
63
+ .idea/uiDesigner.xml
64
+
65
+ # Gradle:
66
+ .idea/gradle.xml
67
+ .idea/libraries
68
+
69
+ # Mongo Explorer plugin:
70
+ .idea/mongoSettings.xml
71
+
72
+ ## File-based project format:
73
+ *.iws
74
+
75
+ ## Plugin-specific files:
76
+
77
+ # IntelliJ
78
+ /out/
79
+
80
+ # mpeltonen/sbt-idea plugin
81
+ .idea_modules/
82
+
83
+ # JIRA plugin
84
+ atlassian-ide-plugin.xml
85
+
86
+ # Crashlytics plugin (for Android Studio and IntelliJ)
87
+ com_crashlytics_export_strings.xml
88
+ crashlytics.properties
89
+ crashlytics-build.properties
90
+ fabric.properties
91
+
92
+ .idea/*
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kaesen (0.1.0)
4
+ kaesen (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -33,5 +33,8 @@ DEPENDENCIES
33
33
  rake (~> 10.0)
34
34
  rspec (~> 3.0)
35
35
 
36
+ RUBY VERSION
37
+ ruby 2.2.5p319
38
+
36
39
  BUNDLED WITH
37
- 1.11.2
40
+ 1.12.5
data/README.md CHANGED
@@ -18,7 +18,10 @@ Then, run bundler:
18
18
 
19
19
  ```
20
20
  require 'kaesen'
21
- b = Kaesen::Bitflyer.new()
21
+ b = Kaesen::Bitflyer.new do |config|
22
+ config.api_key = "XXX"
23
+ config.api_secret = "YYY"
24
+ end
22
25
  b.ticker
23
26
  ```
24
27
 
@@ -7,15 +7,15 @@ require 'bigdecimal'
7
7
 
8
8
  module Kaesen
9
9
  # BitFlyer Wrapper Class
10
- # https://coincheck.jp/documents/exchange/api?locale=ja
10
+ # https://lightning.bitflyer.jp/docs?lang=ja
11
11
  ## API制限
12
12
  ## . Private API は 1 分間に約 200 回を上限とします。
13
13
  ## . IP アドレスごとに 1 分間に約 500 回を上限とします。
14
-
14
+
15
15
  class Bitflyer < Market
16
16
  @@nonce = 0
17
17
 
18
- def initialize()
18
+ def initialize(options = {})
19
19
  super()
20
20
  @name = "BitFlyer"
21
21
  @api_key = ENV["BITFLYER_KEY"]
@@ -23,6 +23,11 @@ module Kaesen
23
23
  @url_public = "https://api.bitflyer.jp/v1"
24
24
  @url_private = @url_public
25
25
  @product_code = "BTC_JPY"
26
+
27
+ options.each do |key, value|
28
+ instance_variable_set("@#{key}", value)
29
+ end
30
+ yield(self) if block_given?
26
31
  end
27
32
 
28
33
  #############################################################
@@ -7,16 +7,21 @@ require 'bigdecimal'
7
7
 
8
8
  module Kaesen
9
9
  # BitFlyer FX Wrapper Class
10
- # https://coincheck.jp/documents/exchange/api?locale=ja
10
+ # https://lightning.bitflyer.jp/docs?lang=ja
11
11
  ## API制限
12
12
  ## . Private API は 1 分間に約 200 回を上限とします。
13
13
  ## . IP アドレスごとに 1 分間に約 500 回を上限とします。
14
-
14
+
15
15
  class Bitflyerfx < Bitflyer
16
- def initialize
16
+ def initialize(options = {})
17
17
  super()
18
18
  @name = "BitFlyerFX"
19
19
  @product_code = "FX_BTC_JPY"
20
+
21
+ options.each do |key, value|
22
+ instance_variable_set("@#{key}", value)
23
+ end
24
+ yield(self) if block_given?
20
25
  end
21
26
 
22
27
  def balance
@@ -11,13 +11,18 @@ module Kaesen
11
11
  class Btcbox < Market
12
12
  @@nonce = 0
13
13
 
14
- def initialize()
14
+ def initialize(options = {})
15
15
  super()
16
16
  @name = "BtcBox"
17
17
  @api_key = ENV["BTCBOX_KEY"]
18
18
  @api_secret = ENV["BTCBOX_SECRET"]
19
19
  @url_public = "https://www.btcbox.co.jp/api/v1"
20
20
  @url_private = @url_public
21
+
22
+ options.each do |key, value|
23
+ instance_variable_set("@#{key}", value)
24
+ end
25
+ yield(self) if block_given?
21
26
  end
22
27
 
23
28
  #############################################################
@@ -6,18 +6,23 @@ require 'bigdecimal'
6
6
 
7
7
  module Kaesen
8
8
  # Coincheck Wrapper Class
9
- # https://coincheck.jp/documents/exchange/api?locale=ja
9
+ # https://coincheck.com/documents/exchange/api?locale=ja
10
10
 
11
11
  class Coincheck < Market
12
12
  @@nonce = 0
13
13
 
14
- def initialize()
14
+ def initialize(options = {})
15
15
  super()
16
16
  @name = "Coincheck"
17
17
  @api_key = ENV["COINCHECK_KEY"]
18
18
  @api_secret = ENV["COINCHECK_SECRET"]
19
- @url_public = "https://coincheck.jp"
19
+ @url_public = "https://coincheck.com"
20
20
  @url_private = @url_public
21
+
22
+ options.each do |key, value|
23
+ instance_variable_set("@#{key}", value)
24
+ end
25
+ yield(self) if block_given?
21
26
  end
22
27
 
23
28
  #############################################################
@@ -11,13 +11,18 @@ module Kaesen
11
11
  class Kraken < Market
12
12
  @@nonce = 0
13
13
 
14
- def initialize()
14
+ def initialize(options = {})
15
15
  super()
16
16
  @name = "Kraken"
17
17
  @api_key = ENV["KRAKEN_KEY"]
18
18
  @api_secret = ENV["KRAKEN_SECRET"]
19
19
  @url_public = "https://api.kraken.com/0/public"
20
20
  @url_private = "https://api.kraken.com/0/private"
21
+
22
+ options.each do |key, value|
23
+ instance_variable_set("@#{key}", value)
24
+ end
25
+ yield(self) if block_given?
21
26
  end
22
27
 
23
28
  #############################################################
@@ -11,13 +11,18 @@ module Kaesen
11
11
  class Lakebtc < Market
12
12
  @@nonce = 0
13
13
 
14
- def initialize()
14
+ def initialize(options = {})
15
15
  super()
16
16
  @name = "Lakebtc"
17
17
  @api_key = ENV["LAKEBTC_KEY"]
18
18
  @api_secret = ENV["LAKEBTC_SECRET"]
19
19
  @url_public = "https://www.LakeBTC.com/api_v1"
20
20
  @url_private = @url_public
21
+
22
+ options.each do |key, value|
23
+ instance_variable_set("@#{key}", value)
24
+ end
25
+ yield(self) if block_given?
21
26
  end
22
27
 
23
28
  #############################################################
@@ -4,6 +4,7 @@ module Kaesen
4
4
  # @abstract
5
5
  class Market
6
6
  attr_reader :name
7
+ attr_accessor :name, :api_key, :api_secret, :url_public, :url_private
7
8
 
8
9
  def initialize
9
10
  @name = nil # [String] name of exchange market
@@ -15,13 +15,18 @@ module Kaesen
15
15
  class Monetago < Market
16
16
  @@nonce = 0
17
17
 
18
- def initialize()
18
+ def initialize(options = {})
19
19
  super()
20
20
  @name = "Monetago"
21
21
  @api_key = ENV["MONETAGO_KEY"]
22
22
  @api_secret = ENV["MONETAGO_SECRET"]
23
23
  @url_public = "https://api.monetago.com:8400/ajax/v1"
24
24
  @url_private = @url_public
25
+
26
+ options.each do |key, value|
27
+ instance_variable_set("@#{key}", value)
28
+ end
29
+ yield(self) if block_given?
25
30
  end
26
31
 
27
32
  #############################################################
@@ -13,13 +13,18 @@ module Kaesen
13
13
  class Quoine < Market
14
14
  @@nonce = 0
15
15
 
16
- def initialize()
16
+ def initialize(options = {})
17
17
  super()
18
18
  @name = "Quoine"
19
19
  @api_key = ENV["QUOINE_KEY"]
20
20
  @api_secret = ENV["QUOINE_SECRET"]
21
21
  @url_public = "https://api.quoine.com"
22
22
  @url_private = @url_public
23
+
24
+ options.each do |key, value|
25
+ instance_variable_set("@#{key}", value)
26
+ end
27
+ yield(self) if block_given?
23
28
  end
24
29
 
25
30
  #############################################################
@@ -1,3 +1,3 @@
1
1
  module Kaesen
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -12,13 +12,18 @@ module Kaesen
12
12
  class Zaif < Market
13
13
  @@nonce = 0
14
14
 
15
- def initialize()
15
+ def initialize(options = {})
16
16
  super()
17
17
  @name = "Zaif"
18
18
  @api_key = ENV["ZAIF_KEY"]
19
19
  @api_secret = ENV["ZAIF_SECRET"]
20
20
  @url_public = "https://api.zaif.jp/api/1"
21
21
  @url_private = "https://api.zaif.jp/tapi"
22
+
23
+ options.each do |key, value|
24
+ instance_variable_set("@#{key}", value)
25
+ end
26
+ yield(self) if block_given?
22
27
  end
23
28
 
24
29
  #############################################################
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaesen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - him0
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-20 00:00:00.000000000 Z
11
+ date: 2016-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler