openassets-ruby 0.3.9 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60e7e03e2ce20dc31b0b20f7e9d7e4892b63f931
4
- data.tar.gz: b8165d84e4d59270055405e88aaeb8cfdd42774f
3
+ metadata.gz: 26c1b400f013171dd00cbf7c3418609b75c5fb01
4
+ data.tar.gz: 7cdfe632cd918eaeeedfa3ac92a7a115e10602b9
5
5
  SHA512:
6
- metadata.gz: acaaf6e614f5893c35077949ab08e4116f1848b9239a2f1253267c027f2a692d161441481d301541d479b5030d1565501cc80a2f7be91ca188e2ee16873e3ef9
7
- data.tar.gz: a4a5ff1acceb689fef68dbf79681d885c9e8326a5e64f5966967975697d89d051d0a49a2f51644c9308d92a5a4b8bc6a8cc0875b8a3e55c510f02e3ca0bb2256
6
+ metadata.gz: b23f5a466673eb0ef65e37d4c9e38f7484e49bfd9637f04ed25f25096e5e7cd592bd1baeaaaadfdc7e0cb76a561f0d89d3eca0a2b2875f3b8805140a52d20801
7
+ data.tar.gz: 107f6811c94926ed8f8322dcde03cd73fae158ca007cf744822a9d40e1acdd15d16df52b97b78c36825ca74f765acf5bb19ec158dd63210f7ac71e1a8fb88184
@@ -57,7 +57,7 @@ module OpenAssets
57
57
  def to_hash
58
58
  {
59
59
  'address' => address,
60
- 'oa_address' => address.nil? ? nil : address_to_oa_address(address),
60
+ 'oa_address' => oa_address,
61
61
  'script' => @script.to_payload.bth,
62
62
  'amount' => satoshi_to_coin(@value),
63
63
  'asset_id' => @asset_id,
@@ -74,6 +74,16 @@ module OpenAssets
74
74
  script_to_address(@script)
75
75
  end
76
76
 
77
+ def oa_address
78
+ a = address
79
+ return nil if a.nil?
80
+ if a.is_a?(Array)
81
+ a.map{|btc_address| address_to_oa_address(btc_address)}
82
+ else
83
+ address_to_oa_address(a)
84
+ end
85
+ end
86
+
77
87
  private
78
88
 
79
89
  @@definition_cache = {}
@@ -1,3 +1,3 @@
1
1
  module OpenAssets
2
- VERSION = '0.3.9'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openassets-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2016-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitcoin-ruby