istox 0.2.10 → 0.2.13

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
  SHA256:
3
- metadata.gz: f2099515f9703dcadd1f99da2d05be06e062c624638ae9c3646880497c7d192d
4
- data.tar.gz: 1ceba372de27ec21beb41acde07f601f138cf116d1aad19f50034af3f7cb2d18
3
+ metadata.gz: a4360b1a18d0d8d953665294d793c1f32e30b8fe87ea54635bb91ae3913666b4
4
+ data.tar.gz: bb9ea9f532da561d5cf6d527af3ee16e25a4952162a40fc5b0c991099caf82da
5
5
  SHA512:
6
- metadata.gz: 9263b776b77849f00a25f08b99a2e753a5eabc03e929afeb3628b6c58d13dcf799e1c587418781b77c2c01e2bd0afd7bba9de88291569198a4d66f8354a8c8dc
7
- data.tar.gz: 9d6034c961985ae0ea89c806ac44dd505074fabfe899f73765328b9ef00bc4b85a06a907d8203ea3ad9f35cac77841caf372fe518911184b1f808f68f0f6a682
6
+ metadata.gz: d99fffea40090ffa46dd6ed6baa0197d57a4a2a73a701996740a9083893324a2be2571630ab583eeb25be9e91dc66ee8cf3ea85fd386193e8a035f5a55881aa9
7
+ data.tar.gz: 163cce847ce4f4d83d81f4d47e8c6452f4cf1344b49fadeeac8f634be50cba292bd462047521b580c0650b17621b9b0a14a0efe526f88edd43fbfcfd22c1709e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.2.9)
4
+ istox (0.2.12)
5
5
  amazing_print
6
6
  awesome_print
7
7
  aws-sdk-sns (~> 1)
@@ -22,43 +22,43 @@ PATH
22
22
  GEM
23
23
  remote: https://rubygems.org/
24
24
  specs:
25
- actioncable (5.2.2)
26
- actionpack (= 5.2.2)
25
+ actioncable (5.2.6)
26
+ actionpack (= 5.2.6)
27
27
  nio4r (~> 2.0)
28
28
  websocket-driver (>= 0.6.1)
29
- actionmailer (5.2.2)
30
- actionpack (= 5.2.2)
31
- actionview (= 5.2.2)
32
- activejob (= 5.2.2)
29
+ actionmailer (5.2.6)
30
+ actionpack (= 5.2.6)
31
+ actionview (= 5.2.6)
32
+ activejob (= 5.2.6)
33
33
  mail (~> 2.5, >= 2.5.4)
34
34
  rails-dom-testing (~> 2.0)
35
- actionpack (5.2.2)
36
- actionview (= 5.2.2)
37
- activesupport (= 5.2.2)
38
- rack (~> 2.0)
35
+ actionpack (5.2.6)
36
+ actionview (= 5.2.6)
37
+ activesupport (= 5.2.6)
38
+ rack (~> 2.0, >= 2.0.8)
39
39
  rack-test (>= 0.6.3)
40
40
  rails-dom-testing (~> 2.0)
41
41
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
42
- actionview (5.2.2)
43
- activesupport (= 5.2.2)
42
+ actionview (5.2.6)
43
+ activesupport (= 5.2.6)
44
44
  builder (~> 3.1)
45
45
  erubi (~> 1.4)
46
46
  rails-dom-testing (~> 2.0)
47
47
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
48
- activejob (5.2.2)
49
- activesupport (= 5.2.2)
48
+ activejob (5.2.6)
49
+ activesupport (= 5.2.6)
50
50
  globalid (>= 0.3.6)
51
- activemodel (5.2.2)
52
- activesupport (= 5.2.2)
53
- activerecord (5.2.2)
54
- activemodel (= 5.2.2)
55
- activesupport (= 5.2.2)
51
+ activemodel (5.2.6)
52
+ activesupport (= 5.2.6)
53
+ activerecord (5.2.6)
54
+ activemodel (= 5.2.6)
55
+ activesupport (= 5.2.6)
56
56
  arel (>= 9.0)
57
- activestorage (5.2.2)
58
- actionpack (= 5.2.2)
59
- activerecord (= 5.2.2)
60
- marcel (~> 0.3.1)
61
- activesupport (5.2.2)
57
+ activestorage (5.2.6)
58
+ actionpack (= 5.2.6)
59
+ activerecord (= 5.2.6)
60
+ marcel (~> 1.0.0)
61
+ activesupport (5.2.6)
62
62
  concurrent-ruby (~> 1.0, >= 1.0.2)
63
63
  i18n (>= 0.7, < 2)
64
64
  minitest (~> 5.1)
@@ -67,21 +67,21 @@ GEM
67
67
  amq-protocol (2.3.2)
68
68
  arel (9.0.0)
69
69
  awesome_print (1.9.2)
70
- aws-eventstream (1.1.0)
71
- aws-partitions (1.318.0)
72
- aws-sdk-core (3.96.1)
70
+ aws-eventstream (1.1.1)
71
+ aws-partitions (1.470.0)
72
+ aws-sdk-core (3.114.3)
73
73
  aws-eventstream (~> 1, >= 1.0.2)
74
74
  aws-partitions (~> 1, >= 1.239.0)
75
75
  aws-sigv4 (~> 1.1)
76
76
  jmespath (~> 1.0)
77
- aws-sdk-sns (1.24.0)
78
- aws-sdk-core (~> 3, >= 3.71.0)
77
+ aws-sdk-sns (1.41.0)
78
+ aws-sdk-core (~> 3, >= 3.112.0)
79
79
  aws-sigv4 (~> 1.1)
80
80
  aws-sdk-xray (1.4.0)
81
81
  aws-sdk-core (~> 3)
82
82
  aws-sigv4 (~> 1.0)
83
- aws-sigv4 (1.1.3)
84
- aws-eventstream (~> 1.0, >= 1.0.2)
83
+ aws-sigv4 (1.2.3)
84
+ aws-eventstream (~> 1, >= 1.0.2)
85
85
  aws-xray-sdk (0.11.4)
86
86
  aws-sdk-xray (~> 1.4.0)
87
87
  multi_json (~> 1)
@@ -91,17 +91,17 @@ GEM
91
91
  bullet (5.7.6)
92
92
  activesupport (>= 3.0.0)
93
93
  uniform_notifier (~> 1.11.0)
94
- bunny (2.18.0)
94
+ bunny (2.19.0)
95
95
  amq-protocol (~> 2.3, >= 2.3.1)
96
96
  sorted_set (~> 1, >= 1.0.2)
97
97
  byebug (11.1.3)
98
98
  coderay (1.1.2)
99
- concurrent-ruby (1.1.6)
99
+ concurrent-ruby (1.1.9)
100
100
  crass (1.0.6)
101
101
  database_cleaner (1.6.2)
102
102
  debug_inspector (1.1.0)
103
103
  diff-lcs (1.3)
104
- erubi (1.9.0)
104
+ erubi (1.10.0)
105
105
  exponential-backoff (0.0.4)
106
106
  factory_bot (4.8.2)
107
107
  activesupport (>= 3.0.0)
@@ -112,35 +112,39 @@ GEM
112
112
  i18n (~> 0.5)
113
113
  fakeredis (0.7.0)
114
114
  redis (>= 3.2, < 5.0)
115
- faraday (1.4.1)
115
+ faraday (1.4.3)
116
+ faraday-em_http (~> 1.0)
117
+ faraday-em_synchrony (~> 1.0)
116
118
  faraday-excon (~> 1.1)
117
119
  faraday-net_http (~> 1.0)
118
120
  faraday-net_http_persistent (~> 1.1)
119
121
  multipart-post (>= 1.2, < 3)
120
122
  ruby2_keywords (>= 0.0.4)
123
+ faraday-em_http (1.0.0)
124
+ faraday-em_synchrony (1.0.0)
121
125
  faraday-excon (1.1.0)
122
126
  faraday-net_http (1.0.1)
123
127
  faraday-net_http_persistent (1.1.0)
124
128
  faraday_middleware (1.0.0)
125
129
  faraday (~> 1.0)
126
- ffi (1.15.1)
130
+ ffi (1.15.3)
127
131
  globalid (0.4.2)
128
132
  activesupport (>= 4.2.0)
129
- google-protobuf (3.15.8-universal-darwin)
133
+ google-protobuf (3.17.3)
130
134
  googleapis-common-protos-types (1.0.6)
131
135
  google-protobuf (~> 3.14)
132
136
  graphlient (0.5.0)
133
137
  faraday (>= 1.0)
134
138
  faraday_middleware
135
139
  graphql-client
136
- graphql (1.12.8)
140
+ graphql (1.12.12)
137
141
  graphql-client (0.16.0)
138
142
  activesupport (>= 3.0)
139
143
  graphql (~> 1.8)
140
- grpc (1.37.0-universal-darwin)
144
+ grpc (1.38.0)
141
145
  google-protobuf (~> 3.15)
142
146
  googleapis-common-protos-types (~> 1.0)
143
- grpc-tools (1.37.0)
147
+ grpc-tools (1.38.0)
144
148
  hashie (3.5.7)
145
149
  i18n (0.9.5)
146
150
  concurrent-ruby (~> 1.0)
@@ -154,24 +158,23 @@ GEM
154
158
  listen (3.0.8)
155
159
  rb-fsevent (~> 0.9, >= 0.9.4)
156
160
  rb-inotify (~> 0.9, >= 0.9.7)
157
- loofah (2.4.0)
161
+ loofah (2.10.0)
158
162
  crass (~> 1.0.2)
159
163
  nokogiri (>= 1.5.9)
160
164
  mail (2.7.1)
161
165
  mini_mime (>= 0.1.1)
162
- marcel (0.3.3)
163
- mimemagic (~> 0.3.2)
166
+ marcel (1.0.1)
164
167
  method_source (0.9.2)
165
- mimemagic (0.3.3)
166
- mini_mime (1.0.1)
167
- mini_portile2 (2.4.0)
168
- minitest (5.14.0)
168
+ mini_mime (1.1.0)
169
+ mini_portile2 (2.5.3)
170
+ minitest (5.14.4)
169
171
  multi_json (1.14.1)
170
172
  multipart-post (2.1.1)
171
- nio4r (2.3.1)
172
- nokogiri (1.10.9)
173
- mini_portile2 (~> 2.4.0)
174
- oj (3.11.5)
173
+ nio4r (2.5.7)
174
+ nokogiri (1.11.7)
175
+ mini_portile2 (~> 2.5.0)
176
+ racc (~> 1.4)
177
+ oj (3.11.7)
175
178
  ougai (2.0.0)
176
179
  oj (~> 3.10)
177
180
  paranoia (2.4.3)
@@ -184,30 +187,31 @@ GEM
184
187
  pry (~> 0.10)
185
188
  pry-rails (0.3.9)
186
189
  pry (>= 0.10.4)
187
- rack (2.2.2)
190
+ racc (1.5.2)
191
+ rack (2.2.3)
188
192
  rack-test (1.1.0)
189
193
  rack (>= 1.0, < 3)
190
- rails (5.2.2)
191
- actioncable (= 5.2.2)
192
- actionmailer (= 5.2.2)
193
- actionpack (= 5.2.2)
194
- actionview (= 5.2.2)
195
- activejob (= 5.2.2)
196
- activemodel (= 5.2.2)
197
- activerecord (= 5.2.2)
198
- activestorage (= 5.2.2)
199
- activesupport (= 5.2.2)
194
+ rails (5.2.6)
195
+ actioncable (= 5.2.6)
196
+ actionmailer (= 5.2.6)
197
+ actionpack (= 5.2.6)
198
+ actionview (= 5.2.6)
199
+ activejob (= 5.2.6)
200
+ activemodel (= 5.2.6)
201
+ activerecord (= 5.2.6)
202
+ activestorage (= 5.2.6)
203
+ activesupport (= 5.2.6)
200
204
  bundler (>= 1.3.0)
201
- railties (= 5.2.2)
205
+ railties (= 5.2.6)
202
206
  sprockets-rails (>= 2.0.0)
203
207
  rails-dom-testing (2.0.3)
204
208
  activesupport (>= 4.2.0)
205
209
  nokogiri (>= 1.6)
206
210
  rails-html-sanitizer (1.3.0)
207
211
  loofah (~> 2.3)
208
- railties (5.2.2)
209
- actionpack (= 5.2.2)
210
- activesupport (= 5.2.2)
212
+ railties (5.2.6)
213
+ actionpack (= 5.2.6)
214
+ activesupport (= 5.2.6)
211
215
  method_source
212
216
  rake (>= 0.8.7)
213
217
  thor (>= 0.19.0, < 2.0)
@@ -216,12 +220,12 @@ GEM
216
220
  rb-inotify (0.10.1)
217
221
  ffi (~> 1.0)
218
222
  rbtree (0.4.4)
219
- redis (4.1.3)
223
+ redis (4.3.1)
220
224
  redis-actionpack (5.2.0)
221
225
  actionpack (>= 5, < 7)
222
226
  redis-rack (>= 2.1.0, < 3)
223
227
  redis-store (>= 1.1.0, < 2)
224
- redis-activesupport (5.2.0)
228
+ redis-activesupport (5.2.1)
225
229
  activesupport (>= 3, < 7)
226
230
  redis-store (>= 1.3, < 2)
227
231
  redis-namespace (1.8.1)
@@ -262,25 +266,25 @@ GEM
262
266
  sorted_set (1.0.3)
263
267
  rbtree
264
268
  set (~> 1.0)
265
- sprockets (3.7.2)
269
+ sprockets (4.0.2)
266
270
  concurrent-ruby (~> 1.0)
267
271
  rack (> 1, < 3)
268
- sprockets-rails (3.2.1)
272
+ sprockets-rails (3.2.2)
269
273
  actionpack (>= 4.0)
270
274
  activesupport (>= 4.0)
271
275
  sprockets (>= 3.0.0)
272
276
  sqlite3 (1.3.13)
273
- thor (0.20.3)
277
+ thor (1.1.0)
274
278
  thread_safe (0.3.6)
275
279
  timecop (0.9.1)
276
- tzinfo (1.2.6)
280
+ tzinfo (1.2.9)
277
281
  thread_safe (~> 0.1)
278
282
  uniform_notifier (1.11.0)
279
283
  vault (0.16.0)
280
284
  aws-sigv4
281
- websocket-driver (0.7.0)
285
+ websocket-driver (0.7.5)
282
286
  websocket-extensions (>= 0.1.0)
283
- websocket-extensions (0.1.3)
287
+ websocket-extensions (0.1.5)
284
288
 
285
289
  PLATFORMS
286
290
  ruby
data/lib/istox.rb CHANGED
@@ -47,6 +47,7 @@ module Istox
47
47
 
48
48
  require 'istox/models/blockchain_receipt'
49
49
  require 'istox/models/concerns/blockchain_receipt_query'
50
+ require 'istox/models/auto_enum'
50
51
  require 'istox/consumers/blockchain_status_handler'
51
52
  require 'istox/quant/bond'
52
53
  end
@@ -13,7 +13,9 @@ module Istox
13
13
 
14
14
  result = format("%.#{precision}f", input)
15
15
 
16
- result.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse
16
+ parts = result.to_s.split('.')
17
+ parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, '\\1,')
18
+ parts.join('.')
17
19
  end
18
20
 
19
21
  # format a money, eg. 20000.134 > SGD 20,000.14, position can be :front or :behind, abs_num: whether to absolute the number
@@ -27,7 +27,7 @@ module Istox
27
27
  private
28
28
 
29
29
  def init_host(host_type, url)
30
- client = Graphlient::Client.new(url, http: Graphlient::Adapters::HTTP::HTTPAdapter)
30
+ client = Graphlient::Client.new(url, http: Graphlient::Adapters::HTTP::FaradayAdapter)
31
31
 
32
32
  @@hosts[host_type] = client
33
33
  end
@@ -0,0 +1,38 @@
1
+ module Istox
2
+ module AutoEnum
3
+ def method_missing(name, *args, &block)
4
+ if name[-1] == '?' || name[-1] == '!'
5
+ method_name = name[0...-1]
6
+ if method_name.parameterize.underscore != method_name
7
+ send(:"#{method_name}#{name[-1]}")
8
+ else
9
+ index = _all_enums_in_underscore.find_index { |e| e == method_name }
10
+ if index >= 0
11
+ send(:"#{_all_enums[index]}#{name[-1]}")
12
+ else
13
+ super
14
+ end
15
+ end
16
+ else
17
+ super
18
+ end
19
+ end
20
+
21
+ def respond_to_missing?(name, include_private)
22
+ if name[-1] == '?' || name[-1] == '!'
23
+ method_name = name[0...-1]
24
+ _all_enums_in_underscore.include?(method_name)
25
+ else
26
+ super
27
+ end
28
+ end
29
+
30
+ def _all_enums_in_underscore
31
+ defined_enums.values.map(&:keys).flatten.map { |i| i.parameterize.underscore }
32
+ end
33
+
34
+ def _all_enums
35
+ defined_enums.values.map(&:keys).flatten
36
+ end
37
+ end
38
+ end
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.2.10'.freeze
2
+ VERSION = '0.2.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print
@@ -510,6 +510,7 @@ files:
510
510
  - lib/istox/helpers/xray/rabbitmq_publisher_interceptor.rb
511
511
  - lib/istox/helpers/xray/xray_initializer.rb
512
512
  - lib/istox/interfaces/chainhub/transaction.rb
513
+ - lib/istox/models/auto_enum.rb
513
514
  - lib/istox/models/blockchain_receipt.rb
514
515
  - lib/istox/models/concerns/blockchain_receipt_query.rb
515
516
  - lib/istox/quant/bond.rb