sibit 0.23.1 → 0.24.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: 756f47069119e90ff758c35ee066f3fe4607cb850c6258031c980d9760e2a39b
4
- data.tar.gz: e7a5f6929de309b4d102fe67dc1552cbe51319994e79e796952da3dc7e02b6ce
3
+ metadata.gz: 454f8e5b1c59bdca8524051e3cfdc27314b4d192d37c03f295cc60a30a16472d
4
+ data.tar.gz: 5b13db6edbc82e48d413508777056cebcf0305965c6c72ed9c9e91060f90975b
5
5
  SHA512:
6
- metadata.gz: 2b63a4226b17e60e0262163a730b7c4f9e50a065fa3ef5a6451df6978395c160bad6b2dc055cbe14807e88642640baef369cfe0f515770f76ed7381e67828e45
7
- data.tar.gz: b525a7091a33542f200a2217f8922b9ab098c94ed31f16ad66b397fac9fae38f2df6fa9c73c6b4892b26bde1519de91d7a950f4bf91237e0f9ed67c0609d7e86
6
+ metadata.gz: 1d8b02c3e16cc4f99a3a39e593bc23ad49a04a706603391c3e38027e7251f9034a7a44eb07764360e25bca3dc2bb6bf7dba3b1e36fe09218ae433fb3cb20cc2a
7
+ data.tar.gz: f6f67a0c39f4728fbf73094d9ea01ced727ebd5a043fe8c2d2ba4620ea7b65fd1dffb377e3e902f3b6a21d1559a6edffd269accfae49907f354b3c4b798fcfc2
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,7 +147,8 @@ 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"
data/lib/sibit/version.rb CHANGED
@@ -26,5 +26,5 @@
26
26
  # License:: MIT
27
27
  class Sibit
28
28
  # Current version of the library.
29
- VERSION = '0.23.1'
29
+ VERSION = '0.24.0'
30
30
  end
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])
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.23.1
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko