gatecoin 0.2.0 → 0.3.0

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: 4a0969c603a4a025eedb725059b4a48c9745e94f
4
- data.tar.gz: 2c57e04ecc52294b2b669eab238fd022e33c6fa6
3
+ metadata.gz: 24a4d48abc6f4da304b42d43e67f543bbb7293dd
4
+ data.tar.gz: a393825653c8a1b4472b27b782492d204dd18856
5
5
  SHA512:
6
- metadata.gz: e99a4c6e28dfa628830fa71866d04b2aca5251e51e85b5d01d0de4c4844266bc43ee1210893880277b8640a26e3622127fa5da4cbca3ff8147dca08ba3e1799d
7
- data.tar.gz: 8731fe5cf1867513b6b99771ce42657a1eebe32a0f0601ee99a9ff370821c455e863de84559f09b3c04073f5fbb87a7a1048dce83a01cf19339b39917d87157d
6
+ metadata.gz: 504f209cbc48d827d5f562c7014bc069a36871d91a9f15b8c29a043b6699cc53790f9334569b0d43f50408a451991b3c306c6d1a298e5722e5c4ad5fd383705d
7
+ data.tar.gz: ffb8ee2ee15295b0b61a06565be36f10783f607d51184e800f6213721900a1ce3f3affb4958a168cf6cc8106b96ca2d14b26ee821a172e4def28adb38052b09a
@@ -1,4 +1,5 @@
1
1
  module Gatecoin
2
2
  class CreateOrderException < RuntimeError; end
3
3
  class CancelOrderException < RuntimeError; end
4
+ class WithdrawalException < RuntimeError; end
4
5
  end
@@ -71,6 +71,26 @@ module Gatecoin
71
71
  addresses['addresses']
72
72
  end
73
73
 
74
+ def withdrawal(currency:, address:, amount:, comment: nil, validation: nil)
75
+ opts = {
76
+ AddressName: address,
77
+ Amount: amount,
78
+ }
79
+
80
+ opts[:Comment] = comment if comment
81
+ opts[:ValidationCode] = validation if validation
82
+
83
+ status = post("/ElectronicWallet/withdrawals/#{currency}", opts)
84
+
85
+ if status['responseStatus'] && status['responseStatus']['errorCode']
86
+ error = status['responseStatus']['message']
87
+ error ||= status['responseStatus']
88
+ raise Gatecoin::WithdrawalException.new(error)
89
+ end
90
+
91
+ status
92
+ end
93
+
74
94
  private
75
95
 
76
96
  def signature(timestamp, verb, content_type, path)
@@ -2,5 +2,5 @@
2
2
  # Primary module for this gem.
3
3
  module Gatecoin
4
4
  # Current Gatecoin version.
5
- VERSION = '0.2.0'.freeze
5
+ VERSION = '0.3.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatecoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Fernandez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-30 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler