zold 0.18.2 → 0.18.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
  SHA256:
3
- metadata.gz: 2544c7f82192df9838d17ce34db7e71f43bf354f74a4021a6567e015feb88c78
4
- data.tar.gz: b7d465bedb331452972844bcd7808182633ff9eabf3c7e1da795dc6d64c1483b
3
+ metadata.gz: 698a768b9b3f876914ba5ebdc8138b4efb44b935a7e4919570ef1c6a77acd07a
4
+ data.tar.gz: a8e8bf6f982a0f94f9e4fda31e688614eb7a6621114f97b2aacfbaf8f5037e08
5
5
  SHA512:
6
- metadata.gz: 8ae9482cf55549e0c5e44063369b5dede47e9550c995fc2d5cdb83fd89b315cbcfb0e41a2381ded0fcb60d230c91c6ec0cf4e87ce0d3d397983e670de183c06d
7
- data.tar.gz: 054a46f86e5538edd0aaf7bf0f0b9fc116b83fb86d1810d8dfb11b7e4d49bd7e042acc07a3a0d5be34b44e262a4967dd18ba7129a65b23a0890def81196761de
6
+ metadata.gz: 34bfc8d3fbf0d6d5bf4f42c8c23522d50bdaaa7a4b274a212906fb3acf96d0f194bd40330c4bc72c53a9af5c36cbc637c0f4d7d92058f2d26655fe3151d68f3b
7
+ data.tar.gz: 700621299bcb866e6a98f89a3c777077616fd7cd9b27a94cbee87581249406c1aa8a41443d68bf1e595384163b2c9bc3311626a8d8bfc7d78dbe12f5ba53b7a9
data/.rubocop.yml CHANGED
@@ -18,7 +18,7 @@ Metrics/AbcSize:
18
18
  Metrics/BlockLength:
19
19
  Max: 120
20
20
  Metrics/ClassLength:
21
- Max: 400
21
+ Max: 450
22
22
  Layout/EndOfLine:
23
23
  EnforcedStyle: lf
24
24
  Metrics/ParameterLists:
@@ -307,6 +307,10 @@ from #{request.ip} in #{Age.new(@start, limit: 1)}")
307
307
  fetch(&:mnemo)
308
308
  end
309
309
 
310
+ get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/txns.json} do
311
+ fetch { |w| w.txns.map(&:to_json) }
312
+ end
313
+
310
314
  get %r{/wallet/(?<id>[A-Fa-f0-9]{16})\.txt} do
311
315
  fetch do |wallet|
312
316
  [
data/lib/zold/txn.rb CHANGED
@@ -94,6 +94,18 @@ module Zold
94
94
  ].join(';')
95
95
  end
96
96
 
97
+ def to_json
98
+ {
99
+ id: @id,
100
+ date: @date.utc.iso8601,
101
+ amount: @amount.to_i,
102
+ prefix: @prefix,
103
+ bfn: @bnf,
104
+ details: @details,
105
+ sign: @sign
106
+ }
107
+ end
108
+
97
109
  def to_text
98
110
  start = @amount.negative? ? "##{@id}" : '-'
99
111
  "#{start} #{@date.utc.iso8601} #{@amount} #{@bnf} #{@details}"
data/lib/zold/version.rb CHANGED
@@ -25,6 +25,6 @@
25
25
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Zold
28
- VERSION = '0.18.2'
28
+ VERSION = '0.18.3'
29
29
  PROTOCOL = 2
30
30
  end
@@ -162,6 +162,7 @@ class FrontTest < Zold::Test
162
162
  "/wallet/#{wallet.id}/mnemo",
163
163
  "/wallet/#{wallet.id}/debt",
164
164
  "/wallet/#{wallet.id}/txns",
165
+ "/wallet/#{wallet.id}/txns.json",
165
166
  "/wallet/#{wallet.id}.bin",
166
167
  "/wallet/#{wallet.id}/copies"
167
168
  ].each do |u|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.2
4
+ version: 0.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -703,7 +703,7 @@ licenses:
703
703
  - MIT
704
704
  metadata: {}
705
705
  post_install_message: |-
706
- Thanks for installing Zold 0.18.2!
706
+ Thanks for installing Zold 0.18.3!
707
707
  Study our White Paper: https://papers.zold.io/wp.pdf
708
708
  Read our blog posts: https://blog.zold.io
709
709
  Try online wallet at: https://wts.zold.io