ouroboros-peatio-bitgo 3.1.0
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 +179 -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/blockchain.rb +21 -0
- data/lib/peatio/bitgo/client.rb +54 -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 +345 -0
- data/lib/peatio/bitgo.rb +16 -0
- data/peatio-bitgo.gemspec +39 -0
- metadata +247 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e00e28926a7cb389ee1f10739297a8cb7e316542d83eeeb8b769e9551b21de19
|
4
|
+
data.tar.gz: 786c1e4d0829fe4e9c1e8febc29e72cd9c8420eda83e7767e24319dc2534c690
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 27e051673a38b4762e68e875960a8757b80999ea3dcd04a8804f5f7a29c60992715e4222bb1c4cab0487a6540170da9bd45acca90244580a0cc6454c838bdc33
|
7
|
+
data.tar.gz: f10763c195cfb33582823b344d33a1cffd906f4e696ca40c7d7c852b6f0c28770fcf9ddd29cfbd8c20292886106d3b8dbec847fa6c3c4f77e5b88302788a802c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
peatio-bitgo (3.1.0)
|
5
|
+
activesupport (~> 6.1.0)
|
6
|
+
better-faraday (~> 2.0.1)
|
7
|
+
faraday (~> 1.10)
|
8
|
+
memoist (~> 0.16.0)
|
9
|
+
net-http-persistent (~> 4.0.1)
|
10
|
+
peatio (>= 3.1.1)
|
11
|
+
|
12
|
+
GEM
|
13
|
+
remote: https://rubygems.org/
|
14
|
+
specs:
|
15
|
+
activemodel (6.1.7.2)
|
16
|
+
activesupport (= 6.1.7.2)
|
17
|
+
activesupport (6.1.7.2)
|
18
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
+
i18n (>= 1.6, < 2)
|
20
|
+
minitest (>= 5.1)
|
21
|
+
tzinfo (~> 2.0)
|
22
|
+
zeitwerk (~> 2.3)
|
23
|
+
addressable (2.8.1)
|
24
|
+
public_suffix (>= 2.0.2, < 6.0)
|
25
|
+
amq-protocol (2.3.2)
|
26
|
+
amqp (1.8.0)
|
27
|
+
amq-protocol (>= 2.2.0)
|
28
|
+
eventmachine
|
29
|
+
better-faraday (2.0.1)
|
30
|
+
activesupport (>= 4.0, < 7.0)
|
31
|
+
faraday (>= 1.0, < 3.0)
|
32
|
+
bunny (2.20.3)
|
33
|
+
amq-protocol (~> 2.3, >= 2.3.1)
|
34
|
+
sorted_set (~> 1, >= 1.0.2)
|
35
|
+
byebug (11.1.3)
|
36
|
+
clamp (1.3.2)
|
37
|
+
coderay (1.1.3)
|
38
|
+
concurrent-ruby (1.2.2)
|
39
|
+
connection_pool (2.3.0)
|
40
|
+
cookiejar (0.3.3)
|
41
|
+
crack (0.4.5)
|
42
|
+
rexml
|
43
|
+
daemons (1.4.1)
|
44
|
+
diff-lcs (1.5.0)
|
45
|
+
em-http-request (1.1.7)
|
46
|
+
addressable (>= 2.3.4)
|
47
|
+
cookiejar (!= 0.3.1)
|
48
|
+
em-socksify (>= 0.3)
|
49
|
+
eventmachine (>= 1.0.3)
|
50
|
+
http_parser.rb (>= 0.6.0)
|
51
|
+
em-socksify (0.3.2)
|
52
|
+
eventmachine (>= 1.0.0.beta.4)
|
53
|
+
em-synchrony (1.0.6)
|
54
|
+
eventmachine (>= 1.0.0.beta.1)
|
55
|
+
em-websocket (0.5.3)
|
56
|
+
eventmachine (>= 0.12.9)
|
57
|
+
http_parser.rb (~> 0)
|
58
|
+
eventmachine (1.2.7)
|
59
|
+
faraday (1.10.3)
|
60
|
+
faraday-em_http (~> 1.0)
|
61
|
+
faraday-em_synchrony (~> 1.0)
|
62
|
+
faraday-excon (~> 1.1)
|
63
|
+
faraday-httpclient (~> 1.0)
|
64
|
+
faraday-multipart (~> 1.0)
|
65
|
+
faraday-net_http (~> 1.0)
|
66
|
+
faraday-net_http_persistent (~> 1.0)
|
67
|
+
faraday-patron (~> 1.0)
|
68
|
+
faraday-rack (~> 1.0)
|
69
|
+
faraday-retry (~> 1.0)
|
70
|
+
ruby2_keywords (>= 0.0.4)
|
71
|
+
faraday-em_http (1.0.0)
|
72
|
+
faraday-em_synchrony (1.0.0)
|
73
|
+
faraday-excon (1.1.0)
|
74
|
+
faraday-httpclient (1.0.1)
|
75
|
+
faraday-multipart (1.0.4)
|
76
|
+
multipart-post (~> 2)
|
77
|
+
faraday-net_http (1.0.1)
|
78
|
+
faraday-net_http_persistent (1.2.0)
|
79
|
+
faraday-patron (1.0.0)
|
80
|
+
faraday-rack (1.0.0)
|
81
|
+
faraday-retry (1.0.3)
|
82
|
+
faye (1.4.0)
|
83
|
+
cookiejar (>= 0.3.0)
|
84
|
+
em-http-request (>= 1.1.6)
|
85
|
+
eventmachine (>= 0.12.0)
|
86
|
+
faye-websocket (>= 0.11.0)
|
87
|
+
multi_json (>= 1.0.0)
|
88
|
+
rack (>= 1.0.0)
|
89
|
+
websocket-driver (>= 0.5.1)
|
90
|
+
faye-websocket (0.11.1)
|
91
|
+
eventmachine (>= 0.12.0)
|
92
|
+
websocket-driver (>= 0.5.1)
|
93
|
+
hashdiff (1.0.1)
|
94
|
+
http_parser.rb (0.8.0)
|
95
|
+
i18n (1.12.0)
|
96
|
+
concurrent-ruby (~> 1.0)
|
97
|
+
jwt (2.7.0)
|
98
|
+
memoist (0.16.2)
|
99
|
+
method_source (1.0.0)
|
100
|
+
minitest (5.17.0)
|
101
|
+
mocha (1.16.1)
|
102
|
+
multi_json (1.15.0)
|
103
|
+
multipart-post (2.3.0)
|
104
|
+
mysql2 (0.5.5)
|
105
|
+
net-http-persistent (4.0.1)
|
106
|
+
connection_pool (~> 2.2)
|
107
|
+
peatio (3.1.1)
|
108
|
+
activemodel (> 5.2)
|
109
|
+
amqp
|
110
|
+
bunny
|
111
|
+
clamp
|
112
|
+
em-synchrony (~> 1.0)
|
113
|
+
em-websocket
|
114
|
+
eventmachine
|
115
|
+
faraday (~> 1.10)
|
116
|
+
faye (~> 1.2)
|
117
|
+
jwt
|
118
|
+
mysql2
|
119
|
+
prometheus-client
|
120
|
+
thin
|
121
|
+
prometheus-client (4.0.0)
|
122
|
+
pry (0.14.2)
|
123
|
+
coderay (~> 1.1)
|
124
|
+
method_source (~> 1.0)
|
125
|
+
pry-byebug (3.10.1)
|
126
|
+
byebug (~> 11.0)
|
127
|
+
pry (>= 0.13, < 0.15)
|
128
|
+
public_suffix (5.0.1)
|
129
|
+
rack (2.2.6.2)
|
130
|
+
rake (13.0.6)
|
131
|
+
rbtree (0.4.6)
|
132
|
+
rexml (3.2.5)
|
133
|
+
rspec (3.12.0)
|
134
|
+
rspec-core (~> 3.12.0)
|
135
|
+
rspec-expectations (~> 3.12.0)
|
136
|
+
rspec-mocks (~> 3.12.0)
|
137
|
+
rspec-core (3.12.1)
|
138
|
+
rspec-support (~> 3.12.0)
|
139
|
+
rspec-expectations (3.12.2)
|
140
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
141
|
+
rspec-support (~> 3.12.0)
|
142
|
+
rspec-mocks (3.12.3)
|
143
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
144
|
+
rspec-support (~> 3.12.0)
|
145
|
+
rspec-support (3.12.0)
|
146
|
+
ruby2_keywords (0.0.5)
|
147
|
+
set (1.0.3)
|
148
|
+
sorted_set (1.0.3)
|
149
|
+
rbtree
|
150
|
+
set (~> 1.0)
|
151
|
+
thin (1.8.1)
|
152
|
+
daemons (~> 1.0, >= 1.0.9)
|
153
|
+
eventmachine (~> 1.0, >= 1.0.4)
|
154
|
+
rack (>= 1, < 3)
|
155
|
+
tzinfo (2.0.6)
|
156
|
+
concurrent-ruby (~> 1.0)
|
157
|
+
webmock (3.18.1)
|
158
|
+
addressable (>= 2.8.0)
|
159
|
+
crack (>= 0.3.2)
|
160
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
161
|
+
websocket-driver (0.7.5)
|
162
|
+
websocket-extensions (>= 0.1.0)
|
163
|
+
websocket-extensions (0.1.5)
|
164
|
+
zeitwerk (2.6.7)
|
165
|
+
|
166
|
+
PLATFORMS
|
167
|
+
arm64-darwin-21
|
168
|
+
|
169
|
+
DEPENDENCIES
|
170
|
+
bundler (~> 2.4.7)
|
171
|
+
mocha (~> 1.8)
|
172
|
+
peatio-bitgo!
|
173
|
+
pry-byebug
|
174
|
+
rake (~> 13.0)
|
175
|
+
rspec (~> 3.0)
|
176
|
+
webmock (~> 3.5)
|
177
|
+
|
178
|
+
BUNDLED WITH
|
179
|
+
2.4.7
|
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
|
@@ -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
|