onchain 2.21 → 2.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onchain/providers/insight_api.rb +14 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fb745b990ceab11128beeae574a1c362df4bbc3
|
4
|
+
data.tar.gz: f3f4cd1dce33fcf790619fb021408793b54033b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 385b51f9a0d30e2f5081329b4f546c6db6099b0bd297cba34e8dfb398ac1c2d2445b93b17dfcb68d17be8b792245da1b71b5c0b75858a322c10c06ec42c796b9
|
7
|
+
data.tar.gz: afd4fc42ec955db65a0110925c05e8dd6a4630082a6e46121c47e9d2f15fc73b8a30fc678f0ee4f17a80c771f56e84fd8985f0aff1874c64d2ec30d1d379c412
|
@@ -67,24 +67,26 @@ class OnChain::BlockChain
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def insight_send_tx(tx_hex, network = :bitcoin)
|
70
|
+
|
71
|
+
return OnChain::BlockChain.blockr_send_tx(tx_hex, network)
|
70
72
|
|
71
|
-
uri = URI.parse(get_url(network) + "tx/send")
|
72
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
73
|
+
#uri = URI.parse(get_url(network) + "tx/send")
|
74
|
+
#http = Net::HTTP.new(uri.host, uri.port)
|
73
75
|
|
74
|
-
request = Net::HTTP::Post.new(uri.request_uri)
|
75
|
-
request.body = '{"rawtx":"' + tx_hex + '"}'
|
76
|
-
response = http.request(request)
|
76
|
+
#request = Net::HTTP::Post.new(uri.request_uri)
|
77
|
+
#request.body = '{"rawtx":"' + tx_hex + '"}'
|
78
|
+
#response = http.request(request)
|
77
79
|
|
78
|
-
res = JSON.parse(response.body)
|
80
|
+
#res = JSON.parse(response.body)
|
79
81
|
|
80
|
-
mess = 'Unknown'
|
81
|
-
stat = 'Unknown'
|
82
|
-
tx_hash = res["txid"]
|
82
|
+
#mess = 'Unknown'
|
83
|
+
#stat = 'Unknown'
|
84
|
+
#tx_hash = res["txid"]
|
83
85
|
|
84
|
-
puts 'Call insight_send_tx ' + tx_hex.to_s
|
86
|
+
#puts 'Call insight_send_tx ' + tx_hex.to_s
|
85
87
|
|
86
|
-
ret = "{\"status\":\"#{stat}\",\"data\":\"#{tx_hash}\",\"code\":200,\"message\":\"#{mess}\"}"
|
87
|
-
return JSON.parse(ret)
|
88
|
+
#ret = "{\"status\":\"#{stat}\",\"data\":\"#{tx_hash}\",\"code\":200,\"message\":\"#{mess}\"}"
|
89
|
+
#return JSON.parse(ret)
|
88
90
|
end
|
89
91
|
|
90
92
|
def insight_get_balance(address, network = :bitcoin)
|