openassets-ruby 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openassets/api.rb +5 -2
- data/lib/openassets/protocol/transaction_output.rb +2 -0
- data/lib/openassets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0eaaa8534a56f07b4c978704728bd12c7c9a9fb
|
4
|
+
data.tar.gz: 79de745bf7f838e122780ffcf71ab6ada8c1bb15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de391a3bd688f1f137035f76137a2bbeca849b391761309f9d029fb389879a18fd4089357b677153dc829f58360c5cfa36831d18228e5c562e730b5aea6f5e5a
|
7
|
+
data.tar.gz: 113ecc06ae0872c566e87fae32d0b421925f411fb3f1d9c2d36c40ac1a31faa76285292013f58a598fcfde5f83ae766ef9a319fdd45b39de6ecfa4986db4137a
|
data/lib/openassets/api.rb
CHANGED
@@ -51,7 +51,8 @@ module OpenAssets
|
|
51
51
|
'amount' => satoshi_to_coin(out.output.value),
|
52
52
|
'confirmations' => out.confirmations,
|
53
53
|
'asset_id' => out.output.asset_id,
|
54
|
-
'
|
54
|
+
'account' => out.output.account,
|
55
|
+
'asset_quantity' => out.output.asset_quantity.to_s,
|
55
56
|
}
|
56
57
|
}
|
57
58
|
oa_address.empty? ? result : result.select{|r|oa_address.include?(r['oa_address'])}
|
@@ -78,7 +79,8 @@ module OpenAssets
|
|
78
79
|
'address' => btc_address,
|
79
80
|
'oa_address' => btc_address.nil? ? nil : address_to_oa_address(btc_address),
|
80
81
|
'value' => satoshi_to_coin(v.inject(0) { |sum, o|sum + o.value}),
|
81
|
-
'assets' => assets
|
82
|
+
'assets' => assets,
|
83
|
+
'account' => v[0].account
|
82
84
|
}
|
83
85
|
}
|
84
86
|
address.nil? ? result : result.select{|r|r['oa_address'] == address}
|
@@ -130,6 +132,7 @@ module OpenAssets
|
|
130
132
|
unspent = provider.list_unspent(addresses)
|
131
133
|
result = unspent.map{|item|
|
132
134
|
output_result = get_output(item['txid'], item['vout'])
|
135
|
+
output_result.account = item['account']
|
133
136
|
output = OpenAssets::Transaction::SpendableOutput.new(
|
134
137
|
OpenAssets::Transaction::OutPoint.new(item['txid'], item['vout']), output_result)
|
135
138
|
output.confirmations = item['confirmations']
|
@@ -9,6 +9,8 @@ module OpenAssets
|
|
9
9
|
attr_accessor :asset_quantity
|
10
10
|
attr_accessor :output_type
|
11
11
|
|
12
|
+
attr_accessor :account
|
13
|
+
|
12
14
|
# @param [Integer] value The satoshi value of the output.
|
13
15
|
# @param [Bitcoin::Script] script The script controlling redemption of the output.
|
14
16
|
# @param [String] asset_id The asset ID of the output.
|
data/lib/openassets/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitcoin-ruby
|