social_wallet 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: fcf79bfb96e061da99dba5a68d94db841efc1993
4
- data.tar.gz: d899934a4ea7a70bb917f8dfaa674e83bfd411e3
3
+ metadata.gz: 980e18d6662ff45443f911f9d6fda9befc0b19f9
4
+ data.tar.gz: 8da09fde43bdf70b49803ffd56e30c96ffae49ff
5
5
  SHA512:
6
- metadata.gz: 8182ffc96f927f45819f16084f7babc51a31864d65d8ce6542bd8b16d7eba42187977144ca151d96357b911ab3161906797d230ec37b62b95a47295c97c99ba5
7
- data.tar.gz: 7fcccc9aa740fac79a6fdbf1e05d3df4aeb7065ac42c0bcfa2b8e12fbda000b7ffef3bab023f0059c4ca69354fb5997283c5e4409b0b9fbbba8c220f6844a05e
6
+ metadata.gz: 8792a8c92a234d792854b9e5e0acf29aac5683a3a42bdc2e70e28453aa9c695aa272c4d97abb8acb8bf959af196992d51a47299d7de4c457fb234045d3cd3874
7
+ data.tar.gz: 5daec7b6886713dc8043992c5793add7a1c059a91a9216725130804c2f8e4711a20c4ab6e39af9b6dac3f50f2706f07ade26bd85efd79fc01fe0a7f552ffdc53
data/README.md CHANGED
@@ -71,7 +71,9 @@ Retrieve the list of the transactions of the default account.
71
71
  client.transactions(account_id: '').list
72
72
  ```
73
73
 
74
- **IMPORTANT**: the format of the response varies according to the backend used (e.g. `faircoin` or `mongo`).
74
+ **IMPORTANT**: the format of the response varies according to the backend used (e.g. `faircoin` or `mongo`). See the [Get](#transactions-get) for details.
75
+
76
+ <span id="#transactions-get"></span>
75
77
 
76
78
  #### Get
77
79
 
@@ -96,6 +98,7 @@ client.transactions.get transaction_id: 'xqc4cvhr...pCPfju5inCO'
96
98
  'from-id'=>'pietro',
97
99
  'to-id'=>'aaron',
98
100
  'amount'=>10,
101
+ 'amount-text'=>'10.0',
99
102
  'transaction-id'=>'xqc4cvhr...pCPfju5inCO',
100
103
  'currency'=>'MONGO'
101
104
  }
@@ -1,5 +1,6 @@
1
1
  require 'faraday'
2
2
  require 'multi_json'
3
+ require 'bigdecimal'
3
4
 
4
5
  require 'social_wallet/version'
5
6
  require 'social_wallet/error'
@@ -43,7 +43,7 @@ module SocialWallet
43
43
  end
44
44
 
45
45
  def ___balance(account_id: nil)
46
- conn = Faraday.new(url: api_endpoint + '/' + path)
46
+ conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
47
47
  response = conn.post do |req|
48
48
  req.headers['Content-Type'] = 'application/json'
49
49
  request_data['account-id'] = account_id if account_id
@@ -55,7 +55,7 @@ module SocialWallet
55
55
  end
56
56
 
57
57
  def ___label
58
- conn = Faraday.new(url: api_endpoint + '/' + path)
58
+ conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
59
59
  response = conn.post do |req|
60
60
  req.headers['Content-Type'] = 'application/json'
61
61
  req.body = MultiJson.dump(request_data)
@@ -66,7 +66,7 @@ module SocialWallet
66
66
  end
67
67
 
68
68
  def ___address(account_id: '')
69
- conn = Faraday.new(url: api_endpoint + '/' + path)
69
+ conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
70
70
  response = conn.post do |req|
71
71
  req.headers['Content-Type'] = 'application/json'
72
72
  request_data['account-id'] = account_id
@@ -79,7 +79,7 @@ module SocialWallet
79
79
 
80
80
  # def move(from_id: nil, to_id: nil, amount: 0, tags: [])
81
81
  # @path_parts << 'move'
82
- # conn = Faraday.new(url: api_endpoint + '/' + path)
82
+ # conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
83
83
  # response = conn.post do |req|
84
84
  # req.headers['Content-Type'] = 'application/json'
85
85
  # request_data['from-id'] = (from_id ||= @account_id)
@@ -104,10 +104,11 @@ module SocialWallet
104
104
  comment_to: '',
105
105
  tags: []
106
106
  )
107
- conn = Faraday.new(url: api_endpoint + '/' + path)
107
+ conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
108
108
  response = conn.post do |req|
109
109
  req.headers['Content-Type'] = 'application/json'
110
- request_data[:amount] = amount
110
+ # From SWAPI v0.9.3 amount is a String
111
+ request_data[:amount] = BigDecimal.new(amount, 16).to_s('F')
111
112
  request_data[:tags] = tags
112
113
  # TODO: find a better way to handle this
113
114
  if @path_parts.include? 'withdraws'
@@ -131,7 +132,7 @@ module SocialWallet
131
132
  end
132
133
 
133
134
  def ___list
134
- conn = Faraday.new(url: api_endpoint + '/' + path)
135
+ conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
135
136
  response = conn.post do |req|
136
137
  req.headers['Content-Type'] = 'application/json'
137
138
  request_data['account-id'] = @account_id if @path_parts.include?('transactions')
@@ -143,7 +144,7 @@ module SocialWallet
143
144
  end
144
145
 
145
146
  def ___get(transaction_id: nil)
146
- conn = Faraday.new(url: api_endpoint + '/' + path)
147
+ conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
147
148
  response = conn.post do |req|
148
149
  req.headers['Content-Type'] = 'application/json'
149
150
  request_data[:txid] = transaction_id
@@ -155,7 +156,7 @@ module SocialWallet
155
156
  end
156
157
 
157
158
  def ___check(address: '')
158
- conn = Faraday.new(url: api_endpoint + '/' + path)
159
+ conn = Faraday.new(url: api_endpoint + '/' + path, ssl: { version: 'TLSv1_2' })
159
160
  response = conn.post do |req|
160
161
  req.headers['Content-Type'] = 'application/json'
161
162
  request_data[:address] = address
@@ -1,3 +1,3 @@
1
1
  module SocialWallet
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pbmolini
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday