sibit 0.23.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/codecov.yml +5 -4
- data/.github/workflows/pdd.yml +2 -2
- data/.github/workflows/rake.yml +2 -2
- data/.github/workflows/xcop.yml +2 -2
- data/.rubocop.yml +2 -0
- data/.rultor.yml +4 -3
- data/Gemfile +8 -8
- data/README.md +2 -1
- data/bin/sibit +9 -2
- data/features/step_definitions/steps.rb +1 -1
- data/lib/sibit/version.rb +1 -1
- data/lib/sibit.rb +5 -1
- data/sibit.gemspec +6 -5
- data/test/test_live.rb +1 -1
- metadata +24 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 364eb8486479c6cc2120f3552ebec6288231e541170d1fa334aef22fa8ef5233
|
|
4
|
+
data.tar.gz: 881c7edb68dcd2c29c51c3bc2f4256d76002eb563b585d8c51f7a2a5be4fd8a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 858cd0c53abb6b0751cf68ebf057500049eaca460cfad4f13197b6d57768ef930ad77c24c8ecaab78e17cc33cba663d53ac89b8c757fa0cc6b91a15892ad79eb
|
|
7
|
+
data.tar.gz: ef43ae0cd84001faa1bfa0ef66ff01693a2e2a1f358e517740c7842790b2c36b05babc9a2fe7c6050188a23536801e2c37130a7d0601d0905fa960e5a4931900
|
|
@@ -6,15 +6,16 @@ on:
|
|
|
6
6
|
- master
|
|
7
7
|
jobs:
|
|
8
8
|
codecov:
|
|
9
|
-
runs-on: ubuntu-
|
|
9
|
+
runs-on: ubuntu-22.04
|
|
10
10
|
steps:
|
|
11
|
-
- uses: actions/checkout@
|
|
12
|
-
- uses:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: ruby/setup-ruby@v1
|
|
13
13
|
with:
|
|
14
14
|
ruby-version: 2.7
|
|
15
15
|
- run: bundle update
|
|
16
16
|
- run: bundle exec rake
|
|
17
|
-
- uses: codecov/codecov-action@
|
|
17
|
+
- uses: codecov/codecov-action@v4.0.0-beta.3
|
|
18
18
|
with:
|
|
19
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
19
20
|
file: coverage/.resultset.json
|
|
20
21
|
fail_ci_if_error: true
|
data/.github/workflows/pdd.yml
CHANGED
data/.github/workflows/rake.yml
CHANGED
|
@@ -13,10 +13,10 @@ jobs:
|
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
15
|
os: [ubuntu-20.04]
|
|
16
|
-
ruby: [2.
|
|
16
|
+
ruby: [2.7, 3.1]
|
|
17
17
|
runs-on: ${{ matrix.os }}
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
20
|
- uses: ruby/setup-ruby@v1
|
|
21
21
|
with:
|
|
22
22
|
ruby-version: ${{ matrix.ruby }}
|
data/.github/workflows/xcop.yml
CHANGED
data/.rubocop.yml
CHANGED
data/.rultor.yml
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
docker:
|
|
2
|
-
image: yegor256/rultor-image:1.
|
|
2
|
+
image: yegor256/rultor-image:1.22.0
|
|
3
3
|
assets:
|
|
4
4
|
rubygems.yml: yegor256/home#assets/rubygems.yml
|
|
5
5
|
install: |
|
|
6
|
-
|
|
6
|
+
rvm default 2.7.6 && source /usr/local/rvm/scripts/rvm
|
|
7
|
+
gem install pdd
|
|
7
8
|
pdd -f /dev/null
|
|
8
|
-
|
|
9
|
+
bundle install --no-color "--gemfile=$(pwd)/Gemfile"
|
|
9
10
|
release:
|
|
10
11
|
script: |-
|
|
11
12
|
bundle exec rake clean test rubocop copyright
|
data/Gemfile
CHANGED
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
source 'https://rubygems.org'
|
|
24
24
|
gemspec
|
|
25
25
|
|
|
26
|
-
gem 'aruba', '2.
|
|
27
|
-
gem 'cucumber', '
|
|
26
|
+
gem 'aruba', '2.2.0', require: false
|
|
27
|
+
gem 'cucumber', '9.1.0', require: false
|
|
28
28
|
# gem 'debase', '0.2.4.1', require: false
|
|
29
|
-
gem 'minitest', '5.
|
|
30
|
-
gem 'rake', '13.0
|
|
31
|
-
gem 'rspec-rails', '
|
|
32
|
-
gem 'rubocop', '1.
|
|
33
|
-
gem 'rubocop-rspec', '2.
|
|
29
|
+
gem 'minitest', '5.20.0', require: false
|
|
30
|
+
gem 'rake', '13.1.0', require: false
|
|
31
|
+
gem 'rspec-rails', '6.1.0', require: false
|
|
32
|
+
gem 'rubocop', '1.57.2', require: false
|
|
33
|
+
gem 'rubocop-rspec', '2.25.0', require: false
|
|
34
34
|
gem 'simplecov', '0.22.0', require: false
|
|
35
|
-
gem 'webmock', '3.
|
|
35
|
+
gem 'webmock', '3.19.1', require: false
|
data/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<img alt="logo" src="/logo.svg" width="64px"/>
|
|
2
2
|
|
|
3
3
|
[](https://www.elegantobjects.org)
|
|
4
|
-
[](https://www.0crat.com/p/C3RFVLU72)
|
|
5
4
|
[](http://www.rultor.com/p/yegor256/sibit)
|
|
6
5
|
[](https://www.jetbrains.com/ruby/)
|
|
7
6
|
|
|
@@ -183,3 +182,5 @@ $ bundle exec rake
|
|
|
183
182
|
```
|
|
184
183
|
|
|
185
184
|
If it's clean and you don't see any error messages, submit your pull request.
|
|
185
|
+
|
|
186
|
+
If it doesn't build on MacOS, check [this](https://github.com/lian/bitcoin-ruby/pull/308) out.
|
data/bin/sibit
CHANGED
|
@@ -26,6 +26,7 @@ $stdout.sync = true
|
|
|
26
26
|
# see https://stackoverflow.com/a/6048451/187141
|
|
27
27
|
require 'openssl'
|
|
28
28
|
OpenSSL::SSL::VERIFY_PEER ||= OpenSSL::SSL::VERIFY_NONE
|
|
29
|
+
puts OpenSSL::X509::DEFAULT_CERT_FILE
|
|
29
30
|
|
|
30
31
|
require 'slop'
|
|
31
32
|
require 'backtrace'
|
|
@@ -71,6 +72,11 @@ Options are:"
|
|
|
71
72
|
'Ordered List of APIs to use, e.g. "earn,blockchain,btc,bitcoinchain"',
|
|
72
73
|
default: %w[earn blockchain btc bitcoinchain blockchair cex]
|
|
73
74
|
)
|
|
75
|
+
o.array(
|
|
76
|
+
'--skip-utxo',
|
|
77
|
+
'List of UTXTO that must be skipped while paying',
|
|
78
|
+
default: []
|
|
79
|
+
)
|
|
74
80
|
end
|
|
75
81
|
rescue Slop::Error => e
|
|
76
82
|
raise e.message
|
|
@@ -141,14 +147,15 @@ Options are:"
|
|
|
141
147
|
puts sibit.pay(
|
|
142
148
|
amount, fee,
|
|
143
149
|
sources.split(',').map { |p| p.split(':') }.to_h,
|
|
144
|
-
target, change
|
|
150
|
+
target, change,
|
|
151
|
+
skip_utxo: opts['skip-utxo']
|
|
145
152
|
)
|
|
146
153
|
else
|
|
147
154
|
raise "Command #{opts.arguments[0]} is not supported"
|
|
148
155
|
end
|
|
149
156
|
rescue StandardError => e
|
|
150
157
|
if opts[:verbose]
|
|
151
|
-
puts Backtrace.new(e)
|
|
158
|
+
puts Backtrace.new(e)
|
|
152
159
|
else
|
|
153
160
|
puts "ERROR: #{e.message}"
|
|
154
161
|
end
|
|
@@ -44,7 +44,7 @@ end
|
|
|
44
44
|
|
|
45
45
|
Given(/^I have a "([^"]*)" file with content:$/) do |file, text|
|
|
46
46
|
FileUtils.mkdir_p(File.dirname(file)) unless File.exist?(file)
|
|
47
|
-
File.write(file, text.gsub(
|
|
47
|
+
File.write(file, text.gsub('\\xFF', 0xFF.chr))
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
When(%r{^I run bin/sibit with "([^"]*)"$}) do |arg|
|
data/lib/sibit/version.rb
CHANGED
data/lib/sibit.rb
CHANGED
|
@@ -113,7 +113,7 @@ class Sibit
|
|
|
113
113
|
# their addresses as keys and private keys as values
|
|
114
114
|
# +target+: the target address to send to
|
|
115
115
|
# +change+: the address where the change has to be sent to
|
|
116
|
-
def pay(amount, fee, sources, target, change)
|
|
116
|
+
def pay(amount, fee, sources, target, change, skip_utxo: [])
|
|
117
117
|
p = price('USD')
|
|
118
118
|
satoshi = satoshi(amount)
|
|
119
119
|
builder = Bitcoin::Builder::TxBuilder.new
|
|
@@ -123,6 +123,10 @@ class Sibit
|
|
|
123
123
|
@log.info("#{utxos.count} UTXOs found, these will be used \
|
|
124
124
|
(value/confirmations at tx_hash):")
|
|
125
125
|
utxos.each do |utxo|
|
|
126
|
+
if skip_utxo.include?(utxo[:hash])
|
|
127
|
+
@log.info("UTXO skipped: #{utxo[:hash]}")
|
|
128
|
+
next
|
|
129
|
+
end
|
|
126
130
|
unspent += utxo[:value]
|
|
127
131
|
builder.input do |i|
|
|
128
132
|
i.prev_out(utxo[:hash])
|
data/sibit.gemspec
CHANGED
|
@@ -34,10 +34,10 @@ Gem::Specification.new do |s|
|
|
|
34
34
|
s.version = Sibit::VERSION
|
|
35
35
|
s.license = 'MIT'
|
|
36
36
|
s.summary = 'Simple Bitcoin Client'
|
|
37
|
-
s.description =
|
|
38
|
-
or from your Ruby app. You don
|
|
39
|
-
no need to install anything, etc. All you need is just a command line
|
|
40
|
-
and Ruby 2.
|
|
37
|
+
s.description = "This is a simple Bitcoin client, to use from command line \
|
|
38
|
+
or from your Ruby app. You don't need to run any Bitcoin software, \
|
|
39
|
+
no need to install anything, etc. All you need is just a command line \
|
|
40
|
+
and Ruby 2.5+."
|
|
41
41
|
s.authors = ['Yegor Bugayenko']
|
|
42
42
|
s.email = 'yegor256@gmail.com'
|
|
43
43
|
s.homepage = 'http://github.com/yegor256/sibit'
|
|
@@ -49,7 +49,8 @@ and Ruby 2.3+.'
|
|
|
49
49
|
s.add_runtime_dependency 'bitcoin-ruby', '0.0.20'
|
|
50
50
|
s.add_runtime_dependency 'iri', '~> 0.5'
|
|
51
51
|
s.add_runtime_dependency 'json', '~> 2'
|
|
52
|
+
s.add_runtime_dependency 'openssl', '~>2.0'
|
|
52
53
|
s.add_runtime_dependency 'retriable_proxy', '~> 1.0'
|
|
53
54
|
s.add_runtime_dependency 'slop', '~> 4.6'
|
|
54
|
-
s.metadata['rubygems_mfa_required'] = '
|
|
55
|
+
s.metadata['rubygems_mfa_required'] = 'false'
|
|
55
56
|
end
|
data/test/test_live.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sibit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.25.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: backtrace
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '2'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: openssl
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '2.0'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '2.0'
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: retriable_proxy
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,11 +108,9 @@ dependencies:
|
|
|
94
108
|
- - "~>"
|
|
95
109
|
- !ruby/object:Gem::Version
|
|
96
110
|
version: '4.6'
|
|
97
|
-
description:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
no need to install anything, etc. All you need is just a command line
|
|
101
|
-
and Ruby 2.3+.
|
|
111
|
+
description: This is a simple Bitcoin client, to use from command line or from your
|
|
112
|
+
Ruby app. You don't need to run any Bitcoin software, no need to install anything,
|
|
113
|
+
etc. All you need is just a command line and Ruby 2.5+.
|
|
102
114
|
email: yegor256@gmail.com
|
|
103
115
|
executables:
|
|
104
116
|
- sibit
|
|
@@ -164,8 +176,8 @@ homepage: http://github.com/yegor256/sibit
|
|
|
164
176
|
licenses:
|
|
165
177
|
- MIT
|
|
166
178
|
metadata:
|
|
167
|
-
rubygems_mfa_required: '
|
|
168
|
-
post_install_message:
|
|
179
|
+
rubygems_mfa_required: 'false'
|
|
180
|
+
post_install_message:
|
|
169
181
|
rdoc_options:
|
|
170
182
|
- "--charset=UTF-8"
|
|
171
183
|
require_paths:
|
|
@@ -181,8 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
181
193
|
- !ruby/object:Gem::Version
|
|
182
194
|
version: '0'
|
|
183
195
|
requirements: []
|
|
184
|
-
rubygems_version: 3.
|
|
185
|
-
signing_key:
|
|
196
|
+
rubygems_version: 3.4.6
|
|
197
|
+
signing_key:
|
|
186
198
|
specification_version: 4
|
|
187
199
|
summary: Simple Bitcoin Client
|
|
188
200
|
test_files: []
|