mastercoin-wallet 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  ** Form generated from reading ui file 'simple_send_window.ui'
3
3
  **
4
- ** Created: Sun Sep 29 16:35:18 2013
4
+ ** Created: Sat Nov 2 14:56:54 2013
5
5
  ** by: Qt User Interface Compiler version 4.8.4
6
6
  **
7
7
  ** WARNING! All changes made in this file will be lost when recompiling ui file!
@@ -88,6 +88,10 @@ class Ui_SimpleSend
88
88
  @submit_button.enabled = false
89
89
  @submit_button.geometry = Qt::Rect.new(410, 170, 114, 32)
90
90
  @submit_button.autoDefault = false
91
+ Qt::Widget.setTabOrder(@address_input, @amount_input)
92
+ Qt::Widget.setTabOrder(@amount_input, @currency_box)
93
+ Qt::Widget.setTabOrder(@currency_box, @password_input)
94
+ Qt::Widget.setTabOrder(@password_input, @submit_button)
91
95
 
92
96
  retranslateUi(simpleSend)
93
97
 
@@ -0,0 +1,18 @@
1
+ module MastercoinWallet
2
+ module Models
3
+ class SellingOffer
4
+ include HTTParty
5
+ base_uri 'mastercoin-explorer.com/api/v1/selling_offers'
6
+
7
+ attr_accessor :address
8
+
9
+ def all
10
+ self.class.get(".json")
11
+ end
12
+
13
+ def current
14
+ self.class.get("/current.json")
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ module MastercoinWallet
2
+ module Network
3
+ class SellingOffer
4
+ include Observable
5
+
6
+ def retrieve!
7
+ #Thread.new do
8
+ @selling_offers = MastercoinWallet::Models::SellingOffer.new.current
9
+ self.changed(true)
10
+ notify_observers(@selling_offers)
11
+ #end.join
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,32 @@
1
+ module MastercoinWallet
2
+ module Network
3
+ class Wallet
4
+ include Observable
5
+
6
+ def sync!
7
+ # Thread.new do
8
+ @address = MastercoinWallet::Address.new(MastercoinWallet::config.address).find
9
+
10
+ MastercoinWallet.config.set_key(:balance, (@address["balance"] || 0))
11
+ MastercoinWallet.config.set_key(:test_balance, (@address["test_balance"] || 0))
12
+
13
+ ["sold", "bought", "received_transactions","pending_offers", "sent_transactions", "exodus_transactions", "bitcoin_transactions", "spendable_outputs"].each do |x|
14
+ if @address[x]
15
+ MastercoinWallet.config.set_key(x, @address[x])
16
+ end
17
+ end
18
+
19
+ if @address["spendable_outputs"]
20
+ MastercoinWallet.config.set_key(:btc_balance, "%.8f" % MastercoinWallet.config.spendable_outputs.inject(0){|sum, x| sum += x["value"].to_f})
21
+ end
22
+
23
+ self.changed(true)
24
+
25
+ MastercoinWallet.config.save
26
+
27
+ notify_observers(true)
28
+ end
29
+ end
30
+ # end
31
+ end
32
+ end
@@ -1,4 +1,4 @@
1
- require 'qt'
1
+ require 'Qt'
2
2
  require 'httparty'
3
3
  require 'qtuitools'
4
4
  require 'openssl'
@@ -15,14 +15,33 @@ module MastercoinWallet
15
15
 
16
16
  autoload :Address, 'mastercoin-wallet/models/address'
17
17
  autoload :Transaction, 'mastercoin-wallet/models/transaction'
18
+
19
+
18
20
  autoload :MainWindow, 'mastercoin-wallet/gui/main_window'
19
21
  autoload :FirstRunWindow, 'mastercoin-wallet/gui/first_run_window'
20
22
  autoload :SimpleSendWindow, 'mastercoin-wallet/gui/simple_send_window'
23
+ autoload :SellingOfferWindow, 'mastercoin-wallet/gui/selling_offer_window'
24
+ autoload :PurchaseOfferWindow, 'mastercoin-wallet/gui/purchase_offer_window'
25
+ autoload :BitcoinOfferWindow, 'mastercoin-wallet/gui/bitcoin_offer_window'
21
26
  autoload :Config, 'mastercoin-wallet/config'
22
- autoload :Network, 'mastercoin-wallet/network'
27
+
28
+ module Models
29
+ autoload :SellingOffer, 'mastercoin-wallet/models/selling_offer'
30
+ end
31
+
32
+ module Network
33
+ autoload :Wallet, 'mastercoin-wallet/network/wallet'
34
+ autoload :SellingOffer, 'mastercoin-wallet/network/selling_offer'
35
+ end
36
+
37
+ autoload :Builder, 'mastercoin-wallet/builder'
23
38
 
24
39
  autoload :Ui_FirstRunWindow, 'mastercoin-wallet/gui/ui_first_run'
25
40
  autoload :Ui_SimpleSend, 'mastercoin-wallet/gui/ui_simple_send'
41
+ autoload :Ui_SellingOffer, 'mastercoin-wallet/gui/ui_selling_offer'
42
+ autoload :Ui_PurchaseOffer, 'mastercoin-wallet/gui/ui_purchase_offer'
43
+ autoload :Ui_BitcoinOffer, 'mastercoin-wallet/gui/ui_bitcoin_offer'
44
+ autoload :Ui_MainWindow, 'mastercoin-wallet/gui/ui_main'
26
45
 
27
46
  CONFIG_PATH = "#{Dir.home}/.mastercoin-wallet/"
28
47
  FILE_PATH = CONFIG_PATH + "config.json"
@@ -31,8 +50,12 @@ module MastercoinWallet
31
50
  @@config ||= MastercoinWallet::Config.new
32
51
  end
33
52
 
34
- def self.network
35
- @@network ||= MastercoinWallet::Network.new
53
+ def self.selling_offers
54
+ @@selling_offers ||= MastercoinWallet::Network::SellingOffer.new
55
+ end
56
+
57
+ def self.wallet
58
+ @@wallet ||= MastercoinWallet::Network::Wallet.new
36
59
  end
37
60
 
38
61
  def self.init_logger(level = Logger::DEBUG)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "mastercoin-wallet"
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Maran"]
12
- s.date = "2013-09-29"
12
+ s.date = "2013-11-03"
13
13
  s.description = "Mastercoin wallet using QT bindings to create a useful gui wallet"
14
14
  s.email = "maran.hidskes@gmail.com"
15
15
  s.executables = ["mastercoin-wallet"]
@@ -29,20 +29,35 @@ Gem::Specification.new do |s|
29
29
  "bin/mastercoin-wallet",
30
30
  "lib/.DS_Store",
31
31
  "lib/mastercoin-wallet.rb",
32
+ "lib/mastercoin-wallet/builder.rb",
32
33
  "lib/mastercoin-wallet/config.rb",
34
+ "lib/mastercoin-wallet/gui/bitcoin_offer_window.rb",
35
+ "lib/mastercoin-wallet/gui/bitcoin_offer_window.ui",
33
36
  "lib/mastercoin-wallet/gui/first_run_window.rb",
34
37
  "lib/mastercoin-wallet/gui/first_run_window.ui",
35
38
  "lib/mastercoin-wallet/gui/images.rb",
36
39
  "lib/mastercoin-wallet/gui/main_window.rb",
40
+ "lib/mastercoin-wallet/gui/main_window.ui",
41
+ "lib/mastercoin-wallet/gui/purchase_offer_window.rb",
42
+ "lib/mastercoin-wallet/gui/purchase_offer_window.ui",
43
+ "lib/mastercoin-wallet/gui/selling_offer_window.rb",
44
+ "lib/mastercoin-wallet/gui/selling_offer_window.ui",
37
45
  "lib/mastercoin-wallet/gui/simple_send_window.rb",
38
46
  "lib/mastercoin-wallet/gui/simple_send_window.ui",
47
+ "lib/mastercoin-wallet/gui/ui_bitcoin_offer.rb",
39
48
  "lib/mastercoin-wallet/gui/ui_first_run.rb",
49
+ "lib/mastercoin-wallet/gui/ui_main.rb",
50
+ "lib/mastercoin-wallet/gui/ui_purchase_offer.rb",
51
+ "lib/mastercoin-wallet/gui/ui_selling_offer.rb",
40
52
  "lib/mastercoin-wallet/gui/ui_simple_send.rb",
41
53
  "lib/mastercoin-wallet/models/address.rb",
54
+ "lib/mastercoin-wallet/models/selling_offer.rb",
42
55
  "lib/mastercoin-wallet/models/transaction.rb",
43
- "lib/mastercoin-wallet/network.rb",
56
+ "lib/mastercoin-wallet/network/selling_offer.rb",
57
+ "lib/mastercoin-wallet/network/wallet.rb",
44
58
  "mastercoin-wallet.gemspec",
45
59
  "resources/images.qrc",
60
+ "resources/logo.icns",
46
61
  "resources/logo.svg",
47
62
  "test/helper.rb",
48
63
  "test/test_mastercoin-wallet.rb"
@@ -57,33 +72,39 @@ Gem::Specification.new do |s|
57
72
  s.specification_version = 3
58
73
 
59
74
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
75
+ s.add_runtime_dependency(%q<mastercoin-ruby>, [">= 0"])
60
76
  s.add_runtime_dependency(%q<qtbindings>, [">= 0"])
61
77
  s.add_runtime_dependency(%q<httparty>, [">= 0"])
62
78
  s.add_runtime_dependency(%q<active_support>, [">= 0"])
63
79
  s.add_runtime_dependency(%q<bitcoin-ruby>, ["~> 0.0.1"])
64
- s.add_runtime_dependency(%q<mastercoin-ruby>, [">= 0"])
65
80
  s.add_runtime_dependency(%q<ffi>, [">= 0"])
81
+ s.add_runtime_dependency(%q<i18n>, [">= 0"])
82
+ s.add_development_dependency(%q<releasy>, [">= 0"])
66
83
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
67
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.7"])
84
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.8"])
68
85
  else
86
+ s.add_dependency(%q<mastercoin-ruby>, [">= 0"])
69
87
  s.add_dependency(%q<qtbindings>, [">= 0"])
70
88
  s.add_dependency(%q<httparty>, [">= 0"])
71
89
  s.add_dependency(%q<active_support>, [">= 0"])
72
90
  s.add_dependency(%q<bitcoin-ruby>, ["~> 0.0.1"])
73
- s.add_dependency(%q<mastercoin-ruby>, [">= 0"])
74
91
  s.add_dependency(%q<ffi>, [">= 0"])
92
+ s.add_dependency(%q<i18n>, [">= 0"])
93
+ s.add_dependency(%q<releasy>, [">= 0"])
75
94
  s.add_dependency(%q<bundler>, ["~> 1.0"])
76
- s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
95
+ s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
77
96
  end
78
97
  else
98
+ s.add_dependency(%q<mastercoin-ruby>, [">= 0"])
79
99
  s.add_dependency(%q<qtbindings>, [">= 0"])
80
100
  s.add_dependency(%q<httparty>, [">= 0"])
81
101
  s.add_dependency(%q<active_support>, [">= 0"])
82
102
  s.add_dependency(%q<bitcoin-ruby>, ["~> 0.0.1"])
83
- s.add_dependency(%q<mastercoin-ruby>, [">= 0"])
84
103
  s.add_dependency(%q<ffi>, [">= 0"])
104
+ s.add_dependency(%q<i18n>, [">= 0"])
105
+ s.add_dependency(%q<releasy>, [">= 0"])
85
106
  s.add_dependency(%q<bundler>, ["~> 1.0"])
86
- s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
107
+ s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
87
108
  end
88
109
  end
89
110
 
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mastercoin-wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-29 00:00:00.000000000 Z
12
+ date: 2013-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: mastercoin-ruby
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: qtbindings
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -76,7 +92,7 @@ dependencies:
76
92
  - !ruby/object:Gem::Version
77
93
  version: 0.0.1
78
94
  - !ruby/object:Gem::Dependency
79
- name: mastercoin-ruby
95
+ name: ffi
80
96
  requirement: !ruby/object:Gem::Requirement
81
97
  none: false
82
98
  requirements:
@@ -92,7 +108,7 @@ dependencies:
92
108
  - !ruby/object:Gem::Version
93
109
  version: '0'
94
110
  - !ruby/object:Gem::Dependency
95
- name: ffi
111
+ name: i18n
96
112
  requirement: !ruby/object:Gem::Requirement
97
113
  none: false
98
114
  requirements:
@@ -107,6 +123,22 @@ dependencies:
107
123
  - - ! '>='
108
124
  - !ruby/object:Gem::Version
109
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: releasy
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
110
142
  - !ruby/object:Gem::Dependency
111
143
  name: bundler
112
144
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +162,7 @@ dependencies:
130
162
  requirements:
131
163
  - - ~>
132
164
  - !ruby/object:Gem::Version
133
- version: 1.8.7
165
+ version: 1.8.8
134
166
  type: :development
135
167
  prerelease: false
136
168
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,7 +170,7 @@ dependencies:
138
170
  requirements:
139
171
  - - ~>
140
172
  - !ruby/object:Gem::Version
141
- version: 1.8.7
173
+ version: 1.8.8
142
174
  description: Mastercoin wallet using QT bindings to create a useful gui wallet
143
175
  email: maran.hidskes@gmail.com
144
176
  executables:
@@ -159,20 +191,35 @@ files:
159
191
  - bin/mastercoin-wallet
160
192
  - lib/.DS_Store
161
193
  - lib/mastercoin-wallet.rb
194
+ - lib/mastercoin-wallet/builder.rb
162
195
  - lib/mastercoin-wallet/config.rb
196
+ - lib/mastercoin-wallet/gui/bitcoin_offer_window.rb
197
+ - lib/mastercoin-wallet/gui/bitcoin_offer_window.ui
163
198
  - lib/mastercoin-wallet/gui/first_run_window.rb
164
199
  - lib/mastercoin-wallet/gui/first_run_window.ui
165
200
  - lib/mastercoin-wallet/gui/images.rb
166
201
  - lib/mastercoin-wallet/gui/main_window.rb
202
+ - lib/mastercoin-wallet/gui/main_window.ui
203
+ - lib/mastercoin-wallet/gui/purchase_offer_window.rb
204
+ - lib/mastercoin-wallet/gui/purchase_offer_window.ui
205
+ - lib/mastercoin-wallet/gui/selling_offer_window.rb
206
+ - lib/mastercoin-wallet/gui/selling_offer_window.ui
167
207
  - lib/mastercoin-wallet/gui/simple_send_window.rb
168
208
  - lib/mastercoin-wallet/gui/simple_send_window.ui
209
+ - lib/mastercoin-wallet/gui/ui_bitcoin_offer.rb
169
210
  - lib/mastercoin-wallet/gui/ui_first_run.rb
211
+ - lib/mastercoin-wallet/gui/ui_main.rb
212
+ - lib/mastercoin-wallet/gui/ui_purchase_offer.rb
213
+ - lib/mastercoin-wallet/gui/ui_selling_offer.rb
170
214
  - lib/mastercoin-wallet/gui/ui_simple_send.rb
171
215
  - lib/mastercoin-wallet/models/address.rb
216
+ - lib/mastercoin-wallet/models/selling_offer.rb
172
217
  - lib/mastercoin-wallet/models/transaction.rb
173
- - lib/mastercoin-wallet/network.rb
218
+ - lib/mastercoin-wallet/network/selling_offer.rb
219
+ - lib/mastercoin-wallet/network/wallet.rb
174
220
  - mastercoin-wallet.gemspec
175
221
  - resources/images.qrc
222
+ - resources/logo.icns
176
223
  - resources/logo.svg
177
224
  - test/helper.rb
178
225
  - test/test_mastercoin-wallet.rb
@@ -191,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
238
  version: '0'
192
239
  segments:
193
240
  - 0
194
- hash: -852878329844165909
241
+ hash: 4559082734438484052
195
242
  required_rubygems_version: !ruby/object:Gem::Requirement
196
243
  none: false
197
244
  requirements:
@@ -1,34 +0,0 @@
1
- module MastercoinWallet
2
- class Network
3
- include Observable
4
-
5
- def initialize
6
- @mutex = Mutex.new
7
- end
8
-
9
- def sync!
10
- Thread.new do
11
- @address = Address.new(MastercoinWallet::config.address).find
12
-
13
- MastercoinWallet.config.set_key(:balance, (@address["balance"] || 0))
14
- MastercoinWallet.config.set_key(:test_balance, (@address["test_balance"] || 0))
15
-
16
- ["received_transactions", "sent_transactions", "exodus_transactions", "bitcoin_transactions", "spendable_outputs"].each do |x|
17
- if @address[x]
18
- MastercoinWallet.config.set_key(x, @address[x])
19
- end
20
- end
21
-
22
- if @address["spendable_outputs"]
23
- MastercoinWallet.config.set_key(:btc_balance, "%.8f" % MastercoinWallet.config.spendable_outputs.inject(0){|sum, x| sum += x["value"].to_f})
24
- end
25
-
26
- self.changed(true)
27
-
28
- MastercoinWallet.config.save
29
-
30
- notify_observers(true)
31
- end
32
- end
33
- end
34
- end