sibit 0.26.0 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26f4c44fb885107624430b74d7569225066671183ed74dc594f3b3485baf19d3
4
- data.tar.gz: 56bb0d2f75bf2356535feaaf14d94cc8080360189618a63324bacba2e5716170
3
+ metadata.gz: e8969169f4a0ed8a12f015d3e66cd7a4e74cf2e3e1210828370eab0dc2680b99
4
+ data.tar.gz: 296a09009b913387406c1f285916b6a33ef3fd1871c07951f703e1f187937f9a
5
5
  SHA512:
6
- metadata.gz: 39193cad324c8574b4a42f043b4f6c6b4eba0f948dfe2fc3185f5f49316b24859a7df0807864e0a858a2574eadb0c41bc181b133adda0d7a3292d9980eae059c
7
- data.tar.gz: 164fa4a3b6627ac4b0dedb3513aa332bc06aa627320ed1dd44007f001b74d48694165893d6345095b7a79ab3cdd271bab7a1bbd9a87ef3a0135112c7e8eadb0b
6
+ metadata.gz: de21c1b789b8bc2c4671e303aa8c613fb9d6b88b9a28ba7787d82212cbda08cad277c74d2c655c14dd21e3f462ad5b9a26275da3f45fc246fa8e837d177cf743
7
+ data.tar.gz: c737bc8c538266bb00c2be64c0604da1035065a6fe1a0fa094be0f6180c46ab5df9f3483d577511c45d43b215423fd0c04971e54bcfacb4f8a945c93182cace1
data/README.md CHANGED
@@ -123,7 +123,6 @@ work with the following APIs:
123
123
  * [Bitcoinchain.com] - `Sibit::Bitcoinchain`
124
124
  * [Blockchair.com] - `Sibit::Blockchair`
125
125
  * [Cex.io] - `Sibit::Cex`
126
- * [Earn.com] - `Sibit::Earn`
127
126
 
128
127
  The first one in this list is used by default. If you want to use a different
129
128
  one, you just specify it in the constructor of `Sibit` object:
@@ -196,7 +195,6 @@ If it's clean and you don't see any error messages, submit your pull request.
196
195
  [Bundler]: https://bundler.io/
197
196
  [Cex.io]: https://cex.io/rest-api
198
197
  [Cryptoapis.io]: https://docs.cryptoapis.io/rest-apis/blockchain-as-a-service-apis/btc/index
199
- [Earn.com]: https://bitcoinfees.earn.com/api
200
198
  [Electrum]: https://electrum.org/
201
199
  [miner fee]: https://en.bitcoin.it/wiki/Miner_fees
202
200
  [private key]: https://en.bitcoin.it/wiki/Private_key
data/bin/sibit CHANGED
@@ -21,7 +21,6 @@ require_relative '../lib/sibit/blockchain'
21
21
  require_relative '../lib/sibit/blockchair'
22
22
  require_relative '../lib/sibit/btc'
23
23
  require_relative '../lib/sibit/cex'
24
- require_relative '../lib/sibit/earn'
25
24
  require_relative '../lib/sibit/fake'
26
25
  require_relative '../lib/sibit/firstof'
27
26
  require_relative '../lib/sibit/version'
@@ -53,8 +52,8 @@ Options are:"
53
52
  o.bool '--verbose', 'Print all possible debug messages'
54
53
  o.array(
55
54
  '--api',
56
- 'Ordered List of APIs to use, e.g. "earn,blockchain,btc,bitcoinchain"',
57
- default: %w[earn blockchain btc bitcoinchain blockchair cex]
55
+ 'Ordered List of APIs to use, e.g. "eblockchain,btc,bitcoinchain"',
56
+ default: %w[blockchain btc bitcoinchain blockchair cex]
58
57
  )
59
58
  o.array(
60
59
  '--skip-utxo',
@@ -83,8 +82,6 @@ Options are:"
83
82
  api = Sibit::Cex.new(http: http, log: log, dry: opts[:dry])
84
83
  when 'fake'
85
84
  api = Sibit::Fake.new
86
- when 'earn'
87
- api = Sibit::Earn.new(http: http, log: log, dry: opts[:dry])
88
85
  else
89
86
  raise Sibit::Error, "Unknown API \"#{a}\""
90
87
  end
data/lib/sibit/version.rb CHANGED
@@ -9,5 +9,5 @@
9
9
  # License:: MIT
10
10
  class Sibit
11
11
  # Current version of the library.
12
- VERSION = '0.26.0'
12
+ VERSION = '0.27.0'
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -144,7 +144,6 @@ files:
144
144
  - lib/sibit/btc.rb
145
145
  - lib/sibit/cex.rb
146
146
  - lib/sibit/cryptoapis.rb
147
- - lib/sibit/earn.rb
148
147
  - lib/sibit/error.rb
149
148
  - lib/sibit/fake.rb
150
149
  - lib/sibit/firstof.rb
data/lib/sibit/earn.rb DELETED
@@ -1,86 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # SPDX-FileCopyrightText: Copyright (c) 2019-2025 Yegor Bugayenko
4
- # SPDX-License-Identifier: MIT
5
-
6
- require 'iri'
7
- require 'json'
8
- require 'loog'
9
- require 'uri'
10
- require_relative 'error'
11
- require_relative 'http'
12
- require_relative 'json'
13
- require_relative 'version'
14
-
15
- # Earn.com API.
16
- #
17
- # Author:: Yegor Bugayenko (yegor256@gmail.com)
18
- # Copyright:: Copyright (c) 2019-2025 Yegor Bugayenko
19
- # License:: MIT
20
- class Sibit
21
- # Blockchain.info API.
22
- class Earn
23
- # Constructor.
24
- def initialize(log: Loog::NULL, http: Sibit::Http.new, dry: false)
25
- @http = http
26
- @log = log
27
- @dry = dry
28
- end
29
-
30
- # Current price of BTC in USD (float returned).
31
- def price(_currency)
32
- raise Sibit::NotSupportedError, 'price() doesn\'t work here'
33
- end
34
-
35
- # Gets the balance of the address, in satoshi.
36
- def balance(_address)
37
- raise Sibit::NotSupportedError, 'balance() doesn\'t work here'
38
- end
39
-
40
- # Get hash of the block after this one.
41
- def next_of(_hash)
42
- raise Sibit::NotSupportedError, 'Earn.com API doesn\'t provide next_of()'
43
- end
44
-
45
- # The height of the block.
46
- def height(_hash)
47
- raise Sibit::NotSupportedError, 'Earn API doesn\'t provide height()'
48
- end
49
-
50
- # Get recommended fees, in satoshi per byte. The method returns
51
- # a hash: { S: 12, M: 45, L: 100, XL: 200 }
52
- def fees
53
- json = Sibit::Json.new(http: @http, log: @log).get(
54
- Iri.new('https://bitcoinfees.earn.com/api/v1/fees/recommended')
55
- )
56
- @log.info("Current recommended Bitcoin fees: \
57
- #{json['hourFee']}/#{json['halfHourFee']}/#{json['fastestFee']} sat/byte")
58
- {
59
- S: json['hourFee'] / 3,
60
- M: json['hourFee'],
61
- L: json['halfHourFee'],
62
- XL: json['fastestFee']
63
- }
64
- end
65
-
66
- # Fetch all unspent outputs per address.
67
- def utxos(_sources)
68
- raise Sibit::NotSupportedError, 'Not implemented yet'
69
- end
70
-
71
- # Push this transaction (in hex format) to the network.
72
- def push(_hex)
73
- raise Sibit::NotSupportedError, 'Not implemented yet'
74
- end
75
-
76
- # Gets the hash of the latest block.
77
- def latest
78
- raise Sibit::NotSupportedError, 'latest() doesn\'t work here'
79
- end
80
-
81
- # This method should fetch a Blockchain block and return as a hash.
82
- def block(_hash)
83
- raise Sibit::NotSupportedError, 'block() doesn\'t work here'
84
- end
85
- end
86
- end