coinpayments 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .ruby-version
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in coinpayments.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Przemysław Janowski
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,70 @@
1
+ # CoinPayments.net API ruby gem
2
+
3
+ This is a convenient wrapper around CoinPayments.net API (https://www.coinpayments.net/merchant-tools-api).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'coinpayments'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install coinpayments
18
+
19
+ ## Configuration
20
+
21
+ Before using this gem you have to set your Merchant ID and public/private API key pair, which can be accessed on your account at CoinPayments.net.
22
+
23
+ If you are using Rails, simply generate a new config file, like so:
24
+
25
+ $ rails generate coinpayments:install
26
+
27
+ Configuration file can now be accessed at config/initializers/coinpayments.rb:
28
+
29
+ ```
30
+ Coinpayments.configure do |config|
31
+ config.merchant_id = ''
32
+ config.public_api_key = ''
33
+ config.private_api_key = ''
34
+ end
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ - All method and field names are identical to official API documentation: https://www.coinpayments.net/merchant-tools-api.
40
+ - Main required fields are appended to each call you make automatically.
41
+ - Method required paramteres must be appended as method attributes.
42
+ - Optional paramteres can be appended as an option hash
43
+ - Call response is a Hashie::Mash instance, so you can access response hash parameters as method calls. For example, to quicly access BTC/USD exchange rate, use:
44
+
45
+ `Coinpayments.rates.USD.rate_btc`
46
+
47
+ ## Examples
48
+
49
+ - Check current exchange rates:
50
+
51
+ `Coinpayments.rates`
52
+
53
+ - Check for cryptocurrencies you accept on your account:
54
+
55
+ `Coinpayments.rates(accepted: 1).delete_if {|k, v| v["accepted"] == 0}.keys`
56
+
57
+ - Create a transaction for $10 that must be payed using BTC, and display an address to the user:
58
+
59
+ ```
60
+ transaction = Coinpayments.create_transaction(10, 'USD', 'BTC')
61
+ @address = transaction.address
62
+ ```
63
+
64
+ ## Contributing
65
+
66
+ 1. Fork it ( https://github.com/Salet/coinpayments/fork )
67
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
68
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
69
+ 4. Push to the branch (`git push origin my-new-feature`)
70
+ 5. Create a new Pull Request
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.test_files = FileList['test/*test.rb']
6
+ end
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'coinpayments/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "coinpayments"
8
+ spec.version = Coinpayments::VERSION
9
+ spec.authors = ["Przemysław Janowski"]
10
+ spec.email = ["przemyslaw.janowski@outlook.com"]
11
+ spec.summary = "Convenient wrapper around CoinPayments.net API."
12
+ spec.homepage = "https://github.com/Salet/coinpayments"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.6"
21
+ spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "pry"
23
+ spec.add_development_dependency "minitest"
24
+ spec.add_development_dependency "vcr"
25
+ spec.add_development_dependency "webmock"
26
+
27
+ spec.add_dependency "httparty", "~> 0.13.1"
28
+ spec.add_dependency "hashie"
29
+ end
@@ -0,0 +1,68 @@
1
+ require_relative "coinpayments/version"
2
+ require_relative "coinpayments/configuration"
3
+ require "hashie/mash"
4
+ require "httparty"
5
+
6
+
7
+ module Coinpayments
8
+
9
+ class << self
10
+ attr_accessor :configuration
11
+ end
12
+
13
+ public
14
+ def self.configure
15
+ yield(configuration) if block_given?
16
+ end
17
+
18
+
19
+ private
20
+ def self.configuration
21
+ @configuration ||= Configuration.new
22
+ end
23
+
24
+ def self.required_params
25
+ { version: configuration.version, key: configuration.public_api_key }
26
+ end
27
+
28
+ def self.hmac(body)
29
+ OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha512'), configuration.private_api_key, HTTParty::HashConversions.to_params(body))
30
+ end
31
+
32
+ def self.api_call(args)
33
+ body = required_params.merge!(cmd: caller[0][/`.*'/][1..-2]).merge!(args)
34
+ response = HTTParty.post(configuration.base_uri, body: body, headers: {'hmac' => hmac(body)})
35
+ response['error'] == 'ok' ? Hashie::Mash.new(response['result']) : response['error']
36
+ end
37
+
38
+
39
+ public
40
+ def self.rates(options = {})
41
+ api_call(options)
42
+ end
43
+
44
+ def self.balances(options = {})
45
+ api_call(options)
46
+ end
47
+
48
+ def self.create_transaction(amount, currency1, currency2, options = {})
49
+ args = { amount: amount, currency1: currency1, currency2: currency2 }.merge!(options)
50
+ api_call(args)
51
+ end
52
+
53
+ def self.create_withdrawal(amount, currency, address, options = {})
54
+ args = { amount: amount, currency: currency, address: address }.merge!(options)
55
+ api_call(args)
56
+ end
57
+
58
+ def self.get_tx_info(txid)
59
+ args = { txid: txid }
60
+ api_call(args)
61
+ end
62
+
63
+ def self.get_withdrawal_info(id)
64
+ args = { id: id }
65
+ api_call(args)
66
+ end
67
+
68
+ end
@@ -0,0 +1,13 @@
1
+ module Coinpayments
2
+ class Configuration
3
+ attr_accessor :version, :base_uri, :merchant_id, :public_api_key, :private_api_key
4
+
5
+ def initialize
6
+ @version = 1
7
+ @base_uri = 'https://www.coinpayments.net/api.php'
8
+ @merchant_id = ''
9
+ @public_api_key = ''
10
+ @private_api_key = ''
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module Coinpayments
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,10 @@
1
+ module Coinpayments
2
+ class InstallGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("../templates", __FILE__)
4
+ desc "Creates CoinPayments initializer for your application"
5
+
6
+ def copy_initializer
7
+ template "coinpayments_initializer.rb", "config/initializers/coinpayments.rb"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ Coinpayments.configure do |config|
2
+ config.merchant_id = ''
3
+ config.public_api_key = ''
4
+ config.private_api_key = ''
5
+ end
@@ -0,0 +1,52 @@
1
+ require_relative "../lib/coinpayments"
2
+ require "minitest/autorun"
3
+ require "pry"
4
+ require "webmock/minitest"
5
+ require "vcr"
6
+
7
+
8
+ class CoinpaymentsTest < Minitest::Test
9
+
10
+ VCR.configure do |c|
11
+ c.cassette_library_dir = "test/fixtures"
12
+ c.hook_into :webmock
13
+ end
14
+
15
+ def test_rates
16
+ VCR.use_cassette('rates') do
17
+ r = Coinpayments.rates
18
+ assert r.kind_of?(Hash)
19
+ assert r.respond_to?(:BTC)
20
+ end
21
+ end
22
+
23
+ def test_balances
24
+ VCR.use_cassette('balances') do
25
+ r = Coinpayments.balances
26
+ assert r.kind_of?(String)
27
+ end
28
+ end
29
+
30
+ def test_create_transaction
31
+ VCR.use_cassette('create_transaction') do
32
+ r = Coinpayments.create_transaction(1, 'GBP', 'START')
33
+ assert r.kind_of?(Hash)
34
+ assert r.respond_to?(:address)
35
+ end
36
+ end
37
+
38
+ def test_create_withdrawal
39
+ VCR.use_cassette('create_withdrawal') do
40
+ r = Coinpayments.create_withdrawal(1, 'START', 'sYo5A4vVBBV2SYbh7jPjocqg9DeNYqkP4U')
41
+ assert r.kind_of?(String)
42
+ end
43
+ end
44
+
45
+ def test_get_tx_info
46
+ VCR.use_cassette('get_tx_info') do
47
+ r = Coinpayments.get_tx_info('705565b8b8f068566fed1a71977ece30265c6e80cf7dfe854ab4a455701129bc')
48
+ assert r.kind_of?(Hash)
49
+ assert r.respond_to?(:status_text)
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.coinpayments.net/api.php
6
+ body:
7
+ encoding: US-ASCII
8
+ string: version=1&key=c51af8c4ac689987e2579a60dc1bc1354d5298837440c6f4759dff6cf9ae2f5f&cmd=balances
9
+ headers:
10
+ Hmac:
11
+ - !binary |-
12
+ Mjc1MjI2N2VlYTAwNTE4OGYwODk1YjIyOWRjYWY3NDM2MzY0NWEyNjRjNGUw
13
+ NTU0ODg4YWY0ZThjNTRkNDIwMDQwODYzMWQzMmQ3ODFmODhlZDgwOWViMmYw
14
+ ZTFiNTZmZmQyODdiYTNlYzU4NDRiODc2ZWU4YTUwMmNhYTIwMDk=
15
+ response:
16
+ status:
17
+ code: 200
18
+ message: OK
19
+ headers:
20
+ Date:
21
+ - Tue, 13 Jan 2015 13:54:49 GMT
22
+ Server:
23
+ - Apache/2.2.22 (Debian)
24
+ X-Powered-By:
25
+ - PHP/5.4.4-14+deb7u10
26
+ X-Frame-Options:
27
+ - SAMEORIGIN
28
+ Strict-Transport-Security:
29
+ - max-age=31536000
30
+ Set-Cookie:
31
+ - PHPSESSID=0c2quf9be04qa4v8k4lj804c14ecbpomqphno1a55olsca6o94e0; path=/; secure;
32
+ HttpOnly
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ Content-Disposition:
40
+ - attachment; filename=coinpayments_api.json
41
+ Content-Length:
42
+ - '48'
43
+ Content-Type:
44
+ - application/json
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ! '{"error":"Could not find any balances for you!"}'
48
+ http_version:
49
+ recorded_at: Tue, 13 Jan 2015 13:54:49 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.coinpayments.net/api.php
6
+ body:
7
+ encoding: US-ASCII
8
+ string: version=1&key=c51af8c4ac689987e2579a60dc1bc1354d5298837440c6f4759dff6cf9ae2f5f&cmd=create_transaction&amount=1&currency1=GBP&currency2=START
9
+ headers:
10
+ Hmac:
11
+ - !binary |-
12
+ YzExMTYyNzRjNzhlNmNmZGFkM2M3NjE3ZTJiOWI1NWEyNDU0NjFmM2NhMmU4
13
+ ODViZmE4Y2I3MzY0OWJlMDVhMWRjMGE0ZWUxMmNlZmZiOWQ0OGVlOGZkZTA0
14
+ NGFjZWRjYjhiMzNlOWJkMmY4YTMwMWRlMWFiMzkwY2Q2YmI0YTM=
15
+ response:
16
+ status:
17
+ code: 200
18
+ message: OK
19
+ headers:
20
+ Date:
21
+ - Tue, 13 Jan 2015 13:54:49 GMT
22
+ Server:
23
+ - Apache/2.2.22 (Debian)
24
+ X-Powered-By:
25
+ - PHP/5.4.4-14+deb7u10
26
+ X-Frame-Options:
27
+ - SAMEORIGIN
28
+ Strict-Transport-Security:
29
+ - max-age=31536000
30
+ Set-Cookie:
31
+ - PHPSESSID=6gcj16g1fn456cm9538tvn1tln9o4oentoc6r6dd0699p1os0680; path=/; secure;
32
+ HttpOnly
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ Content-Disposition:
40
+ - attachment; filename=coinpayments_api.json
41
+ Content-Length:
42
+ - '381'
43
+ Content-Type:
44
+ - application/json
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ! '{"error":"ok","result":{"amount":"5.17238838","txn_id":"705565b8b8f068566fed1a71977ece30265c6e80cf7dfe854ab4a455701129bc","address":"sYo5A4vVBBV2SYbh7jPjocqg9DeNYqkP4U","confirms_needed":"10","timeout":9000,"status_url":"https:\/\/www.coinpayments.net\/index.php?cmd=status&id=705565b8b8f068566fed1a71977ece30265c6e80cf7dfe854ab4a455701129bc&key=292651e00397dea648fa55c15d0140a9"}}'
48
+ http_version:
49
+ recorded_at: Tue, 13 Jan 2015 13:54:50 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.coinpayments.net/api.php
6
+ body:
7
+ encoding: US-ASCII
8
+ string: version=1&key=c51af8c4ac689987e2579a60dc1bc1354d5298837440c6f4759dff6cf9ae2f5f&cmd=create_withdrawal&amount=1&currency=START&address=sYo5A4vVBBV2SYbh7jPjocqg9DeNYqkP4U
9
+ headers:
10
+ Hmac:
11
+ - !binary |-
12
+ Mzk3NDNmM2Y0NzY0Y2Y0ZDk2NzI4YmQyMjFhYmJlYzBjYjE4ZTJkNDk3Yjgy
13
+ MzZkZGFiOTQ1YWNmYmIyYzQ4YjE5MTUyNjFlZmM0YzlkZTk5YjllNDcwYzY5
14
+ Yzk5MDEzYTkzYjVkNDVmOTNlNDY4MGVkYTcwMjM5ZjJjMmJhODI=
15
+ response:
16
+ status:
17
+ code: 200
18
+ message: OK
19
+ headers:
20
+ Date:
21
+ - Tue, 13 Jan 2015 14:05:36 GMT
22
+ Server:
23
+ - Apache/2.2.22 (Debian)
24
+ X-Powered-By:
25
+ - PHP/5.4.4-14+deb7u10
26
+ X-Frame-Options:
27
+ - SAMEORIGIN
28
+ Strict-Transport-Security:
29
+ - max-age=31536000
30
+ Set-Cookie:
31
+ - PHPSESSID=0mu70jagftjjr1qobaee1dt8ejfk2tiio9jrn27r13td11mvmkl1; path=/; secure;
32
+ HttpOnly
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ Content-Disposition:
40
+ - attachment; filename=coinpayments_api.json
41
+ Content-Length:
42
+ - '52'
43
+ Content-Type:
44
+ - application/json
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ! '{"error":"That amount is larger than your balance!"}'
48
+ http_version:
49
+ recorded_at: Tue, 13 Jan 2015 14:05:37 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.coinpayments.net/api.php
6
+ body:
7
+ encoding: US-ASCII
8
+ string: version=1&key=c51af8c4ac689987e2579a60dc1bc1354d5298837440c6f4759dff6cf9ae2f5f&cmd=get_tx_info&txid=705565b8b8f068566fed1a71977ece30265c6e80cf7dfe854ab4a455701129bc
9
+ headers:
10
+ Hmac:
11
+ - !binary |-
12
+ MDM0NzBlYTY1ZTI4YmE3ZWQ4ZjNkNTEwN2Y5NDY1YjgxZDk1M2RjYWMwZWQ1
13
+ NDJkNDkxZWQ3ODZjYjQ0NTlkN2YwYTRkNjY5MDdkYTljNTNiMGJkYWE3MWQx
14
+ NzI0ZjA2NTU0Mjc3MDcyNDI2NDFlOWI0YWJjMzgzOTA3MTYzMzA=
15
+ response:
16
+ status:
17
+ code: 200
18
+ message: OK
19
+ headers:
20
+ Date:
21
+ - Tue, 13 Jan 2015 14:00:08 GMT
22
+ Server:
23
+ - Apache/2.2.22 (Debian)
24
+ X-Powered-By:
25
+ - PHP/5.4.4-14+deb7u10
26
+ X-Frame-Options:
27
+ - SAMEORIGIN
28
+ Strict-Transport-Security:
29
+ - max-age=31536000
30
+ Set-Cookie:
31
+ - PHPSESSID=jnmq12lee5hd0kaf86oq29mp777ov8gv46fdn6chpfgg97vcur10; path=/; secure;
32
+ HttpOnly
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ Content-Disposition:
40
+ - attachment; filename=coinpayments_api.json
41
+ Content-Length:
42
+ - '314'
43
+ Content-Type:
44
+ - application/json
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ! '{"error":"ok","result":{"time_created":1421157290,"time_expires":1421166290,"status":0,"status_text":"Waiting
48
+ for buyer funds...","type":"coins","coin":"START","amount":517238838,"amountf":"5.17238838","received":0,"receivedf":"0.00000000","recv_confirms":0,"payment_address":"sYo5A4vVBBV2SYbh7jPjocqg9DeNYqkP4U"}}'
49
+ http_version:
50
+ recorded_at: Tue, 13 Jan 2015 14:00:08 GMT
51
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,74 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.coinpayments.net/api.php
6
+ body:
7
+ encoding: US-ASCII
8
+ string: version=1&key=c51af8c4ac689987e2579a60dc1bc1354d5298837440c6f4759dff6cf9ae2f5f&cmd=rates
9
+ headers:
10
+ Hmac:
11
+ - !binary |-
12
+ YzU4MWYwNWUxN2Y3MDc3OTllOWYzODViODViNDFkMDZlZTQxYTIwZmYyMGE4
13
+ MzkzMjg2Zjc1ZmI0MTkzMTgxNzRiOWEzODU4YWZlNTBkYzBiYTllZDUzYjk1
14
+ YTFlYTkxOTlmMWU3N2Q5YjJmMDM3ZjAxZjZhYmNjM2ZlOWUxODg=
15
+ response:
16
+ status:
17
+ code: 200
18
+ message: OK
19
+ headers:
20
+ Date:
21
+ - Tue, 13 Jan 2015 13:56:00 GMT
22
+ Server:
23
+ - Apache/2.2.22 (Debian)
24
+ X-Powered-By:
25
+ - PHP/5.4.4-14+deb7u10
26
+ X-Frame-Options:
27
+ - SAMEORIGIN
28
+ Strict-Transport-Security:
29
+ - max-age=31536000
30
+ Set-Cookie:
31
+ - PHPSESSID=ridq2d950nbmj4spviv3p6ao980j4upurpop0st43k46bnvgn491; path=/; secure;
32
+ HttpOnly
33
+ Expires:
34
+ - Thu, 19 Nov 1981 08:52:00 GMT
35
+ Cache-Control:
36
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
37
+ Pragma:
38
+ - no-cache
39
+ Content-Disposition:
40
+ - attachment; filename=coinpayments_api.json
41
+ Transfer-Encoding:
42
+ - chunked
43
+ Content-Type:
44
+ - application/json
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ! '{"error":"ok","result":{"BTC":{"is_fiat":0,"rate_btc":"1.000000000000000000000000","last_update":"1375473661","name":"Bitcoin","confirms":"2"},"LTC":{"is_fiat":0,"rate_btc":"0.006613000000000000000000","last_update":"1421156461","name":"Litecoin","confirms":"3"},"USD":{"is_fiat":1,"rate_btc":"0.004249302499709100000000","last_update":"1421156461","name":"United
48
+ States Dollar","confirms":"10"},"EUR":{"is_fiat":1,"rate_btc":"0.005046547993418600000000","last_update":"1421156461","name":"Euro","confirms":"10"},"STR":{"is_fiat":0,"rate_btc":"0.000017932500000000000000","last_update":"1421156461","name":"Stellar","confirms":"30"},"XRP":{"is_fiat":0,"rate_btc":"0.000066382951301166000000","last_update":"1421156461","name":"Ripple","confirms":"30"},"AUD":{"is_fiat":1,"rate_btc":"0.003478706503664300000000","last_update":"1421156461","name":"Australian
49
+ Dollar","confirms":"10"},"BC":{"is_fiat":0,"rate_btc":"0.000079920000000000000000","last_update":"1421156461","name":"BlackCoin","confirms":"6"},"BRL":{"is_fiat":1,"rate_btc":"0.001432238280917600000000","last_update":"1421156461","name":"Brazilian
50
+ Real","confirms":"10"},"BTC.Coinex":{"is_fiat":0,"rate_btc":"1.000000000000000000000000","last_update":"1418877661","name":"Bitcoin","confirms":"30"},"BTC.SnapSwap":{"is_fiat":0,"rate_btc":"1.000000000000000000000000","last_update":"1375473661","name":"Bitcoin","confirms":"30"},"CAD":{"is_fiat":1,"rate_btc":"0.003557197070310000000000","last_update":"1421156461","name":"Canadian
51
+ Dollar","confirms":"10"},"CAPT":{"is_fiat":0,"rate_btc":"0.000004193333333333300000","last_update":"1421156461","name":"CAPTcoin","confirms":"10"},"CGB":{"is_fiat":0,"rate_btc":"0.000216782727272730000000","last_update":"1421152861","name":"CryptogenicBullion","confirms":"6"},"CHF":{"is_fiat":1,"rate_btc":"0.004175481140461700000000","last_update":"1421156461","name":"Swiss
52
+ Franc","confirms":"10"},"CLOAK":{"is_fiat":0,"rate_btc":"0.000027755000000000000000","last_update":"1421156461","name":"CloakCoin","confirms":"10"},"CNY":{"is_fiat":1,"rate_btc":"0.000688564050581910000000","last_update":"1421156461","name":"Chinese
53
+ Yuan","confirms":"10"},"CZK":{"is_fiat":1,"rate_btc":"0.000173280656333350000000","last_update":"1421156461","name":"Czech
54
+ Koruna","confirms":"10"},"DGC":{"is_fiat":0,"rate_btc":"0.000020073333333333000000","last_update":"1421156461","name":"DigitalCoin","confirms":"6"},"DOGE":{"is_fiat":0,"rate_btc":"0.000000594285714285710000","last_update":"1421156461","name":"Dogecoin","confirms":"3"},"DRK":{"is_fiat":0,"rate_btc":"0.006108250000000000000000","last_update":"1421156461","name":"DarkCoin","confirms":"5"},"DVC":{"is_fiat":0,"rate_btc":"0.000000047575662500000000","last_update":"1421156461","name":"Devcoin","confirms":"3"},"EAC":{"is_fiat":0,"rate_btc":"0.000000030000000000000000","last_update":"1421152861","name":"Earthcoin","confirms":"12"},"FLT":{"is_fiat":0,"rate_btc":"0.000000785000000000000000","last_update":"1421156461","name":"FlutterCoin","confirms":"10"},"FTC":{"is_fiat":0,"rate_btc":"0.000041868571428571000000","last_update":"1421156461","name":"Feathercoin","confirms":"3"},"GBP":{"is_fiat":1,"rate_btc":"0.006402576300417000000000","last_update":"1421156461","name":"British
55
+ Pound","confirms":"10"},"GLD":{"is_fiat":0,"rate_btc":"0.000012327222222222000000","last_update":"1421152861","name":"Goldcoin","confirms":"4"},"HKD":{"is_fiat":1,"rate_btc":"0.000548258142058840000000","last_update":"1421156461","name":"Hong
56
+ Kong Dollar","confirms":"10"},"HTML5":{"is_fiat":0,"rate_btc":"0.000000003902676400000000","last_update":"1421156461","name":"HTMLCOIN","confirms":"10"},"HYPER":{"is_fiat":0,"rate_btc":"0.000208518333333330000000","last_update":"1421156461","name":"Hyper","confirms":"10"},"IDR":{"is_fiat":1,"rate_btc":"0.000000332546376260850000","last_update":"1421156461","name":"Indonesian
57
+ Rupiah","confirms":"10"},"JPY":{"is_fiat":1,"rate_btc":"0.000035921351194362000000","last_update":"1421156461","name":"Japanese
58
+ Yen","confirms":"10"},"KRW":{"is_fiat":1,"rate_btc":"0.000003939564136765300000","last_update":"1421156461","name":"South
59
+ Korean Won","confirms":"10"},"KTK":{"is_fiat":0,"rate_btc":"0.000001200000000000000000","last_update":"1421156461","name":"KryptKoin","confirms":"10"},"LAK":{"is_fiat":1,"rate_btc":"0.000001000000000000000000","last_update":"1421156461","name":"Laotian
60
+ Kip","confirms":"10"},"MAX":{"is_fiat":0,"rate_btc":"0.000017657500000000000000","last_update":"1421156461","name":"Maxcoin","confirms":"7"},"MEC":{"is_fiat":0,"rate_btc":"0.000057200000000000000000","last_update":"1421156461","name":"Megacoin","confirms":"7"},"MINT":{"is_fiat":0,"rate_btc":"0.000000017500000000000000","last_update":"1421156461","name":"MintCoin","confirms":"10"},"MMC":{"is_fiat":0,"rate_btc":"0.000012637500000000000000","last_update":"1421156461","name":"MemoryCoin","confirms":"4"},"MNE":{"is_fiat":0,"rate_btc":"0.000010646666666667000000","last_update":"1421156461","name":"Munne","confirms":"10"},"MXN":{"is_fiat":1,"rate_btc":"0.000293792481381930000000","last_update":"1421156461","name":"Mexican
61
+ Peso","confirms":"10"},"MYR":{"is_fiat":0,"rate_btc":"0.000000230000000000000000","last_update":"1421156461","name":"MyriadCoin","confirms":"10"},"MZC":{"is_fiat":0,"rate_btc":"0.000000428666666666670000","last_update":"1421152861","name":"MazaCoin","confirms":"10"},"NET":{"is_fiat":0,"rate_btc":"0.000000547500000000000000","last_update":"1421156461","name":"Netcoin","confirms":"12"},"NMC":{"is_fiat":0,"rate_btc":"0.002060019044438600000000","last_update":"1421156461","name":"Namecoin","confirms":"3"},"NOBL":{"is_fiat":0,"rate_btc":"0.000000065625000000000000","last_update":"1421156461","name":"NobleCoin","confirms":"8"},"NVC":{"is_fiat":0,"rate_btc":"0.001791148400000000000000","last_update":"1421152861","name":"Novacoin","confirms":"3"},"NXT":{"is_fiat":0,"rate_btc":"0.000056202222222222000000","last_update":"1421156461","name":"NXT","confirms":"30"},"NZD":{"is_fiat":1,"rate_btc":"0.003419213326995600000000","last_update":"1421156461","name":"New
62
+ Zealand Dollar","confirms":"10"},"OMC":{"is_fiat":0,"rate_btc":"0.000006238181818181800000","last_update":"1421156461","name":"OmniCoin","confirms":"6"},"PLN":{"is_fiat":1,"rate_btc":"0.001137120664036700000000","last_update":"1421156461","name":"Polska
63
+ Zloty","confirms":"10"},"PND":{"is_fiat":0,"rate_btc":"0.000000033000000000000000","last_update":"1421156461","name":"PandaCoin","confirms":"8"},"POT":{"is_fiat":0,"rate_btc":"0.000004967500000000000000","last_update":"1421156461","name":"PotCoin","confirms":"5"},"PPC":{"is_fiat":0,"rate_btc":"0.001492940000000000000000","last_update":"1421156461","name":"Peercoin","confirms":"2"},"QRK":{"is_fiat":0,"rate_btc":"0.000016490000000000000000","last_update":"1421156461","name":"Quark","confirms":"3"},"RUB":{"is_fiat":1,"rate_btc":"0.000063430516554250000000","last_update":"1421156461","name":"Russian
64
+ Ruble","confirms":"10"},"SEK":{"is_fiat":1,"rate_btc":"0.000479092781868130000000","last_update":"1421156461","name":"Swedish
65
+ Krona","confirms":"10"},"SGD":{"is_fiat":1,"rate_btc":"0.003169434274499500000000","last_update":"1421156461","name":"Singapore
66
+ Dollar","confirms":"10"},"SLG":{"is_fiat":0,"rate_btc":"0.000036167500000000000000","last_update":"1421156461","name":"Sterlingcoin","confirms":"10"},"SPT":{"is_fiat":0,"rate_btc":"0.000000511818181818180000","last_update":"1421152861","name":"Spots","confirms":"4"},"START":{"is_fiat":0,"rate_btc":"0.001237837500000000000000","last_update":"1421156461","name":"StartCOIN","confirms":"10"},"THB":{"is_fiat":1,"rate_btc":"0.000130677310809270000000","last_update":"1421156461","name":"Thai
67
+ Baht","confirms":"10"},"TIT":{"is_fiat":0,"rate_btc":"0.000002608181818181800000","last_update":"1421156461","name":"TitCoin","confirms":"10"},"TWD":{"is_fiat":1,"rate_btc":"0.000134737549044460000000","last_update":"1421156461","name":"New
68
+ Taiwan Dollar","confirms":"10"},"UNO":{"is_fiat":0,"rate_btc":"0.008697500000000000000000","last_update":"1421156461","name":"Unobtanium","confirms":"7"},"USD.SnapSwap":{"is_fiat":0,"rate_btc":"0.004249302499709100000000","last_update":"1421156461","name":"United
69
+ States Dollar","confirms":"30"},"VIA":{"is_fiat":0,"rate_btc":"0.000101475714285710000000","last_update":"1421156461","name":"Viacoin","confirms":"10"},"VRC":{"is_fiat":0,"rate_btc":"0.000035050909090909000000","last_update":"1421156461","name":"VeriCoin","confirms":"10"},"VTC":{"is_fiat":0,"rate_btc":"0.000056957142857143000000","last_update":"1421156461","name":"Vertcoin","confirms":"7"},"WDC":{"is_fiat":0,"rate_btc":"0.000023838571428571000000","last_update":"1421156461","name":"Worldcoin","confirms":"6"},"XPM":{"is_fiat":0,"rate_btc":"0.000234060000000000000000","last_update":"1421156461","name":"PrimeCoin","confirms":"3"},"XST":{"is_fiat":0,"rate_btc":"0.000025556666666667000000","last_update":"1421156461","name":"StealthCoin","confirms":"10"},"ZAR":{"is_fiat":1,"rate_btc":"0.000360446336449000000000","last_update":"1421156461","name":"South
70
+ African Rand","confirms":"10"},"ZEIT":{"is_fiat":0,"rate_btc":"0.000000005967494708457700","last_update":"1421152861","name":"ZeitCoin","confirms":"10"},"ZET":{"is_fiat":0,"rate_btc":"0.000003866666666666700000","last_update":"1421156461","name":"Zetacoin","confirms":"8"},"LTCT":{"is_fiat":0,"rate_btc":"1.000000000000000000000000","last_update":"1375473661","name":"Litecoin
71
+ Testnet","confirms":"1"}}}'
72
+ http_version:
73
+ recorded_at: Tue, 13 Jan 2015 13:56:00 GMT
74
+ recorded_with: VCR 2.9.3
metadata ADDED
@@ -0,0 +1,198 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: coinpayments
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Przemysław Janowski
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-01-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.6'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.6'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: pry
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: minitest
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: vcr
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: webmock
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: httparty
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 0.13.1
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.13.1
126
+ - !ruby/object:Gem::Dependency
127
+ name: hashie
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ description:
143
+ email:
144
+ - przemyslaw.janowski@outlook.com
145
+ executables: []
146
+ extensions: []
147
+ extra_rdoc_files: []
148
+ files:
149
+ - .gitignore
150
+ - Gemfile
151
+ - LICENSE.txt
152
+ - README.md
153
+ - Rakefile
154
+ - coinpayments.gemspec
155
+ - lib/coinpayments.rb
156
+ - lib/coinpayments/configuration.rb
157
+ - lib/coinpayments/version.rb
158
+ - lib/generators/coinpayments/install_generator.rb
159
+ - lib/generators/coinpayments/templates/coinpayments_initializer.rb
160
+ - test/coinpayments_test.rb
161
+ - test/fixtures/balances.yml
162
+ - test/fixtures/create_transaction.yml
163
+ - test/fixtures/create_withdrawal.yml
164
+ - test/fixtures/get_tx_info.yml
165
+ - test/fixtures/rates.yml
166
+ homepage: https://github.com/Salet/coinpayments
167
+ licenses:
168
+ - MIT
169
+ post_install_message:
170
+ rdoc_options: []
171
+ require_paths:
172
+ - lib
173
+ required_ruby_version: !ruby/object:Gem::Requirement
174
+ none: false
175
+ requirements:
176
+ - - ! '>='
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ! '>='
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ requirements: []
186
+ rubyforge_project:
187
+ rubygems_version: 1.8.23.2
188
+ signing_key:
189
+ specification_version: 3
190
+ summary: Convenient wrapper around CoinPayments.net API.
191
+ test_files:
192
+ - test/coinpayments_test.rb
193
+ - test/fixtures/balances.yml
194
+ - test/fixtures/create_transaction.yml
195
+ - test/fixtures/create_withdrawal.yml
196
+ - test/fixtures/get_tx_info.yml
197
+ - test/fixtures/rates.yml
198
+ has_rdoc: