sibit 0.25.1 → 0.27.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +18 -28
  3. data/Gemfile.lock +187 -0
  4. data/LICENSE.txt +1 -1
  5. data/LICENSES/MIT.txt +21 -0
  6. data/README.md +80 -60
  7. data/REUSE.toml +35 -0
  8. data/Rakefile +3 -29
  9. data/bin/sibit +9 -28
  10. data/cucumber.yml +3 -0
  11. data/features/cli.feature +2 -0
  12. data/features/gem_package.feature +4 -1
  13. data/features/step_definitions/steps.rb +2 -19
  14. data/features/support/env.rb +2 -19
  15. data/lib/sibit/bestof.rb +5 -22
  16. data/lib/sibit/bitcoin/base58.rb +50 -0
  17. data/lib/sibit/bitcoin/key.rb +87 -0
  18. data/lib/sibit/bitcoin/script.rb +58 -0
  19. data/lib/sibit/bitcoin/tx.rb +212 -0
  20. data/lib/sibit/bitcoin/txbuilder.rb +120 -0
  21. data/lib/sibit/bitcoinchain.rb +5 -22
  22. data/lib/sibit/blockchain.rb +5 -22
  23. data/lib/sibit/blockchair.rb +5 -22
  24. data/lib/sibit/btc.rb +6 -23
  25. data/lib/sibit/cex.rb +5 -22
  26. data/lib/sibit/cryptoapis.rb +5 -22
  27. data/lib/sibit/error.rb +3 -20
  28. data/lib/sibit/fake.rb +3 -20
  29. data/lib/sibit/firstof.rb +5 -22
  30. data/lib/sibit/http.rb +3 -20
  31. data/lib/sibit/json.rb +6 -23
  32. data/lib/sibit/version.rb +4 -21
  33. data/lib/sibit.rb +31 -40
  34. data/logo.svg +1 -1
  35. data/sibit.gemspec +16 -32
  36. metadata +26 -48
  37. data/.0pdd.yml +0 -9
  38. data/.gitattributes +0 -7
  39. data/.github/workflows/codecov.yml +0 -21
  40. data/.github/workflows/pdd.yml +0 -15
  41. data/.github/workflows/rake.yml +0 -24
  42. data/.github/workflows/xcop.yml +0 -17
  43. data/.gitignore +0 -8
  44. data/.pdd +0 -7
  45. data/.rubocop.yml +0 -38
  46. data/.rultor.yml +0 -21
  47. data/.simplecov +0 -40
  48. data/lib/sibit/earn.rb +0 -102
  49. data/lib/sibit/log.rb +0 -49
  50. data/renovate.json +0 -6
  51. data/test/test__helper.rb +0 -29
  52. data/test/test_bestof.rb +0 -62
  53. data/test/test_bitcoinchain.rb +0 -73
  54. data/test/test_blockchain.rb +0 -58
  55. data/test/test_blockchair.rb +0 -43
  56. data/test/test_btc.rb +0 -117
  57. data/test/test_cex.rb +0 -43
  58. data/test/test_cryptoapis.rb +0 -51
  59. data/test/test_fake.rb +0 -55
  60. data/test/test_firstof.rb +0 -62
  61. data/test/test_json.rb +0 -40
  62. data/test/test_live.rb +0 -138
  63. data/test/test_sibit.rb +0 -209
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c96fa92b49010bf09b0fa6594639e188ff9dcfe72692b540bc657aba3d02a9c
4
- data.tar.gz: 93cf762ac7f84cc37852514d7e8159c676557c381d6e914282bcbe990a618f09
3
+ metadata.gz: e8969169f4a0ed8a12f015d3e66cd7a4e74cf2e3e1210828370eab0dc2680b99
4
+ data.tar.gz: 296a09009b913387406c1f285916b6a33ef3fd1871c07951f703e1f187937f9a
5
5
  SHA512:
6
- metadata.gz: 5a8729abe648eb000de1b38057ce2af871b2041cdd5e0a3a3b30fac992474204b81b33d074660e9198cfd96997c51e241a78c1253227ff11e62e0f3beaf04103
7
- data.tar.gz: df24903894aa9f3efdc5f73cea961c0bddc3dd5f543cc801de21d79484e23c362132001de1bcd36b530e133ad682bab2dbfe7aa4be0e752d70aa71ba61f71a60
6
+ metadata.gz: de21c1b789b8bc2c4671e303aa8c613fb9d6b88b9a28ba7787d82212cbda08cad277c74d2c655c14dd21e3f462ad5b9a26275da3f45fc246fa8e837d177cf743
7
+ data.tar.gz: c737bc8c538266bb00c2be64c0604da1035065a6fe1a0fa094be0f6180c46ab5df9f3483d577511c45d43b215423fd0c04971e54bcfacb4f8a945c93182cace1
data/Gemfile CHANGED
@@ -1,35 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2019-2023 Yegor Bugayenko
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 all
13
- # 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 THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2019-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  source 'https://rubygems.org'
24
7
  gemspec
25
8
 
26
- gem 'aruba', '2.2.0', require: false
27
- gem 'cucumber', '9.1.0', require: false
28
9
  # gem 'debase', '0.2.4.1', require: false
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
- gem 'simplecov', '0.22.0', require: false
35
- gem 'webmock', '3.19.1', require: false
10
+
11
+ gem 'aruba', '~>2.2', require: false
12
+ gem 'cucumber', '~>9.1', require: false
13
+ gem 'logger', '~>1.7', require: false
14
+ gem 'minitest', '~>6.0', require: false
15
+ gem 'minitest-reporters', '~>1.7', require: false
16
+ gem 'nokogiri', '~>1.18', require: false
17
+ gem 'rake', '~>13.2', require: false
18
+ gem 'rdoc', '~>7.0', require: false
19
+ gem 'rubocop', '~>1.62', require: false
20
+ gem 'rubocop-minitest', '~>0.38', require: false
21
+ gem 'rubocop-performance', '~>1.25', require: false
22
+ gem 'rubocop-rake', '~>0.7', require: false
23
+ gem 'simplecov', '~>0.22', require: false
24
+ gem 'simplecov-cobertura', '~>3.0', require: false
25
+ gem 'webmock', '~>3.23', require: false
data/Gemfile.lock ADDED
@@ -0,0 +1,187 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sibit (0.0.0)
5
+ backtrace (~> 0.3)
6
+ iri (~> 0.5)
7
+ json (~> 2)
8
+ loog (~> 0.6)
9
+ openssl (>= 2.0)
10
+ retriable_proxy (~> 1.0)
11
+ slop (~> 4.6)
12
+
13
+ GEM
14
+ remote: https://rubygems.org/
15
+ specs:
16
+ addressable (2.8.8)
17
+ public_suffix (>= 2.0.2, < 8.0)
18
+ ansi (1.5.0)
19
+ aruba (2.3.3)
20
+ bundler (>= 1.17)
21
+ contracts (>= 0.16.0, < 0.18.0)
22
+ cucumber (>= 8.0, < 11.0)
23
+ rspec-expectations (>= 3.4, < 5.0)
24
+ thor (~> 1.0)
25
+ ast (2.4.3)
26
+ backtrace (0.4.1)
27
+ bigdecimal (4.0.1)
28
+ builder (3.3.0)
29
+ contracts (0.17.3)
30
+ crack (1.0.1)
31
+ bigdecimal
32
+ rexml
33
+ cucumber (9.2.1)
34
+ builder (~> 3.2)
35
+ cucumber-ci-environment (> 9, < 11)
36
+ cucumber-core (> 13, < 14)
37
+ cucumber-cucumber-expressions (~> 17.0)
38
+ cucumber-gherkin (> 24, < 28)
39
+ cucumber-html-formatter (> 20.3, < 22)
40
+ cucumber-messages (> 19, < 25)
41
+ diff-lcs (~> 1.5)
42
+ mini_mime (~> 1.1)
43
+ multi_test (~> 1.1)
44
+ sys-uname (~> 1.2)
45
+ cucumber-ci-environment (10.0.1)
46
+ cucumber-core (13.0.3)
47
+ cucumber-gherkin (>= 27, < 28)
48
+ cucumber-messages (>= 20, < 23)
49
+ cucumber-tag-expressions (> 5, < 7)
50
+ cucumber-cucumber-expressions (17.1.0)
51
+ bigdecimal
52
+ cucumber-gherkin (27.0.0)
53
+ cucumber-messages (>= 19.1.4, < 23)
54
+ cucumber-html-formatter (21.15.1)
55
+ cucumber-messages (> 19, < 28)
56
+ cucumber-messages (22.0.0)
57
+ cucumber-tag-expressions (6.1.2)
58
+ date (3.5.1)
59
+ diff-lcs (1.6.2)
60
+ docile (1.4.1)
61
+ erb (6.0.1)
62
+ ffi (1.17.2-arm64-darwin)
63
+ ffi (1.17.2-x86_64-linux-gnu)
64
+ hashdiff (1.2.1)
65
+ iri (0.11.3)
66
+ json (2.18.0)
67
+ language_server-protocol (3.17.0.5)
68
+ lint_roller (1.1.0)
69
+ logger (1.7.0)
70
+ loog (0.6.1)
71
+ logger (~> 1.0)
72
+ memoist3 (1.0.0)
73
+ mini_mime (1.1.5)
74
+ minitest (6.0.0)
75
+ prism (~> 1.5)
76
+ minitest-reporters (1.7.1)
77
+ ansi
78
+ builder
79
+ minitest (>= 5.0)
80
+ ruby-progressbar
81
+ multi_test (1.1.0)
82
+ nokogiri (1.18.10-arm64-darwin)
83
+ racc (~> 1.4)
84
+ nokogiri (1.18.10-x86_64-linux-gnu)
85
+ racc (~> 1.4)
86
+ openssl (4.0.0)
87
+ parallel (1.27.0)
88
+ parser (3.3.10.0)
89
+ ast (~> 2.4.1)
90
+ racc
91
+ prism (1.7.0)
92
+ psych (5.3.1)
93
+ date
94
+ stringio
95
+ public_suffix (7.0.0)
96
+ racc (1.8.1)
97
+ rainbow (3.1.1)
98
+ rake (13.3.1)
99
+ rdoc (7.0.2)
100
+ erb
101
+ psych (>= 4.0.0)
102
+ tsort
103
+ regexp_parser (2.11.3)
104
+ retriable (3.1.2)
105
+ retriable_proxy (1.0.2)
106
+ retriable (>= 2.0, < 4.0)
107
+ rexml (3.4.4)
108
+ rspec-expectations (3.13.5)
109
+ diff-lcs (>= 1.2.0, < 2.0)
110
+ rspec-support (~> 3.13.0)
111
+ rspec-support (3.13.6)
112
+ rubocop (1.82.0)
113
+ json (~> 2.3)
114
+ language_server-protocol (~> 3.17.0.2)
115
+ lint_roller (~> 1.1.0)
116
+ parallel (~> 1.10)
117
+ parser (>= 3.3.0.2)
118
+ rainbow (>= 2.2.2, < 4.0)
119
+ regexp_parser (>= 2.9.3, < 3.0)
120
+ rubocop-ast (>= 1.48.0, < 2.0)
121
+ ruby-progressbar (~> 1.7)
122
+ unicode-display_width (>= 2.4.0, < 4.0)
123
+ rubocop-ast (1.48.0)
124
+ parser (>= 3.3.7.2)
125
+ prism (~> 1.4)
126
+ rubocop-minitest (0.38.2)
127
+ lint_roller (~> 1.1)
128
+ rubocop (>= 1.75.0, < 2.0)
129
+ rubocop-ast (>= 1.38.0, < 2.0)
130
+ rubocop-performance (1.26.1)
131
+ lint_roller (~> 1.1)
132
+ rubocop (>= 1.75.0, < 2.0)
133
+ rubocop-ast (>= 1.47.1, < 2.0)
134
+ rubocop-rake (0.7.1)
135
+ lint_roller (~> 1.1)
136
+ rubocop (>= 1.72.1)
137
+ ruby-progressbar (1.13.0)
138
+ simplecov (0.22.0)
139
+ docile (~> 1.1)
140
+ simplecov-html (~> 0.11)
141
+ simplecov_json_formatter (~> 0.1)
142
+ simplecov-cobertura (3.1.0)
143
+ rexml
144
+ simplecov (~> 0.19)
145
+ simplecov-html (0.13.2)
146
+ simplecov_json_formatter (0.1.4)
147
+ slop (4.10.1)
148
+ stringio (3.2.0)
149
+ sys-uname (1.4.1)
150
+ ffi (~> 1.1)
151
+ memoist3 (~> 1.0.0)
152
+ thor (1.4.0)
153
+ tsort (0.2.0)
154
+ unicode-display_width (3.2.0)
155
+ unicode-emoji (~> 4.1)
156
+ unicode-emoji (4.2.0)
157
+ webmock (3.26.1)
158
+ addressable (>= 2.8.0)
159
+ crack (>= 0.3.2)
160
+ hashdiff (>= 0.4.0, < 2.0.0)
161
+
162
+ PLATFORMS
163
+ arm64-darwin-22
164
+ arm64-darwin-23
165
+ arm64-darwin-24
166
+ x86_64-linux
167
+
168
+ DEPENDENCIES
169
+ aruba (~> 2.2)
170
+ cucumber (~> 9.1)
171
+ logger (~> 1.7)
172
+ minitest (~> 6.0)
173
+ minitest-reporters (~> 1.7)
174
+ nokogiri (~> 1.18)
175
+ rake (~> 13.2)
176
+ rdoc (~> 7.0)
177
+ rubocop (~> 1.62)
178
+ rubocop-minitest (~> 0.38)
179
+ rubocop-performance (~> 1.25)
180
+ rubocop-rake (~> 0.7)
181
+ sibit!
182
+ simplecov (~> 0.22)
183
+ simplecov-cobertura (~> 3.0)
184
+ webmock (~> 3.23)
185
+
186
+ BUNDLED WITH
187
+ 2.5.16
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2019-2023 Yegor Bugayenko
3
+ Copyright (c) 2019-2025 Yegor Bugayenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the 'Software'), to deal
data/LICENSES/MIT.txt ADDED
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2019-2025 Yegor Bugayenko
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,81 +1,82 @@
1
- <img alt="logo" src="/logo.svg" width="64px"/>
1
+ # Send Bitcoin via Command Line, in Ruby
2
2
 
3
3
  [![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
4
- [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/sibit)](http://www.rultor.com/p/yegor256/sibit)
4
+ [![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/sibit)](https://www.rultor.com/p/yegor256/sibit)
5
5
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
6
6
 
7
7
  [![rake](https://github.com/yegor256/sibit/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/sibit/actions/workflows/rake.yml)
8
- [![PDD status](http://www.0pdd.com/svg?name=yegor256/sibit)](http://www.0pdd.com/p?name=yegor256/sibit)
9
- [![Gem Version](https://badge.fury.io/rb/sibit.svg)](http://badge.fury.io/rb/sibit)
8
+ [![PDD status](https://www.0pdd.com/svg?name=yegor256/sibit)](https://www.0pdd.com/p?name=yegor256/sibit)
9
+ [![Gem Version](https://badge.fury.io/rb/sibit.svg)](https://badge.fury.io/rb/sibit)
10
10
  [![Maintainability](https://api.codeclimate.com/v1/badges/74c909f06d4afa0d8001/maintainability)](https://codeclimate.com/github/yegor256/sibit/maintainability)
11
11
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/takes/sibit/master/LICENSE.txt)
12
12
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/sibit.svg)](https://codecov.io/github/yegor256/sibit?branch=master)
13
13
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/sibit)](https://hitsofcode.com/view/github/yegor256/sibit)
14
14
 
15
- To understand how Bitcoin protocol works, I recommend you watching
16
- this [short video](https://www.youtube.com/watch?v=IV9pRBq5A4g) and
15
+ To understand how the Bitcoin protocol works,
16
+ I recommend you watching this [short video] and
17
17
  then reading this blog post of mine:
18
- [_Sibit Demonstrates How Bitcoin Works_](https://www.yegor256.com/2019/05/07/sibit-bitcoin-command-line-client.html).
19
-
20
- This is a simple Bitcoin client, to use from the command line
21
- or from your Ruby app. You don't need to run any Bitcoin software,
22
- no need to install anything, and so on. All you need is just a command line
23
- and [Ruby](https://www.ruby-lang.org/en/) 2.3+. The purpose of this
24
- client is to simplify most typical operations with Bitcoin. If you need
25
- something more complex, I would recommend using
26
- [bitcoin-ruby](https://github.com/lian/bitcoin-ruby) for Ruby and
27
- [Electrum](https://electrum.org/) as a GUI client.
28
-
29
- You may want to discuss this tool at [Bitcointalk](https://bitcointalk.org/index.php?topic=5130324)
18
+ [_Sibit Demonstrates How Bitcoin Works_][blog].
19
+
20
+ This is a simple Bitcoin client for use from the command line
21
+ or from your Ruby app.
22
+ You don't need to run any Bitcoin software or install anything.
23
+ All you need is just a command line and [Ruby] 2.3+.
24
+ The purpose of this client is to simplify most typical operations with Bitcoin.
25
+ If you need something more complex, I would recommend using
26
+ [bitcoin-ruby] for Ruby and [Electrum] as a GUI client.
27
+
28
+ You may want to discuss this tool at [Bitcointalk]
30
29
  and give the thread a few merits.
31
30
 
32
- This is a Ruby gem, install it first (if doesn't work, there are
31
+ This is a Ruby gem, install it first (if it doesn't work, there are
33
32
  some hints at the bottom of this page):
34
33
 
35
34
  ```bash
36
- $ gem install sibit
35
+ gem install sibit
37
36
  ```
38
37
 
39
- Then, you generate a [private key](https://en.bitcoin.it/wiki/Private_key):
38
+ Then, you generate a [private key]:
40
39
 
41
40
  ```bash
42
- $ sibit generate
41
+ sibit generate
43
42
  E9873D79C6D87FC233AA332626A3A3FE
44
43
  ```
45
44
 
46
- Next, you create a new [address](https://en.bitcoin.it/wiki/Address),
45
+ Next, you create a new [address],
47
46
  using your private key:
48
47
 
49
- ```
50
- $ sibit create E9873D79C6D87FC233AA332626A3A3FE
48
+ ```bash
49
+ sibit create E9873D79C6D87FC233AA332626A3A3FE
51
50
  1CC3X2gu58d6wXUWMffpuzN9JAfTUWu4Kj
52
51
  ```
53
52
 
54
53
  To check the balance at the address (the result is in
55
- [satoshi](https://en.bitcoin.it/wiki/Satoshi_%28unit%29)):
54
+ [satoshi]):
56
55
 
57
- ```
58
- $ sibit balance 1CC3X2gu58d6wXUWMffpuzN9JAfTUWu4Kj
56
+ ```bash
57
+ sibit balance 1CC3X2gu58d6wXUWMffpuzN9JAfTUWu4Kj
59
58
  80988977
60
59
  ```
61
60
 
62
61
  To send a payment from a few addresses to a new address:
63
62
 
64
- ```
65
- $ sibit pay AMOUNT FEE A1:P1,A2:P2,... TARGET CHANGE
63
+ ```bash
64
+ sibit pay AMOUNT FEE A1:P1,A2:P2,... TARGET CHANGE
66
65
  e87f138c9ebf5986151667719825c28458a28cc66f69fed4f1032a93b399fdf8
67
66
  ```
68
67
 
69
68
  Here,
70
- `AMOUNT` is the amount of [satoshi](https://en.bitcoin.it/wiki/Satoshi_%28unit%29) you are sending,
71
- `FEE` is the [miner fee](https://en.bitcoin.it/wiki/Miner_fees) you are ready to spend to make this transaction delivered
72
- (you can say `S`, `M`, `L`, or `XL` if you want it to be calculated automatically),
73
- `A1:P1,A2:P2,...` is a comma-separated list of addresses `A` and private keys `P` you are sending your coins from,
69
+ `AMOUNT` is the amount of [satoshi] you are sending,
70
+ `FEE` is the [miner fee] you are ready to spend to get
71
+ this transaction delivered
72
+ (you can say `S`, `M`, `L`, or `XL` if you want it
73
+ to be calculated automatically),
74
+ `A1:P1,A2:P2,...` is a comma-separated list
75
+ of addresses `A` and private keys `P` you are sending your coins from,
74
76
  `TARGET` is the address you are sending to,
75
77
  `CHANGE` is the address where the change will be sent to.
76
78
  The transaction hash will be returned.
77
- Not all [UTXOs](https://en.wikipedia.org/wiki/Unspent_transaction_output)
78
- will be used, but only the necessary amount of them.
79
+ Not all [UTXOs] will be used, but only the necessary amount of them.
79
80
 
80
81
  By default, the fee will be paid on top of the payment amount you are sending.
81
82
  Say, you are sending 0.5 BTC and the fee is 0.0001 BTC. Totally, you will
@@ -89,9 +90,9 @@ what's going to be sent to the network. If everything looks correct, remove
89
90
  the `--dry` and run again, the transaction will be pushed to the network.
90
91
 
91
92
  All operations are performed through the
92
- [Blockchain API](https://www.blockchain.com/api/blockchain_api).
93
+ [Blockchain API].
93
94
  Transactions are pushed to the Bitcoin network via
94
- [this relay](https://www.blockchain.com/btc/pushtx).
95
+ [this relay].
95
96
 
96
97
  ## Ruby SDK
97
98
 
@@ -108,7 +109,7 @@ change = sibit.create(pkey) # where the change will be sent to
108
109
  tx = sibit.pay(10_000_000, 'XL', { address => pkey }, target, change)
109
110
  ```
110
111
 
111
- Should work.
112
+ It should work.
112
113
 
113
114
  ## APIs
114
115
 
@@ -116,13 +117,12 @@ The library works through one (or a few) public APIs for fetching
116
117
  Bitcoin data and pushing transactions to the network. At the moment we
117
118
  work with the following APIs:
118
119
 
119
- * [Blockchain.com](https://www.blockchain.com/api/blockchain_api): `Sibit::Blockchain`
120
- * [BTC.com](https://btc.com/api-doc): `Sibit::Btc`
121
- * [Cryptoapis.io](https://docs.cryptoapis.io/rest-apis/blockchain-as-a-service-apis/btc/index): `Sibit::Cryptoapis`
122
- * [Bitcoinchain.com](https://bitcoinchain.com/api): `Sibit::Bitcoinchain`
123
- * [Blockchair.com](https://blockchair.com/api/docs): `Sibit::Blockchair`
124
- * [Cex.io](https://cex.io/rest-api): `Sibit::Cex`
125
- * [Earn.com](https://bitcoinfees.earn.com/api): `Sibit::Earn`
120
+ * [Blockchain.com] - `Sibit::Blockchain`
121
+ * [BTC.com] - `Sibit::Btc`
122
+ * [Cryptoapis.io] - `Sibit::Cryptoapis`
123
+ * [Bitcoinchain.com] - `Sibit::Bitcoinchain`
124
+ * [Blockchair.com] - `Sibit::Blockchair`
125
+ * [Cex.io] - `Sibit::Cex`
126
126
 
127
127
  The first one in this list is used by default. If you want to use a different
128
128
  one, you just specify it in the constructor of `Sibit` object:
@@ -159,28 +159,48 @@ or implement it yourself and submit a pull request.
159
159
 
160
160
  To install on a fresh Ubuntu 18:
161
161
 
162
- ```
163
- $ sudo apt-get update
164
- $ sudo apt-get install -y ruby ruby-dev autoconf automake build-essential
165
- $ sudo gem update --system
166
- $ gem install rake --no-document
167
- $ gem install sibit
162
+ ```bash
163
+ sudo apt-get update
164
+ sudo apt-get install -y ruby ruby-dev autoconf automake build-essential
165
+ sudo gem update --system
166
+ gem install rake --no-document
167
+ gem install sibit
168
168
  ```
169
169
 
170
- Should work. If it doesn't, submit an issue, I will try to help.
170
+ It should work. If it doesn't, submit an issue and I will try to help.
171
171
 
172
172
  ## How to contribute
173
173
 
174
- Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
174
+ Read [these guidelines].
175
175
  Make sure your build is green before you contribute
176
- your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
177
- [Bundler](https://bundler.io/) installed. Then:
176
+ your pull request. You will need to have [Ruby] 2.3+ and
177
+ [Bundler] installed. Then:
178
178
 
179
- ```
180
- $ bundle update
181
- $ bundle exec rake
179
+ ```bash
180
+ bundle update
181
+ bundle exec rake
182
182
  ```
183
183
 
184
184
  If it's clean and you don't see any error messages, submit your pull request.
185
185
 
186
- If it doesn't build on MacOS, check [this](https://github.com/lian/bitcoin-ruby/pull/308) out.
186
+ [address]: https://en.bitcoin.it/wiki/Address
187
+ [bitcoin-ruby]: https://github.com/lian/bitcoin-ruby
188
+ [Bitcoinchain.com]: https://bitcoinchain.com/api
189
+ [Bitcointalk]: https://bitcointalk.org/index.php?topic=5130324
190
+ [Blockchain API]: https://www.blockchain.com/api/blockchain_api
191
+ [Blockchain.com]: https://www.blockchain.com/explorer
192
+ [Blockchair.com]: https://blockchair.com/api/docs
193
+ [blog]: https://www.yegor256.com/2019/05/07/sibit-bitcoin-command-line-client.html
194
+ [BTC.com]: https://btc.com/api-doc
195
+ [Bundler]: https://bundler.io/
196
+ [Cex.io]: https://cex.io/rest-api
197
+ [Cryptoapis.io]: https://docs.cryptoapis.io/rest-apis/blockchain-as-a-service-apis/btc/index
198
+ [Electrum]: https://electrum.org/
199
+ [miner fee]: https://en.bitcoin.it/wiki/Miner_fees
200
+ [private key]: https://en.bitcoin.it/wiki/Private_key
201
+ [Ruby]: https://www.ruby-lang.org/en/
202
+ [satoshi]: https://en.bitcoin.it/wiki/Satoshi_%28unit%29
203
+ [short video]: https://www.youtube.com/watch?v=IV9pRBq5A4g
204
+ [these guidelines]: https://www.yegor256.com/2014/04/15/github-guidelines.html
205
+ [this relay]: https://www.blockchain.com/btc/pushtx
206
+ [UTXOs]: https://en.wikipedia.org/wiki/Unspent_transaction_output
data/REUSE.toml ADDED
@@ -0,0 +1,35 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ version = 1
5
+ [[annotations]]
6
+ path = [
7
+ ".DS_Store",
8
+ ".gitattributes",
9
+ ".gitignore",
10
+ ".pdd",
11
+ "**.json",
12
+ "**.md",
13
+ "**.svg",
14
+ "**.txt",
15
+ "**/.DS_Store",
16
+ "**/.gitignore",
17
+ "**/.pdd",
18
+ "**/*.csv",
19
+ "**/*.jpg",
20
+ "**/*.json",
21
+ "**/*.md",
22
+ "**/*.pdf",
23
+ "**/*.png",
24
+ "**/*.svg",
25
+ "**/*.txt",
26
+ "**/*.vm",
27
+ "**/CNAME",
28
+ "**/Gemfile.lock",
29
+ "Gemfile.lock",
30
+ "README.md",
31
+ "renovate.json",
32
+ ]
33
+ precedence = "override"
34
+ SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
35
+ SPDX-License-Identifier = "MIT"
data/Rakefile CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2019-2023 Yegor Bugayenko
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 all
13
- # 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 THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2019-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'rubygems'
24
7
  require 'rake'
@@ -33,7 +16,7 @@ def version
33
16
  Gem::Specification.load(Dir['*.gemspec'].first).version
34
17
  end
35
18
 
36
- task default: %i[clean test features rubocop copyright]
19
+ task default: %i[clean test features rubocop]
37
20
 
38
21
  require 'rake/testtask'
39
22
  Rake::TestTask.new(:test) do |test|
@@ -55,7 +38,6 @@ end
55
38
  require 'rubocop/rake_task'
56
39
  RuboCop::RakeTask.new(:rubocop) do |task|
57
40
  task.fail_on_error = true
58
- task.requires << 'rubocop-rspec'
59
41
  end
60
42
 
61
43
  require 'cucumber/rake/task'
@@ -65,11 +47,3 @@ end
65
47
  Cucumber::Rake::Task.new(:'features:html') do |t|
66
48
  t.profile = 'html_report'
67
49
  end
68
-
69
- task :copyright do
70
- sh "grep -q -r '2019-#{Date.today.strftime('%Y')}' \
71
- --include '*.rb' \
72
- --include '*.txt' \
73
- --include 'Rakefile' \
74
- ."
75
- end