sibit 0.21.3 → 0.21.4
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/.simplecov +1 -1
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/Rakefile +1 -1
- data/bin/sibit +1 -1
- data/features/step_definitions/steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/lib/sibit.rb +8 -2
- data/lib/sibit/bestof.rb +2 -2
- data/lib/sibit/bitcoinchain.rb +2 -2
- data/lib/sibit/blockchain.rb +2 -2
- data/lib/sibit/blockchair.rb +2 -2
- data/lib/sibit/btc.rb +2 -2
- data/lib/sibit/cex.rb +2 -2
- data/lib/sibit/cryptoapis.rb +2 -2
- data/lib/sibit/earn.rb +2 -2
- data/lib/sibit/error.rb +2 -2
- data/lib/sibit/fake.rb +2 -2
- data/lib/sibit/firstof.rb +2 -2
- data/lib/sibit/http.rb +2 -2
- data/lib/sibit/json.rb +2 -2
- data/lib/sibit/log.rb +2 -2
- data/lib/sibit/version.rb +3 -3
- data/sibit.gemspec +1 -1
- data/test/test__helper.rb +1 -1
- data/test/test_bestof.rb +2 -2
- data/test/test_bitcoinchain.rb +2 -2
- data/test/test_blockchain.rb +2 -2
- data/test/test_blockchair.rb +2 -2
- data/test/test_btc.rb +2 -2
- data/test/test_cex.rb +2 -2
- data/test/test_cryptoapis.rb +2 -2
- data/test/test_fake.rb +3 -3
- data/test/test_firstof.rb +2 -2
- data/test/test_json.rb +2 -2
- data/test/test_live.rb +2 -2
- data/test/test_sibit.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93334175f6c66f2bf72dbe72fc89eb5813d7292d5933da62101e045a807089d4
|
|
4
|
+
data.tar.gz: d6aad85381e588b3b6ede0f6b471b136cc133319425a5443e3280ef40287c8dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07beba474641abf451d3b94cc1d40ae19f86295e7606bfbe613d59eb3017ef8cdf143fdd08f63dea36ca0b32b112c61f0458e45ca2f399e893dbee325022de88
|
|
7
|
+
data.tar.gz: d589cdf99c4434a6b90c02ac20c806f094e2b984c939f71de03a9307674b88e85abb2e847f1ddf6483c5dd72fb0664e1a6dbbf493852e2c627ce247f2a110df5
|
data/.simplecov
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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/Gemfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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/LICENSE.txt
CHANGED
data/Rakefile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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/bin/sibit
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
# Copyright (c) 2019-
|
|
4
|
+
# Copyright (c) 2019-2021 Yegor Bugayenko
|
|
5
5
|
#
|
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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/features/support/env.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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/lib/sibit.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative 'sibit/blockchain'
|
|
|
28
28
|
# Sibit main class.
|
|
29
29
|
#
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class Sibit
|
|
34
34
|
# Constructor.
|
|
@@ -55,6 +55,7 @@ class Sibit
|
|
|
55
55
|
|
|
56
56
|
# Current price of 1 BTC in USD (or another currency), float returned.
|
|
57
57
|
def price(currency = 'USD')
|
|
58
|
+
raise Error, "Invalid currency #{currency.inspect}" unless /^[A-Z]{3}$/.match?(currency)
|
|
58
59
|
@api.price(currency)
|
|
59
60
|
end
|
|
60
61
|
|
|
@@ -74,16 +75,19 @@ class Sibit
|
|
|
74
75
|
|
|
75
76
|
# Gets the balance of the address, in satoshi.
|
|
76
77
|
def balance(address)
|
|
78
|
+
raise Error, "Invalid address #{address.inspect}" unless /^[0-9a-zA-Z]+$/.match?(address)
|
|
77
79
|
@api.balance(address)
|
|
78
80
|
end
|
|
79
81
|
|
|
80
82
|
# Get the height of the block.
|
|
81
83
|
def height(hash)
|
|
84
|
+
raise Error, "Invalid block hash #{hash.inspect}" unless /^[0-9a-f]{64}$/.match?(hash)
|
|
82
85
|
@api.height(hash)
|
|
83
86
|
end
|
|
84
87
|
|
|
85
88
|
# Get the hash of the next block.
|
|
86
89
|
def next_of(hash)
|
|
90
|
+
raise Error, "Invalid block hash #{hash.inspect}" unless /^[0-9a-f]{64}$/.match?(hash)
|
|
87
91
|
@api.next_of(hash)
|
|
88
92
|
end
|
|
89
93
|
|
|
@@ -182,6 +186,8 @@ class Sibit
|
|
|
182
186
|
# in satoshi. The callback should return non-false if the transaction
|
|
183
187
|
# found was useful.
|
|
184
188
|
def scan(start, max: 4)
|
|
189
|
+
raise Error, "Invalid block hash #{start.inspect}" unless /^[0-9a-f]{64}$/.match?(start)
|
|
190
|
+
raise Error, "The max number must be above zero: #{max}" if max < 1
|
|
185
191
|
block = start
|
|
186
192
|
count = 0
|
|
187
193
|
wrong = []
|
data/lib/sibit/bestof.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -27,7 +27,7 @@ require_relative 'log'
|
|
|
27
27
|
# API best of.
|
|
28
28
|
#
|
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2019-
|
|
30
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
31
31
|
# License:: MIT
|
|
32
32
|
class Sibit
|
|
33
33
|
# Best of API.
|
data/lib/sibit/bitcoinchain.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -32,7 +32,7 @@ require_relative 'version'
|
|
|
32
32
|
# Bitcoinchain.com API.
|
|
33
33
|
#
|
|
34
34
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
35
|
-
# Copyright:: Copyright (c) 2019-
|
|
35
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
36
36
|
# License:: MIT
|
|
37
37
|
class Sibit
|
|
38
38
|
# Btc.com API.
|
data/lib/sibit/blockchain.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -35,7 +35,7 @@ require_relative 'version'
|
|
|
35
35
|
# https://www.blockchain.com/api/blockchain_api
|
|
36
36
|
#
|
|
37
37
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
38
|
-
# Copyright:: Copyright (c) 2019-
|
|
38
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
39
39
|
# License:: MIT
|
|
40
40
|
class Sibit
|
|
41
41
|
# Blockchain.info API.
|
data/lib/sibit/blockchair.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -33,7 +33,7 @@ require_relative 'version'
|
|
|
33
33
|
# Blockchair.com API.
|
|
34
34
|
#
|
|
35
35
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
36
|
-
# Copyright:: Copyright (c) 2019-
|
|
36
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
37
37
|
# License:: MIT
|
|
38
38
|
class Sibit
|
|
39
39
|
# Btc.com API.
|
data/lib/sibit/btc.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -34,7 +34,7 @@ require_relative 'version'
|
|
|
34
34
|
# Here: https://btc.com/api-doc
|
|
35
35
|
#
|
|
36
36
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
37
|
-
# Copyright:: Copyright (c) 2019-
|
|
37
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
38
38
|
# License:: MIT
|
|
39
39
|
class Sibit
|
|
40
40
|
# Btc.com API.
|
data/lib/sibit/cex.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -30,7 +30,7 @@ require_relative 'json'
|
|
|
30
30
|
# Cex.io API.
|
|
31
31
|
#
|
|
32
32
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
33
|
-
# Copyright:: Copyright (c) 2019-
|
|
33
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
34
34
|
# License:: MIT
|
|
35
35
|
class Sibit
|
|
36
36
|
# Btc.com API.
|
data/lib/sibit/cryptoapis.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -32,7 +32,7 @@ require_relative 'version'
|
|
|
32
32
|
# Cryptoapis.io API.
|
|
33
33
|
#
|
|
34
34
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
35
|
-
# Copyright:: Copyright (c) 2019-
|
|
35
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
36
36
|
# License:: MIT
|
|
37
37
|
class Sibit
|
|
38
38
|
# Btc.com API.
|
data/lib/sibit/earn.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -31,7 +31,7 @@ require_relative 'version'
|
|
|
31
31
|
# Earn.com API.
|
|
32
32
|
#
|
|
33
33
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
34
|
-
# Copyright:: Copyright (c) 2019-
|
|
34
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
35
35
|
# License:: MIT
|
|
36
36
|
class Sibit
|
|
37
37
|
# Blockchain.info API.
|
data/lib/sibit/error.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
# The error.
|
|
24
24
|
#
|
|
25
25
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
26
|
-
# Copyright:: Copyright (c) 2019-
|
|
26
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
27
27
|
# License:: MIT
|
|
28
28
|
class Sibit
|
|
29
29
|
# The error.
|
data/lib/sibit/fake.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -25,7 +25,7 @@ require_relative 'version'
|
|
|
25
25
|
# Fake API.
|
|
26
26
|
#
|
|
27
27
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
28
|
-
# Copyright:: Copyright (c) 2019-
|
|
28
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
29
29
|
# License:: MIT
|
|
30
30
|
class Sibit
|
|
31
31
|
# Fake API
|
data/lib/sibit/firstof.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -27,7 +27,7 @@ require_relative 'log'
|
|
|
27
27
|
# API first of.
|
|
28
28
|
#
|
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2019-
|
|
30
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
31
31
|
# License:: MIT
|
|
32
32
|
class Sibit
|
|
33
33
|
# First of API.
|
data/lib/sibit/http.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -25,7 +25,7 @@ require 'net/http'
|
|
|
25
25
|
# HTTP interface.
|
|
26
26
|
#
|
|
27
27
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
28
|
-
# Copyright:: Copyright (c) 2019-
|
|
28
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
29
29
|
# License:: MIT
|
|
30
30
|
class Sibit
|
|
31
31
|
# This HTTP client will be used by default.
|
data/lib/sibit/json.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -34,7 +34,7 @@ require_relative 'log'
|
|
|
34
34
|
# https://www.blockchain.com/api/blockchain_api
|
|
35
35
|
#
|
|
36
36
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
37
|
-
# Copyright:: Copyright (c) 2019-
|
|
37
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
38
38
|
# License:: MIT
|
|
39
39
|
class Sibit
|
|
40
40
|
# JSON processing.
|
data/lib/sibit/log.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
# The log.
|
|
24
24
|
#
|
|
25
25
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
26
|
-
# Copyright:: Copyright (c) 2019-
|
|
26
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
27
27
|
# License:: MIT
|
|
28
28
|
class Sibit
|
|
29
29
|
# Log.
|
data/lib/sibit/version.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
# Sibit main class.
|
|
24
24
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
25
|
-
# Copyright:: Copyright (c) 2019-
|
|
25
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
26
26
|
# License:: MIT
|
|
27
27
|
class Sibit
|
|
28
28
|
# Current version of the library.
|
|
29
|
-
VERSION = '0.21.
|
|
29
|
+
VERSION = '0.21.4'
|
|
30
30
|
end
|
data/sibit.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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/test/test__helper.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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/test/test_bestof.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -27,7 +27,7 @@ require_relative '../lib/sibit/bestof'
|
|
|
27
27
|
|
|
28
28
|
# Sibit::BestOf test.
|
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2019-
|
|
30
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
31
31
|
# License:: MIT
|
|
32
32
|
class TestBestOf < Minitest::Test
|
|
33
33
|
def test_not_array
|
data/test/test_bitcoinchain.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative '../lib/sibit/bitcoinchain'
|
|
|
28
28
|
|
|
29
29
|
# Sibit::Bitcoinchain test.
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class TestBitcoinchain < Minitest::Test
|
|
34
34
|
def test_fetch_hash
|
data/test/test_blockchain.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative '../lib/sibit/blockchain'
|
|
|
28
28
|
|
|
29
29
|
# Sibit::Blockchain test.
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class TestBlockchain < Minitest::Test
|
|
34
34
|
def test_fetch_block
|
data/test/test_blockchair.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative '../lib/sibit/blockchair'
|
|
|
28
28
|
|
|
29
29
|
# Sibit::Blockchair test.
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class TestBlockchair < Minitest::Test
|
|
34
34
|
def test_fetch_balance
|
data/test/test_btc.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative '../lib/sibit/btc'
|
|
|
28
28
|
|
|
29
29
|
# Sibit::Btc test.
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class TestBtc < Minitest::Test
|
|
34
34
|
def test_get_zero_balance
|
data/test/test_cex.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative '../lib/sibit/cex'
|
|
|
28
28
|
|
|
29
29
|
# Sibit::Cex test.
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class TestBtc < Minitest::Test
|
|
34
34
|
def test_get_price
|
data/test/test_cryptoapis.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative '../lib/sibit/cryptoapis'
|
|
|
28
28
|
|
|
29
29
|
# Sibit::Cryptoapis test.
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class TestCryptoapis < Minitest::Test
|
|
34
34
|
def test_fetch_block
|
data/test/test_fake.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -27,7 +27,7 @@ require_relative '../lib/sibit/fake'
|
|
|
27
27
|
|
|
28
28
|
# Sibit::Fake test.
|
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2019-
|
|
30
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
31
31
|
# License:: MIT
|
|
32
32
|
class TestFake < Minitest::Test
|
|
33
33
|
def test_fake_object_works
|
|
@@ -41,7 +41,7 @@ class TestFake < Minitest::Test
|
|
|
41
41
|
|
|
42
42
|
def test_scan_works
|
|
43
43
|
sibit = Sibit.new(api: Sibit::Fake.new)
|
|
44
|
-
hash = '
|
|
44
|
+
hash = '00000000000000000008df8a6e1b61d1136803ac9791b8725235c9f780b4ed71'
|
|
45
45
|
found = false
|
|
46
46
|
tail = sibit.scan(hash) do |addr, tx, satoshi|
|
|
47
47
|
assert_equal(1000, satoshi)
|
data/test/test_firstof.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -27,7 +27,7 @@ require_relative '../lib/sibit/firstof'
|
|
|
27
27
|
|
|
28
28
|
# Sibit::FirstOf test.
|
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2019-
|
|
30
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
31
31
|
# License:: MIT
|
|
32
32
|
class TestFirstOf < Minitest::Test
|
|
33
33
|
def test_not_array
|
data/test/test_json.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -27,7 +27,7 @@ require_relative '../lib/sibit/json'
|
|
|
27
27
|
|
|
28
28
|
# Sibit::Json test.
|
|
29
29
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
30
|
-
# Copyright:: Copyright (c) 2019-
|
|
30
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
31
31
|
# License:: MIT
|
|
32
32
|
class TestJson < Minitest::Test
|
|
33
33
|
def test_loads_hash
|
data/test/test_live.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -28,7 +28,7 @@ require_relative '../lib/sibit'
|
|
|
28
28
|
|
|
29
29
|
# Live tests.
|
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
31
|
-
# Copyright:: Copyright (c) 2019-
|
|
31
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
32
32
|
# License:: MIT
|
|
33
33
|
class TestLive < Minitest::Test
|
|
34
34
|
def test_block
|
data/test/test_sibit.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2019-
|
|
3
|
+
# Copyright (c) 2019-2021 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
|
|
@@ -32,7 +32,7 @@ require_relative '../lib/sibit/bestof'
|
|
|
32
32
|
|
|
33
33
|
# Sibit.
|
|
34
34
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
|
35
|
-
# Copyright:: Copyright (c) 2019-
|
|
35
|
+
# Copyright:: Copyright (c) 2019-2021 Yegor Bugayenko
|
|
36
36
|
# License:: MIT
|
|
37
37
|
class TestSibit < Minitest::Test
|
|
38
38
|
def test_loads_fees
|
|
@@ -196,7 +196,8 @@ class TestSibit < Minitest::Test
|
|
|
196
196
|
end
|
|
197
197
|
sibit = Sibit.new(api: api)
|
|
198
198
|
found = false
|
|
199
|
-
|
|
199
|
+
start = '00000000000000000008df8a6e1b61d1136803ac9791b8725235c9f780b4ed71'
|
|
200
|
+
tail = sibit.scan(start) do |addr, tx, satoshi|
|
|
200
201
|
assert_equal(123, satoshi)
|
|
201
202
|
assert_equal('addr', addr)
|
|
202
203
|
assert_equal('hash:0', tx)
|
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.21.
|
|
4
|
+
version: 0.21.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: backtrace
|