peatio-bitgo 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +8 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +152 -0
- data/LICENSE.txt +21 -0
- data/README.md +67 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/configs/blockchains.yml +0 -0
- data/configs/currencies.yml +140 -0
- data/configs/wallets.yml +54 -0
- data/docs/configuration.md +36 -0
- data/docs/images/.DS_Store +0 -0
- data/docs/images/access_token.png +0 -0
- data/docs/images/choose_wallet.png +0 -0
- data/docs/images/create_wallet.png +0 -0
- data/docs/images/create_wallet_access_token.png +0 -0
- data/docs/images/setup_wallet.png +0 -0
- data/docs/images/wallet_access_token.png +0 -0
- data/docs/images/wallet_id.png +0 -0
- data/docs/images/wallet_name.png +0 -0
- data/docs/images/wallet_secret.png +0 -0
- data/docs/images/webhook.png +0 -0
- data/docs/images/webhook_creating.png +0 -0
- data/docs/integration.md +29 -0
- data/lib/peatio/bitgo.rb +16 -0
- data/lib/peatio/bitgo/blockchain.rb +21 -0
- data/lib/peatio/bitgo/client.rb +52 -0
- data/lib/peatio/bitgo/hooks.rb +42 -0
- data/lib/peatio/bitgo/railtie.rb +13 -0
- data/lib/peatio/bitgo/version.rb +5 -0
- data/lib/peatio/bitgo/wallet.rb +239 -0
- data/peatio-bitgo.gemspec +39 -0
- metadata +246 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 77fecc938decb7012e77db67d8334287226c3a3761d0fa6f075c0e93119418d8
|
4
|
+
data.tar.gz: fb16e7373708ebdf0b08fa85580d335853f64164854cad3ea1744a09277c15b1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5a7d4d96979e76c524ba8b5e67304cb497d3f911ed05873b20bbe2df94bda0bd192d7f3896e8437e86889db41844a4b56cbd04246dd71d7058dcf9be7c188c5
|
7
|
+
data.tar.gz: b86529c189d9399b28b35d493c8db850c9fc6187f50508d9df3131be329b9097fdc2431edbcc579275eda2d2f0cdef31f7455644dc7fc0d81f3ef39cb19b3382
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
peatio-bitgo (1.1.1)
|
5
|
+
activesupport (~> 5.2.3)
|
6
|
+
better-faraday (~> 1.0.5)
|
7
|
+
faraday (~> 0.15.4)
|
8
|
+
memoist (~> 0.16.0)
|
9
|
+
net-http-persistent (~> 3.0.1)
|
10
|
+
peatio (>= 0.6.3)
|
11
|
+
|
12
|
+
GEM
|
13
|
+
remote: https://rubygems.org/
|
14
|
+
specs:
|
15
|
+
activemodel (5.2.4.2)
|
16
|
+
activesupport (= 5.2.4.2)
|
17
|
+
activesupport (5.2.4.2)
|
18
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
+
i18n (>= 0.7, < 2)
|
20
|
+
minitest (~> 5.1)
|
21
|
+
tzinfo (~> 1.1)
|
22
|
+
addressable (2.7.0)
|
23
|
+
public_suffix (>= 2.0.2, < 5.0)
|
24
|
+
amq-protocol (2.3.0)
|
25
|
+
amqp (1.8.0)
|
26
|
+
amq-protocol (>= 2.2.0)
|
27
|
+
eventmachine
|
28
|
+
better-faraday (1.0.8)
|
29
|
+
activesupport (>= 4.0, < 6.0)
|
30
|
+
faraday (~> 0.12)
|
31
|
+
bunny (2.14.4)
|
32
|
+
amq-protocol (~> 2.3, >= 2.3.0)
|
33
|
+
byebug (11.1.1)
|
34
|
+
clamp (1.3.1)
|
35
|
+
coderay (1.1.2)
|
36
|
+
concurrent-ruby (1.1.6)
|
37
|
+
connection_pool (2.2.2)
|
38
|
+
cookiejar (0.3.3)
|
39
|
+
crack (0.4.3)
|
40
|
+
safe_yaml (~> 1.0.0)
|
41
|
+
daemons (1.3.1)
|
42
|
+
diff-lcs (1.3)
|
43
|
+
em-http-request (1.1.5)
|
44
|
+
addressable (>= 2.3.4)
|
45
|
+
cookiejar (!= 0.3.1)
|
46
|
+
em-socksify (>= 0.3)
|
47
|
+
eventmachine (>= 1.0.3)
|
48
|
+
http_parser.rb (>= 0.6.0)
|
49
|
+
em-socksify (0.3.2)
|
50
|
+
eventmachine (>= 1.0.0.beta.4)
|
51
|
+
em-synchrony (1.0.6)
|
52
|
+
eventmachine (>= 1.0.0.beta.1)
|
53
|
+
em-websocket (0.5.1)
|
54
|
+
eventmachine (>= 0.12.9)
|
55
|
+
http_parser.rb (~> 0.6.0)
|
56
|
+
eventmachine (1.2.7)
|
57
|
+
faraday (0.15.4)
|
58
|
+
multipart-post (>= 1.2, < 3)
|
59
|
+
faraday_middleware (0.13.1)
|
60
|
+
faraday (>= 0.7.4, < 1.0)
|
61
|
+
faye (1.2.4)
|
62
|
+
cookiejar (>= 0.3.0)
|
63
|
+
em-http-request (>= 0.3.0)
|
64
|
+
eventmachine (>= 0.12.0)
|
65
|
+
faye-websocket (>= 0.9.1)
|
66
|
+
multi_json (>= 1.0.0)
|
67
|
+
rack (>= 1.0.0)
|
68
|
+
websocket-driver (>= 0.5.1)
|
69
|
+
faye-websocket (0.10.9)
|
70
|
+
eventmachine (>= 0.12.0)
|
71
|
+
websocket-driver (>= 0.5.1)
|
72
|
+
hashdiff (1.0.1)
|
73
|
+
http_parser.rb (0.6.0)
|
74
|
+
i18n (1.8.2)
|
75
|
+
concurrent-ruby (~> 1.0)
|
76
|
+
jwt (2.2.1)
|
77
|
+
memoist (0.16.2)
|
78
|
+
method_source (1.0.0)
|
79
|
+
minitest (5.14.0)
|
80
|
+
mocha (1.11.2)
|
81
|
+
multi_json (1.14.1)
|
82
|
+
multipart-post (2.1.1)
|
83
|
+
mysql2 (0.5.3)
|
84
|
+
net-http-persistent (3.0.1)
|
85
|
+
connection_pool (~> 2.2)
|
86
|
+
peatio (2.4.3)
|
87
|
+
activemodel (> 5.2, <= 6.0.0)
|
88
|
+
amqp
|
89
|
+
bunny
|
90
|
+
clamp
|
91
|
+
em-synchrony (~> 1.0)
|
92
|
+
em-websocket
|
93
|
+
eventmachine
|
94
|
+
faraday_middleware (~> 0.13.1)
|
95
|
+
faye (~> 1.2)
|
96
|
+
jwt
|
97
|
+
mysql2
|
98
|
+
prometheus-client
|
99
|
+
thin
|
100
|
+
prometheus-client (2.0.0)
|
101
|
+
pry (0.13.0)
|
102
|
+
coderay (~> 1.1)
|
103
|
+
method_source (~> 1.0)
|
104
|
+
pry-byebug (3.9.0)
|
105
|
+
byebug (~> 11.0)
|
106
|
+
pry (~> 0.13.0)
|
107
|
+
public_suffix (4.0.3)
|
108
|
+
rack (2.2.2)
|
109
|
+
rake (13.0.1)
|
110
|
+
rspec (3.9.0)
|
111
|
+
rspec-core (~> 3.9.0)
|
112
|
+
rspec-expectations (~> 3.9.0)
|
113
|
+
rspec-mocks (~> 3.9.0)
|
114
|
+
rspec-core (3.9.1)
|
115
|
+
rspec-support (~> 3.9.1)
|
116
|
+
rspec-expectations (3.9.1)
|
117
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
118
|
+
rspec-support (~> 3.9.0)
|
119
|
+
rspec-mocks (3.9.1)
|
120
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
121
|
+
rspec-support (~> 3.9.0)
|
122
|
+
rspec-support (3.9.2)
|
123
|
+
safe_yaml (1.0.5)
|
124
|
+
thin (1.7.2)
|
125
|
+
daemons (~> 1.0, >= 1.0.9)
|
126
|
+
eventmachine (~> 1.0, >= 1.0.4)
|
127
|
+
rack (>= 1, < 3)
|
128
|
+
thread_safe (0.3.6)
|
129
|
+
tzinfo (1.2.6)
|
130
|
+
thread_safe (~> 0.1)
|
131
|
+
webmock (3.8.3)
|
132
|
+
addressable (>= 2.3.6)
|
133
|
+
crack (>= 0.3.2)
|
134
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
135
|
+
websocket-driver (0.7.1)
|
136
|
+
websocket-extensions (>= 0.1.0)
|
137
|
+
websocket-extensions (0.1.4)
|
138
|
+
|
139
|
+
PLATFORMS
|
140
|
+
ruby
|
141
|
+
|
142
|
+
DEPENDENCIES
|
143
|
+
bundler (~> 1.16)
|
144
|
+
mocha (~> 1.8)
|
145
|
+
peatio-bitgo!
|
146
|
+
pry-byebug
|
147
|
+
rake (~> 13.0)
|
148
|
+
rspec (~> 3.0)
|
149
|
+
webmock (~> 3.5)
|
150
|
+
|
151
|
+
BUNDLED WITH
|
152
|
+
1.17.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Naichuk Maksym
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# Peatio::bitgo
|
2
|
+
|
3
|
+
Peatio bitgo plugin for Rubykube stack
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'peatio-bitgo'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install peatio-bitgo
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
For Peatio bitgo plugin integration you need to do the following steps:
|
24
|
+
|
25
|
+
### Image Build.
|
26
|
+
|
27
|
+
1. Add peatio-bitgo gem into your Gemfile.plugin
|
28
|
+
```ruby
|
29
|
+
gem 'peatio-bitgo', '~> 0.2.0'
|
30
|
+
```
|
31
|
+
|
32
|
+
2. Run `bundle install` for updating Gemfile.lock
|
33
|
+
|
34
|
+
3. Build custom Peatio [docker image with bitgo plugin](https://github.com/rubykube/peatio/blob/master/docs/plugins.md#build)
|
35
|
+
|
36
|
+
4. Push your image using `docker push`
|
37
|
+
|
38
|
+
5. Update your deployment to use image with peatio-bitgo gem
|
39
|
+
|
40
|
+
### Peatio Configuration.
|
41
|
+
|
42
|
+
1. Create bitgo Blockchain [config example](../config/blockchains.yml).
|
43
|
+
* No additional steps are needed
|
44
|
+
|
45
|
+
2. Create bitgo Currency [config example](../config/currencies.yml).
|
46
|
+
* No additional steps are needed
|
47
|
+
|
48
|
+
3. Create bitgo Wallets [config example](../config/wallets.yml)(deposit and hot wallets are required).
|
49
|
+
* No additional steps are needed
|
50
|
+
|
51
|
+
|
52
|
+
## Development
|
53
|
+
|
54
|
+
Plugin development [example](https://github.com/rubykube/peatio/blob/master/docs/coins/development.md).
|
55
|
+
|
56
|
+
## Contributing
|
57
|
+
|
58
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rubykube/peatio-bitgo.
|
59
|
+
|
60
|
+
## License
|
61
|
+
|
62
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
63
|
+
|
64
|
+
## Consulting
|
65
|
+
|
66
|
+
You can contact Openware for finding certified vendors:
|
67
|
+
[Openware.com](https://www.openware.com)
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "peatio/bitgo"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
File without changes
|
@@ -0,0 +1,140 @@
|
|
1
|
+
- id: ltc
|
2
|
+
name: Litecoin
|
3
|
+
blockchain_key: ltc-testnet
|
4
|
+
symbol: 'Ł'
|
5
|
+
type: coin
|
6
|
+
precision: 8
|
7
|
+
base_factor: 100_000_000
|
8
|
+
enabled: true
|
9
|
+
# Deposits with less amount are skipped during blockchain synchronization.
|
10
|
+
# We advise to set value 10 times bigger than the network fee to prevent losses.
|
11
|
+
min_deposit_amount: 0.0004488
|
12
|
+
min_collection_amount: 0.0004488
|
13
|
+
withdraw_limit_24h: 0.5
|
14
|
+
withdraw_limit_72h: 1.2
|
15
|
+
deposit_fee: 0
|
16
|
+
withdraw_fee: 0
|
17
|
+
position: 1
|
18
|
+
options: {}
|
19
|
+
|
20
|
+
- id: xrp
|
21
|
+
name: Ripple
|
22
|
+
blockchain_key: xrp-testnet
|
23
|
+
symbol: 'ꭆ'
|
24
|
+
type: coin
|
25
|
+
precision: 8
|
26
|
+
base_factor: 1_000_000
|
27
|
+
enabled: true
|
28
|
+
# Deposits with less amount are skipped during blockchain synchronization.
|
29
|
+
# We advise to set value 10 times bigger than the network fee to prevent losses.
|
30
|
+
min_deposit_amount: 0.0001
|
31
|
+
min_collection_amount: 0.0001
|
32
|
+
withdraw_limit_24h: 100
|
33
|
+
withdraw_limit_72h: 200
|
34
|
+
deposit_fee: 0
|
35
|
+
withdraw_fee: 0
|
36
|
+
position: 2
|
37
|
+
options: {}
|
38
|
+
|
39
|
+
- id: bch
|
40
|
+
name: Bitcoin Cash
|
41
|
+
blockchain_key: bch-testnet
|
42
|
+
symbol: '฿'
|
43
|
+
type: coin
|
44
|
+
precision: 8
|
45
|
+
base_factor: 100_000_000
|
46
|
+
enabled: true
|
47
|
+
# Deposits with less amount are skipped during blockchain synchronization.
|
48
|
+
# We advise to set value 10 times bigger than the network fee to prevent losses.
|
49
|
+
min_deposit_amount: 0.0000748
|
50
|
+
min_collection_amount: 0.0000748
|
51
|
+
withdraw_limit_24h: 0.1
|
52
|
+
withdraw_limit_72h: 0.2
|
53
|
+
deposit_fee: 0
|
54
|
+
withdraw_fee: 0
|
55
|
+
position: 3
|
56
|
+
options: {}
|
57
|
+
|
58
|
+
- id: btc
|
59
|
+
name: Bitcoin
|
60
|
+
blockchain_key: btc-testnet
|
61
|
+
symbol: '฿'
|
62
|
+
type: coin
|
63
|
+
precision: 8
|
64
|
+
base_factor: 100_000_000
|
65
|
+
visible: true
|
66
|
+
deposit_enabled: true
|
67
|
+
withdrawal_enabled: true
|
68
|
+
# Deposits with less amount are skipped during blockchain synchronization.
|
69
|
+
# We advise to set value 10 times bigger than the network fee to prevent losses.
|
70
|
+
min_deposit_amount: 0.0000356
|
71
|
+
min_collection_amount: 0.0000356
|
72
|
+
withdraw_limit_24h: 0.1
|
73
|
+
withdraw_limit_72h: 0.2
|
74
|
+
deposit_fee: 0
|
75
|
+
withdraw_fee: 0
|
76
|
+
position: 4
|
77
|
+
options: {}
|
78
|
+
|
79
|
+
- id: eth
|
80
|
+
name: Ethereum
|
81
|
+
blockchain_key: eth-rinkeby
|
82
|
+
symbol: 'Ξ'
|
83
|
+
type: coin
|
84
|
+
precision: 8
|
85
|
+
base_factor: 1_000_000_000_000_000_000
|
86
|
+
visible: true
|
87
|
+
deposit_enabled: true
|
88
|
+
withdrawal_enabled: true
|
89
|
+
# Deposits with less amount are skipped during blockchain synchronization.
|
90
|
+
# We advise to set value 10 times bigger than the network fee to prevent losses.
|
91
|
+
min_deposit_amount: 0.00021
|
92
|
+
min_collection_amount: 0.00021
|
93
|
+
withdraw_limit_24h: 0.2
|
94
|
+
withdraw_limit_72h: 0.5
|
95
|
+
deposit_fee: 0
|
96
|
+
withdraw_fee: 0
|
97
|
+
position: 5
|
98
|
+
options:
|
99
|
+
# ETH tx fees configurations.
|
100
|
+
#
|
101
|
+
# Maximum amount of gas you're willing to spend on a particular transaction.
|
102
|
+
gas_limit: 21_000
|
103
|
+
# Internal price that is paid for running a transaction on the Ethereum network.
|
104
|
+
gas_price: 1_000_000_000
|
105
|
+
|
106
|
+
- id: eos
|
107
|
+
name: EOS
|
108
|
+
blockchain_key: eos-testnet
|
109
|
+
symbol: 'E'
|
110
|
+
type: coin
|
111
|
+
precision: 4
|
112
|
+
base_factor: 10_000
|
113
|
+
enabled: true
|
114
|
+
# Deposits with less amount are skipped during blockchain synchronization.
|
115
|
+
# We advise to set value 10 times bigger than the network fee to prevent losses.
|
116
|
+
min_deposit_amount: 0.0001
|
117
|
+
min_collection_amount: 0.0001
|
118
|
+
withdraw_limit_24h: 100.0
|
119
|
+
withdraw_limit_72h: 500.0
|
120
|
+
deposit_fee: 0
|
121
|
+
withdraw_fee: 0
|
122
|
+
position: 6
|
123
|
+
|
124
|
+
- id: dash
|
125
|
+
name: Dash
|
126
|
+
blockchain_key: dash-testnet
|
127
|
+
symbol: 'D'
|
128
|
+
type: coin
|
129
|
+
precision: 8
|
130
|
+
base_factor: 100_000_000
|
131
|
+
enabled: true
|
132
|
+
# Deposits with less amount are skipped during blockchain synchronization.
|
133
|
+
# We advise to set value 10 times bigger than the network fee to prevent losses.
|
134
|
+
min_deposit_amount: 0.0001
|
135
|
+
min_collection_amount: 0.0001
|
136
|
+
withdraw_limit_24h: 100.0
|
137
|
+
withdraw_limit_72h: 500.0
|
138
|
+
deposit_fee: 0
|
139
|
+
withdraw_fee: 0
|
140
|
+
position: 7
|
data/configs/wallets.yml
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
|
2
|
+
- name: Ethereum Deposit Wallet
|
3
|
+
blockchain_key: eth-rinkeby
|
4
|
+
currency_id: eth
|
5
|
+
# Address where deposits will be collected to.
|
6
|
+
address: '0x2b9fBC10EbAeEc28a8Fc10069C0BC29E45eBEB9C' # IMPORTANT: Always wrap this value in quotes!
|
7
|
+
kind: deposit # Wallet kind (deposit, hot, warm, cold or fee).
|
8
|
+
max_balance: 0.0
|
9
|
+
status: active
|
10
|
+
gateway: geth # Gateway client name.
|
11
|
+
settings:
|
12
|
+
#
|
13
|
+
# Geth gateway client settings.
|
14
|
+
uri: http://127.0.0.1:8545
|
15
|
+
secret: 'changeme'
|
16
|
+
testnet: true
|
17
|
+
access_token: 'v2x659261647b540ee3acda5c50ae4e878we323474eea5cbff9b9615139629'
|
18
|
+
wallet_id: '5e5388ad80334347ceb3540c741d'
|
19
|
+
|
20
|
+
- name: Ethereum Hot Wallet
|
21
|
+
blockchain_key: eth-rinkeby
|
22
|
+
currency_id: eth
|
23
|
+
# Address where deposits will be collected to.
|
24
|
+
address: '0x270704935783087a01c7a28d8f2d8f01670c8050' # IMPORTANT: Always wrap this value in quotes!
|
25
|
+
kind: hot # Wallet kind (deposit, hot, warm, cold or fee).
|
26
|
+
max_balance: 100.0
|
27
|
+
status: active
|
28
|
+
gateway: geth # Gateway client name.
|
29
|
+
settings:
|
30
|
+
#
|
31
|
+
# Geth gateway client settings.
|
32
|
+
uri: http://127.0.0.1:8545
|
33
|
+
secret: 'test'
|
34
|
+
testnet: true
|
35
|
+
access_token: 'v2x659261647b540ee3acda5c50ae4e878we323474eea5cbff9b9615139629'
|
36
|
+
wallet_id: '5e5388ad80334347ceb3540c741d'
|
37
|
+
|
38
|
+
- name: Ethereum Warm Wallet
|
39
|
+
blockchain_key: eth-rinkeby
|
40
|
+
currency_id: eth
|
41
|
+
# Address where deposits will be collected to.
|
42
|
+
address: '0x2b9fBC10EbAeEc28a8Fc10069C0BC29E45eBEB9C' # IMPORTANT: Always wrap this value in quotes!
|
43
|
+
kind: warm # Wallet kind (deposit, hot, warm, cold or fee).
|
44
|
+
max_balance: 1000.0
|
45
|
+
status: active
|
46
|
+
gateway: geth # Gateway client name.
|
47
|
+
settings:
|
48
|
+
#
|
49
|
+
# Geth gateway client settings.
|
50
|
+
uri: http://127.0.0.1:8545
|
51
|
+
secret: 'test'
|
52
|
+
testnet: true
|
53
|
+
access_token: 'v2x659261647b540ee3acda5c50ae4e878we323474eea5cbff9b9615139629'
|
54
|
+
wallet_id: '5e5388ad80334347ceb3540c741d'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
## Bitgo wallet configuration
|
2
|
+
|
3
|
+
1. Login to your bitgo account
|
4
|
+
2. Click in create wallet button
|
5
|
+
![scheme](images/create_wallet.png)
|
6
|
+
3. Choose wallet for appropriate currency
|
7
|
+
![scheme](images/choose_wallet.png)
|
8
|
+
4. Setup your wallet
|
9
|
+
![scheme](images/setup_wallet.png)
|
10
|
+
5. Put name of your wallet
|
11
|
+
![scheme](images/wallet_name.png)
|
12
|
+
6. Put password of your wallet
|
13
|
+
![scheme](images/wallet_secret.png)
|
14
|
+
P.S. You should save this password for future wallet configuration
|
15
|
+
|
16
|
+
## Peatio BITGO wallet configuration
|
17
|
+
|
18
|
+
1. Go to tower admin panel Settings -> Wallets -> Add wallet
|
19
|
+
* Uri == Bitgo service URI
|
20
|
+
* Secret == Wallet password
|
21
|
+
* Bitgo Wallet Id
|
22
|
+
![scheme](images/wallet_id.png)
|
23
|
+
* Bitgo Access Token
|
24
|
+
![scheme](images/wallet_access_token.png)
|
25
|
+
![scheme](images/create_wallet_access_token.png)
|
26
|
+
![scheme](images/access_token.png)
|
27
|
+
|
28
|
+
## Webhook configuration
|
29
|
+
|
30
|
+
![scheme](images/webhook.png)
|
31
|
+
![scheme](images/webhook_creating.png)
|
32
|
+
|
33
|
+
Where url should be "https://{host_url}/api/v2/peatio/public/webhooks/{event}"
|
34
|
+
|
35
|
+
* For deposit wallets event should be 'deposit'
|
36
|
+
* For hot wallets event should be 'withdraw'
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/docs/integration.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Integration.
|
2
|
+
|
3
|
+
For Peatio bitgo plugin integration you need to do the following steps:
|
4
|
+
|
5
|
+
## Image Build.
|
6
|
+
|
7
|
+
1. Add peatio-bitgo gem into your Gemfile.plugin
|
8
|
+
```ruby
|
9
|
+
gem 'peatio-bitgo', '~> 0.1.0'
|
10
|
+
```
|
11
|
+
|
12
|
+
2. Run `bundle install` for updating Gemfile.lock
|
13
|
+
|
14
|
+
3. Build custom Peatio [docker image with bitgo plugin](https://github.com/rubykube/peatio/blob/master/docs/plugins.md#build)
|
15
|
+
|
16
|
+
4. Push your image using `docker push`
|
17
|
+
|
18
|
+
5. Update your deployment to use image with peatio-bitgo gem
|
19
|
+
|
20
|
+
## Peatio Configuration.
|
21
|
+
|
22
|
+
1. Create bitgo Blockchain [config example](../config/blockchains.yml).
|
23
|
+
* No additional steps are needed
|
24
|
+
|
25
|
+
2. Create bitgo Currency [config example](../config/currencies.yml).
|
26
|
+
* No additional steps are needed
|
27
|
+
|
28
|
+
3. Create bitgo Wallets [config example](../config/wallets.yml)(deposit and hot wallets are required).
|
29
|
+
* No additional steps are needed
|
data/lib/peatio/bitgo.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "peatio"
|
2
|
+
|
3
|
+
module Peatio
|
4
|
+
module Bitgo
|
5
|
+
require "bigdecimal"
|
6
|
+
require "bigdecimal/util"
|
7
|
+
|
8
|
+
require "peatio/bitgo/blockchain"
|
9
|
+
require "peatio/bitgo/client"
|
10
|
+
require "peatio/bitgo/wallet"
|
11
|
+
|
12
|
+
require "peatio/bitgo/hooks"
|
13
|
+
|
14
|
+
require "peatio/bitgo/version"
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
module Peatio
|
3
|
+
module Bitgo
|
4
|
+
# TODO: Processing of unconfirmed transactions from mempool isn't supported now.
|
5
|
+
class Blockchain < Peatio::Blockchain::Abstract
|
6
|
+
|
7
|
+
DEFAULT_FEATURES = {case_sensitive: true, cash_addr_format: false}.freeze
|
8
|
+
|
9
|
+
def initialize(custom_features = {})
|
10
|
+
@features = DEFAULT_FEATURES.merge(custom_features).slice(*SUPPORTED_FEATURES)
|
11
|
+
@settings = {}
|
12
|
+
end
|
13
|
+
|
14
|
+
def configure(settings = {})
|
15
|
+
# Clean client state during configure.
|
16
|
+
@client = nil
|
17
|
+
@settings.merge!(settings.slice(*SUPPORTED_SETTINGS))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'better-faraday'
|
3
|
+
|
4
|
+
module Peatio
|
5
|
+
module Bitgo
|
6
|
+
class Client
|
7
|
+
Error = Class.new(StandardError)
|
8
|
+
class ConnectionError < Error; end
|
9
|
+
|
10
|
+
class ResponseError < Error
|
11
|
+
def initialize(msg)
|
12
|
+
super "#{msg}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(endpoint, access_token)
|
17
|
+
@endpoint = URI.parse(endpoint)
|
18
|
+
@access_token = access_token
|
19
|
+
end
|
20
|
+
|
21
|
+
def rest_api(verb, path, data = nil)
|
22
|
+
args = [@endpoint.to_s + path]
|
23
|
+
|
24
|
+
if data
|
25
|
+
if %i[ post put patch ].include?(verb)
|
26
|
+
args << data.compact.to_json
|
27
|
+
args << { 'Content-Type' => 'application/json' }
|
28
|
+
else
|
29
|
+
args << data.compact
|
30
|
+
args << {}
|
31
|
+
end
|
32
|
+
else
|
33
|
+
args << nil
|
34
|
+
args << {}
|
35
|
+
end
|
36
|
+
|
37
|
+
args.last['Accept'] = 'application/json'
|
38
|
+
args.last['Authorization'] = 'Bearer ' + @access_token
|
39
|
+
|
40
|
+
response = Faraday.send(verb, *args)
|
41
|
+
response.assert_success!
|
42
|
+
response = JSON.parse(response.body)
|
43
|
+
response['error'].tap { |error| raise ResponseError.new(error) if error }
|
44
|
+
response
|
45
|
+
rescue Faraday::Error => e
|
46
|
+
raise ConnectionError, e
|
47
|
+
rescue StandardError => e
|
48
|
+
raise Error, e
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Peatio
|
2
|
+
module Bitgo
|
3
|
+
module Hooks
|
4
|
+
BLOCKCHAIN_VERSION_REQUIREMENT = "~> 1.0.0"
|
5
|
+
WALLET_VERSION_REQUIREMENT = "~> 1.0.0"
|
6
|
+
|
7
|
+
class << self
|
8
|
+
def check_compatibility
|
9
|
+
unless Gem::Requirement.new(BLOCKCHAIN_VERSION_REQUIREMENT)
|
10
|
+
.satisfied_by?(Gem::Version.new(Peatio::Blockchain::VERSION))
|
11
|
+
[
|
12
|
+
"Bitgo blockchain version requiremnt was not suttisfied by Peatio::Blockchain.",
|
13
|
+
"Bitgo blockchain requires #{BLOCKCHAIN_VERSION_REQUIREMENT}.",
|
14
|
+
"Peatio::Blockchain version is #{Peatio::Blockchain::VERSION}"
|
15
|
+
].join('\n').tap { |s| Kernel.abort s }
|
16
|
+
end
|
17
|
+
|
18
|
+
unless Gem::Requirement.new(WALLET_VERSION_REQUIREMENT)
|
19
|
+
.satisfied_by?(Gem::Version.new(Peatio::Wallet::VERSION))
|
20
|
+
[
|
21
|
+
"Bitgo wallet version requiremnt was not suttisfied by Peatio::Wallet.",
|
22
|
+
"Bitgo wallet requires #{WALLET_VERSION_REQUIREMENT}.",
|
23
|
+
"Peatio::Wallet version is #{Peatio::Wallet::VERSION}"
|
24
|
+
].join('\n').tap { |s| Kernel.abort s }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def register
|
29
|
+
Peatio::Blockchain.registry[:bitgo] = Bitgo::Blockchain
|
30
|
+
Peatio::Wallet.registry[:bitgo] = Bitgo::Wallet
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
if defined?(Rails::Railtie)
|
35
|
+
require "peatio/bitgo/railtie"
|
36
|
+
else
|
37
|
+
check_compatibility
|
38
|
+
register
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,239 @@
|
|
1
|
+
module Peatio
|
2
|
+
module Bitgo
|
3
|
+
class Wallet < Peatio::Wallet::Abstract
|
4
|
+
|
5
|
+
def initialize(settings = {})
|
6
|
+
@settings = settings
|
7
|
+
end
|
8
|
+
|
9
|
+
def configure(settings = {})
|
10
|
+
# Clean client state during configure.
|
11
|
+
@client = nil
|
12
|
+
|
13
|
+
@settings.merge!(settings.slice(*SUPPORTED_SETTINGS))
|
14
|
+
|
15
|
+
@wallet = @settings.fetch(:wallet) do
|
16
|
+
raise Peatio::Wallet::MissingSettingError, :wallet
|
17
|
+
end.slice(:uri, :address, :secret, :access_token, :wallet_id, :testnet)
|
18
|
+
|
19
|
+
@currency = @settings.fetch(:currency) do
|
20
|
+
raise Peatio::Wallet::MissingSettingError, :currency
|
21
|
+
end.slice(:id, :base_factor, :code, :options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_address!(options = {})
|
25
|
+
currency = erc20_currency_id
|
26
|
+
options.deep_symbolize_keys!
|
27
|
+
if options.dig(:pa_details,:address_id).present?
|
28
|
+
response = client.rest_api(:get, "#{currency}/wallet/#{wallet_id}/address/#{options.dig(:pa_details, :address_id)}")
|
29
|
+
{ address: response['address'], secret: bitgo_wallet_passphrase }
|
30
|
+
else
|
31
|
+
response = client.rest_api(:post, "#{currency}/wallet/#{wallet_id}/address")
|
32
|
+
{ address: response['address'], secret: bitgo_wallet_passphrase, details: { address_id: response['id'] }}
|
33
|
+
end
|
34
|
+
rescue Bitgo::Client::Error => e
|
35
|
+
raise Peatio::Wallet::ClientError, e
|
36
|
+
end
|
37
|
+
|
38
|
+
def create_transaction!(transaction, options = {})
|
39
|
+
currency_options = @currency.fetch(:options).slice(:gas_limit, :gas_price)
|
40
|
+
|
41
|
+
if currency_options[:gas_limit].present? && currency_options[:gas_price].present?
|
42
|
+
options.merge!(currency_options)
|
43
|
+
create_eth_transaction(transaction, options)
|
44
|
+
else
|
45
|
+
amount = convert_to_base_unit(transaction.amount)
|
46
|
+
|
47
|
+
if options[:subtract_fee].to_s == 'true'
|
48
|
+
fee = build_raw_transaction(transaction)
|
49
|
+
baseFeeInfo = fee.dig('feeInfo','fee')
|
50
|
+
fee = baseFeeInfo.present? ? baseFeeInfo : fee.dig('txInfo','Fee')
|
51
|
+
amount -= fee.to_i
|
52
|
+
end
|
53
|
+
|
54
|
+
txid = client.rest_api(:post, "#{currency_id}/wallet/#{wallet_id}/sendcoins", {
|
55
|
+
address: transaction.to_address.to_s,
|
56
|
+
amount: amount.to_s,
|
57
|
+
walletPassphrase: bitgo_wallet_passphrase
|
58
|
+
}.compact).fetch('txid')
|
59
|
+
|
60
|
+
transaction.hash = normalize_txid(txid)
|
61
|
+
transaction
|
62
|
+
end
|
63
|
+
rescue Bitgo::Client::Error => e
|
64
|
+
raise Peatio::Wallet::ClientError, e
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
def build_raw_transaction(transaction)
|
69
|
+
client.rest_api(:post, "#{currency_id}/wallet/#{wallet_id}/tx/build", {
|
70
|
+
recipients: [{
|
71
|
+
address: transaction.to_address,
|
72
|
+
amount: convert_to_base_unit(transaction.amount).to_s
|
73
|
+
}]
|
74
|
+
}.compact)
|
75
|
+
end
|
76
|
+
|
77
|
+
def create_eth_transaction(transaction, options = {})
|
78
|
+
amount = convert_to_base_unit(transaction.amount)
|
79
|
+
|
80
|
+
txid = client.rest_api(:post, "#{currency_id}/wallet/#{wallet_id}/sendcoins", {
|
81
|
+
address: transaction.to_address.to_s,
|
82
|
+
amount: amount.to_s,
|
83
|
+
walletPassphrase: bitgo_wallet_passphrase,
|
84
|
+
gas: options.fetch(:gas_limit).to_i,
|
85
|
+
gasPrice: options.fetch(:gas_price).to_i
|
86
|
+
}.compact).fetch('txid')
|
87
|
+
|
88
|
+
transaction.hash = normalize_txid(txid)
|
89
|
+
transaction
|
90
|
+
end
|
91
|
+
|
92
|
+
def load_balance!
|
93
|
+
if @currency.fetch(:options).slice(:erc20_contract_address).present?
|
94
|
+
load_erc20_balance!
|
95
|
+
else
|
96
|
+
response = client.rest_api(:get, "#{currency_id}/wallet/#{wallet_id}")
|
97
|
+
convert_from_base_unit(response.fetch('balanceString'))
|
98
|
+
end
|
99
|
+
rescue Bitgo::Client::Error => e
|
100
|
+
raise Peatio::Wallet::ClientError, e
|
101
|
+
end
|
102
|
+
|
103
|
+
def load_erc20_balance!
|
104
|
+
response = client.rest_api(:get, "#{erc20_currency_id}/wallet/#{wallet_id}?allTokens=true")
|
105
|
+
convert_from_base_unit(response.dig('tokens', currency_id, 'balanceString'))
|
106
|
+
rescue Bitgo::Client::Error => e
|
107
|
+
raise Peatio::Wallet::ClientError, e
|
108
|
+
end
|
109
|
+
|
110
|
+
def trigger_webhook_event(event)
|
111
|
+
currency_id = @wallet.fetch(:testnet).present? ? 't' + @currency.fetch(:id) : @currency.fetch(:id)
|
112
|
+
return unless currency_id == event['coin'] && @wallet.fetch(:wallet_id) == event['wallet']
|
113
|
+
|
114
|
+
if event['type'] == 'transfer'
|
115
|
+
transactions = fetch_transfer!(event['transfer'])
|
116
|
+
return { transfers: transactions }
|
117
|
+
elsif event['address_confirmation']
|
118
|
+
# TODO Add Address confirmation
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def register_webhooks!(url)
|
123
|
+
transfer_webhook(url)
|
124
|
+
address_confirmation_webhook(url)
|
125
|
+
end
|
126
|
+
|
127
|
+
def fetch_transfer!(id)
|
128
|
+
# TODO: Add Rspecs for this one
|
129
|
+
response = client.rest_api(:get, "#{currency_id}/wallet/#{wallet_id}/transfer/#{id}")
|
130
|
+
parse_entries(response['entries']).map do |entry|
|
131
|
+
to_address = if response.dig('coinSpecific', 'memo').present?
|
132
|
+
build_address(response.dig('coinSpecific', 'memo').first)
|
133
|
+
else
|
134
|
+
entry['address']
|
135
|
+
end
|
136
|
+
state = if response['state'] == 'unconfrimed'
|
137
|
+
'pending'
|
138
|
+
elsif response['state'] == 'confirmed'
|
139
|
+
'success'
|
140
|
+
end
|
141
|
+
|
142
|
+
transaction = Peatio::Transaction.new(
|
143
|
+
currency_id: @currency.fetch(:id),
|
144
|
+
amount: convert_from_base_unit(entry['valueString']),
|
145
|
+
hash: normalize_txid(response['txid']),
|
146
|
+
to_address: to_address,
|
147
|
+
block_number: response['height'],
|
148
|
+
# TODO: Add sendmany support
|
149
|
+
txout: 0,
|
150
|
+
status: state
|
151
|
+
)
|
152
|
+
|
153
|
+
transaction if transaction.valid?
|
154
|
+
end.compact
|
155
|
+
rescue Bitgo::Client::Error => e
|
156
|
+
raise Peatio::Wallet::ClientError, e
|
157
|
+
end
|
158
|
+
|
159
|
+
def transfer_webhook(url)
|
160
|
+
client.rest_api(:post, "#{currency_id}/wallet/#{wallet_id}/webhooks", {
|
161
|
+
type: 'transfer',
|
162
|
+
allToken: true,
|
163
|
+
url: url,
|
164
|
+
label: "webhook for #{url}",
|
165
|
+
listenToFailureStates: false
|
166
|
+
})
|
167
|
+
end
|
168
|
+
|
169
|
+
def address_confirmation_webhook(url)
|
170
|
+
client.rest_api(:post, "#{currency_id}/wallet/#{wallet_id}/webhooks", {
|
171
|
+
type: 'address_confirmation_webhook',
|
172
|
+
allToken: true,
|
173
|
+
url: url,
|
174
|
+
label: "webhook for #{url}",
|
175
|
+
listenToFailureStates: false
|
176
|
+
})
|
177
|
+
end
|
178
|
+
|
179
|
+
def parse_entries(entries)
|
180
|
+
entries.map do |e|
|
181
|
+
e if e["valueString"].to_i.positive?
|
182
|
+
end.compact
|
183
|
+
end
|
184
|
+
|
185
|
+
private
|
186
|
+
|
187
|
+
def client
|
188
|
+
uri = @wallet.fetch(:uri) { raise Peatio::Wallet::MissingSettingError, :uri }
|
189
|
+
access_token = @wallet.fetch(:access_token) { raise Peatio::Wallet::MissingSettingError, :access_token }
|
190
|
+
|
191
|
+
currency_code_prefix = @wallet.fetch(:testnet) ? 't' : ''
|
192
|
+
uri = uri.gsub(/\/+\z/, '') + '/' + currency_code_prefix
|
193
|
+
@client ||= Client.new(uri, access_token)
|
194
|
+
end
|
195
|
+
|
196
|
+
def build_address(memo)
|
197
|
+
"#{memo['address']}?memoId=#{memo['value']}"
|
198
|
+
end
|
199
|
+
|
200
|
+
# All these functions will have to be done with the coin set to eth or teth
|
201
|
+
# since that is the actual coin type being used.
|
202
|
+
def erc20_currency_id
|
203
|
+
return 'eth' if @currency.fetch(:options).slice(:erc20_contract_address).present?
|
204
|
+
|
205
|
+
currency_id
|
206
|
+
end
|
207
|
+
|
208
|
+
def currency_id
|
209
|
+
@currency.fetch(:id) { raise Peatio::Wallet::MissingSettingError, :id }
|
210
|
+
end
|
211
|
+
|
212
|
+
def bitgo_wallet_passphrase
|
213
|
+
@wallet.fetch(:secret)
|
214
|
+
end
|
215
|
+
|
216
|
+
def wallet_id
|
217
|
+
@wallet.fetch(:wallet_id)
|
218
|
+
end
|
219
|
+
|
220
|
+
def normalize_txid(txid)
|
221
|
+
txid.downcase
|
222
|
+
end
|
223
|
+
|
224
|
+
def convert_from_base_unit(value)
|
225
|
+
value.to_d / @currency.fetch(:base_factor)
|
226
|
+
end
|
227
|
+
|
228
|
+
def convert_to_base_unit(value)
|
229
|
+
x = value.to_d * @currency.fetch(:base_factor)
|
230
|
+
unless (x % 1).zero?
|
231
|
+
raise Peatio::WalletClient::Error,
|
232
|
+
"Failed to convert value to base (smallest) unit because it exceeds the maximum precision: " \
|
233
|
+
"#{value.to_d} - #{x.to_d} must be equal to zero."
|
234
|
+
end
|
235
|
+
x.to_i
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "peatio/bitgo/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "peatio-bitgo"
|
8
|
+
spec.version = Peatio::Bitgo::VERSION
|
9
|
+
spec.authors = ["Nadia Ch., Maksym N."]
|
10
|
+
spec.email = ["nchumak@heliostech.fr"]
|
11
|
+
|
12
|
+
spec.summary = %q{Gem for extending Peatio plugable system with Bitgo implementation.}
|
13
|
+
spec.description = %q{Bitgo Peatio gem which implements Peatio::Blockchain::Abstract & Peatio::Wallet::Abstract.}
|
14
|
+
spec.homepage = "https://openware.com/"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_dependency "activesupport", "~> 5.2.3"
|
27
|
+
spec.add_dependency "better-faraday", "~> 1.0.5"
|
28
|
+
spec.add_dependency "faraday", "~> 0.15.4"
|
29
|
+
spec.add_dependency "memoist", "~> 0.16.0"
|
30
|
+
spec.add_dependency "peatio", ">= 0.6.3"
|
31
|
+
spec.add_dependency 'net-http-persistent', '~> 3.0.1'
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
34
|
+
spec.add_development_dependency "mocha", "~> 1.8"
|
35
|
+
spec.add_development_dependency "pry-byebug"
|
36
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
37
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
38
|
+
spec.add_development_dependency "webmock", "~> 3.5"
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,246 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: peatio-bitgo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nadia Ch., Maksym N.
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.2.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.2.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: better-faraday
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.5
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.5
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.15.4
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.15.4
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: memoist
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.16.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.16.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: peatio
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.6.3
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.6.3
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: net-http-persistent
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.0.1
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.0.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bundler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.16'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.16'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: mocha
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.8'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.8'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: pry-byebug
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rake
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '13.0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '13.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rspec
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '3.0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '3.0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: webmock
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '3.5'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '3.5'
|
181
|
+
description: Bitgo Peatio gem which implements Peatio::Blockchain::Abstract & Peatio::Wallet::Abstract.
|
182
|
+
email:
|
183
|
+
- nchumak@heliostech.fr
|
184
|
+
executables: []
|
185
|
+
extensions: []
|
186
|
+
extra_rdoc_files: []
|
187
|
+
files:
|
188
|
+
- ".gitignore"
|
189
|
+
- ".rspec"
|
190
|
+
- ".travis.yml"
|
191
|
+
- Gemfile
|
192
|
+
- Gemfile.lock
|
193
|
+
- LICENSE.txt
|
194
|
+
- README.md
|
195
|
+
- Rakefile
|
196
|
+
- bin/console
|
197
|
+
- bin/setup
|
198
|
+
- configs/blockchains.yml
|
199
|
+
- configs/currencies.yml
|
200
|
+
- configs/wallets.yml
|
201
|
+
- docs/configuration.md
|
202
|
+
- docs/images/.DS_Store
|
203
|
+
- docs/images/access_token.png
|
204
|
+
- docs/images/choose_wallet.png
|
205
|
+
- docs/images/create_wallet.png
|
206
|
+
- docs/images/create_wallet_access_token.png
|
207
|
+
- docs/images/setup_wallet.png
|
208
|
+
- docs/images/wallet_access_token.png
|
209
|
+
- docs/images/wallet_id.png
|
210
|
+
- docs/images/wallet_name.png
|
211
|
+
- docs/images/wallet_secret.png
|
212
|
+
- docs/images/webhook.png
|
213
|
+
- docs/images/webhook_creating.png
|
214
|
+
- docs/integration.md
|
215
|
+
- lib/peatio/bitgo.rb
|
216
|
+
- lib/peatio/bitgo/blockchain.rb
|
217
|
+
- lib/peatio/bitgo/client.rb
|
218
|
+
- lib/peatio/bitgo/hooks.rb
|
219
|
+
- lib/peatio/bitgo/railtie.rb
|
220
|
+
- lib/peatio/bitgo/version.rb
|
221
|
+
- lib/peatio/bitgo/wallet.rb
|
222
|
+
- peatio-bitgo.gemspec
|
223
|
+
homepage: https://openware.com/
|
224
|
+
licenses:
|
225
|
+
- MIT
|
226
|
+
metadata: {}
|
227
|
+
post_install_message:
|
228
|
+
rdoc_options: []
|
229
|
+
require_paths:
|
230
|
+
- lib
|
231
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - ">="
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '0'
|
236
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
|
+
requirements:
|
238
|
+
- - ">="
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: '0'
|
241
|
+
requirements: []
|
242
|
+
rubygems_version: 3.0.3
|
243
|
+
signing_key:
|
244
|
+
specification_version: 4
|
245
|
+
summary: Gem for extending Peatio plugable system with Bitgo implementation.
|
246
|
+
test_files: []
|