lib/zold/node/front.rb in zold-0.11.22 vs lib/zold/node/front.rb in zold-0.12
- old
+ new
@@ -143,9 +143,17 @@
score: score.to_h,
body: AtomicFile.new(wallet.path).read
}.to_json
end
+ get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/balance} do
+ id = Id.new(params[:id])
+ wallet = settings.wallets.find(id)
+ error 404 unless wallet.exists?
+ content_type 'text/plain'
+ wallet.balance.to_i.to_s
+ end
+
put %r{/wallet/(?<id>[A-Fa-f0-9]{16})/?} do
id = Id.new(params[:id])
wallet = settings.wallets.find(id)
request.body.rewind
after = request.body.read.to_s