blockchain-wallet 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 0c19df85920bdf7ce3d19981e4fd01b3132ec25d
4
- data.tar.gz: 15f47e399bb7d36b5ee88cd3317fa5b0f9f86e11
3
+ metadata.gz: 019b1f67802cfea67ad6ddfa2471cdfa4c16ecd5
4
+ data.tar.gz: 1b8f25e8f06291ed538c14b5989802eb62df5850
5
5
  SHA512:
6
- metadata.gz: d79f215b66c3445c92f8480fdcb13f7a75574f553727306cd5a899c84634b13730fd885bff556247156892213d5dc88a1f682cadcd0fea85e721bfd4e9016441
7
- data.tar.gz: a17704649606f9fb2e4b234e99f66f696be80c8ea29c4dd9d2efd2b789e89a56d6750470c51546cc956b3c02c0be5a8bb676f9f23aebb2a6dca377b95af69ba7
6
+ metadata.gz: 8ff525a972e556a21d709bb2373bc36ea54491dee21da4ce35d897527b4c221b40d53a93805965e14fc74ac6c2e325d7a7f732d2b8d9d5bc7c110a63ccc57196
7
+ data.tar.gz: 23948e25b1d802f9fa07c1fcfc83d1f2f54898f87b5807c233e9fcd4f7e1a0e6a67ce2222a818674e4f2f4c365b507b2fa0a9f9d0198067a71d9489812e0f37d
@@ -14,6 +14,15 @@ module BlockchainWallet
14
14
  @second_password = second_password
15
15
  end
16
16
 
17
+
18
+ def self.satoshi_to_bitcoins(satoshi)
19
+ satoshi / (10 ** 8)
20
+ end
21
+
22
+ def self.bitcoins_to_satoshi(bitcoins)
23
+ satoshi * (10 ** 8)
24
+ end
25
+
17
26
  def addresses
18
27
  url = build_url("list", {:password => @password})
19
28
  handle(url) { |answer| answer.addresses }
@@ -24,7 +33,7 @@ module BlockchainWallet
24
33
  handle(url) { |answer| answer }
25
34
  end
26
35
 
27
- def new_address(label='')
36
+ def new_address(label = nil)
28
37
  url = build_url("new_address", {:password => @password, :second_password => @second_password, :label => label})
29
38
  handle(url) { |answer| answer }
30
39
  end
@@ -44,12 +53,17 @@ module BlockchainWallet
44
53
  handle(url) { |answer| answer.consolidated }
45
54
  end
46
55
 
47
- def payment(address, amount, from, shared, fee, note)
56
+ def payment(address, amount, from = nil, shared = nil, fee = nil, note = nil)
48
57
  url = build_url("payment", {:password => @password, :second_password => @second_password, :to => address, :amount => bitcoins_to_satoshi(amount),
49
58
  :from => from, :shared => shared, :fee => fee, :note => note})
50
59
  handle(url) { |answer| answer }
51
60
  end
52
61
 
62
+ def sendmany(recipients, from = nil, shared = nil, fee = nil, note = nil)
63
+ url = build_url("sendmany", {:password => @password, :second_password => @second_password, :recipients => recipients,
64
+ :from => from, :shared => shared, :fee => fee, :note => note})
65
+ handle(url) { |answer| answer }
66
+ end
53
67
 
54
68
  attr_reader :guid
55
69
 
@@ -72,14 +86,6 @@ module BlockchainWallet
72
86
  raise BlockchainException, ex.message
73
87
  end
74
88
 
75
- def satoshi_to_bitcoins(satoshi)
76
- satoshi / (10 ** 8)
77
- end
78
-
79
- def bitcoins_to_satoshi(bitcoins)
80
- satoshi * (10 ** 8)
81
- end
82
-
83
89
  def check_error(answer)
84
90
  error = answer['error']
85
91
  raise WebApiException, error if error
@@ -1,3 +1,3 @@
1
1
  module BlockchainWallet
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blockchain-wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Tolmachev