coinapult 0.1 → 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 +4 -4
- data/lib/coinapult.rb +11 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d34d43d7a9533e593c907e1cd000440927fac9b
|
|
4
|
+
data.tar.gz: 0c7f1c348487eef0ad3ddfdc28bc32189007f601
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e71b39ca3b514f007665992baf8a39533c0b3df1c67915708b6500ef0da1e22c4b95a0a2990e1ac0f7b34166716ae5dd56b5282e333114784c9598dc895d576a
|
|
7
|
+
data.tar.gz: 47742624298ce8a73ce0a9e3f8e369f222ec6af518f17cc38b0955708008aca1bf7a878de4c7d069b1dc04cef5b2e8fd357793b957d68f35fe0947a30587c144
|
data/lib/coinapult.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
1
|
require 'uri'
|
|
3
2
|
require 'json'
|
|
4
3
|
require 'base64'
|
|
@@ -6,7 +5,11 @@ require 'openssl'
|
|
|
6
5
|
require 'rest_client'
|
|
7
6
|
require 'securerandom'
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
if OpenSSL::SSL::SSLContext::METHODS.include? :TLSv1_2
|
|
9
|
+
SSL_VERSION = :TLSv1_2
|
|
10
|
+
else
|
|
11
|
+
SSL_VERSION = :TLSv1
|
|
12
|
+
end
|
|
10
13
|
|
|
11
14
|
ECC_CURVE = 'secp256k1'
|
|
12
15
|
ECC_COINAPULT_PUB = "
|
|
@@ -37,6 +40,9 @@ class CoinapultClient
|
|
|
37
40
|
@ecc[:pubkey].to_pem]
|
|
38
41
|
end
|
|
39
42
|
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
40
46
|
def _setup_ECC_pair(keypair)
|
|
41
47
|
if keypair.nil?
|
|
42
48
|
privkey = OpenSSL::PKey::EC.new(ECC_CURVE)
|
|
@@ -133,6 +139,9 @@ class CoinapultClient
|
|
|
133
139
|
method.call(endpoint, values, sign: sign, **kwargs)
|
|
134
140
|
end
|
|
135
141
|
|
|
142
|
+
|
|
143
|
+
public
|
|
144
|
+
|
|
136
145
|
def create_account(create_local_keys: true, change_authmethod: true,
|
|
137
146
|
**kwargs)
|
|
138
147
|
url = '/api/account/create'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: coinapult
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guilherme Polo
|
|
@@ -42,9 +42,9 @@ require_paths:
|
|
|
42
42
|
- lib
|
|
43
43
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - ~>
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
47
|
+
version: '2.0'
|
|
48
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
49
|
requirements:
|
|
50
50
|
- - '>='
|