sila-ruby 0.0.21 → 0.0.22

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: a704ca6477cf29a9ed60ba9f2ed28f60bae35623bec10f08ffca73ec6ba15900
4
- data.tar.gz: e06694efac8b91b8e88bce561a08b9cbc1c1f3915395d137685ddd7b377f24d5
3
+ metadata.gz: 6eb85f841b9b9f5c9bb6b3a08b5c0357ae42a867fe7ecaa66863eb859112b1d6
4
+ data.tar.gz: e62ca98a42e0d4fcaff66c3321ac515d08bcab202412bde9d29c95571533eb4b
5
5
  SHA512:
6
- metadata.gz: e94868c06c71c01532c019ab72fad0ba99715226234451421c875ca9338d1166486a429c2996f61ac16f635e50df9fbe1d80be54fb8ddba5e547e464b4f061cd
7
- data.tar.gz: 28100378d84efd45bc6fa9c03f8deb900059672dac0f6ff80ef40657bfbc1728862447c6d5752e9ff2b263312caa9d469abd6580b371653f38789ac633ec294b
6
+ metadata.gz: f65438e469269b4ec1f4bf52756dcbb3a8d4ca436cd52bc30cadacb7db89487c960ad34d703b7c06fec5404071fa3b48109ab0d833a6c8e8f81a52018b63060b
7
+ data.tar.gz: 7a3d131f0e0470538fc7dc3886988aa94eabf9b7ce2a5c4104d7b989db0d53e24e2853490494038b187b5ef69b4b4798511987c952dbb6579a5950c6ea9883db
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sila-ruby (0.0.21)
4
+ sila-ruby (0.0.22)
5
5
  addressable (~> 2.6)
6
6
  dotenv (~> 2.7)
7
7
  eth
@@ -29,7 +29,7 @@ module SilaRuby
29
29
  # selected_account_id: "optional_selected_account_id"
30
30
  # }
31
31
 
32
- sila_post_signed('link_account', header, message, params, user_key)
32
+ sila_post_signed('link_account', header, message, params, user_key, nil)
33
33
  end
34
34
 
35
35
  # --------------------------------------------
@@ -39,7 +39,7 @@ module SilaRuby
39
39
  def self.get_accounts(handle, user_key)
40
40
  header = { user_handle: handle }
41
41
  message = 'get_accounts_msg'
42
- sila_post_signed('get_accounts', header, message, nil, user_key)
42
+ sila_post_signed('get_accounts', header, message, nil, user_key, nil)
43
43
  end
44
44
 
45
45
  # --------------------------------------------
@@ -56,7 +56,7 @@ module SilaRuby
56
56
  # account_name: "Custom Account Name",
57
57
  # }
58
58
 
59
- sila_post_signed('get_account_balance', header, message, params, user_key)
59
+ sila_post_signed('get_account_balance', header, message, params, user_key, nil)
60
60
  end
61
61
 
62
62
  # --------------------------------------------
@@ -73,7 +73,7 @@ module SilaRuby
73
73
  # account_name: "Custom Account Name",
74
74
  # }
75
75
 
76
- sila_post_signed('plaid_sameday_auth', header, message, params, user_key)
76
+ sila_post_signed('plaid_sameday_auth', header, message, params, user_key, nil)
77
77
  end
78
78
 
79
79
  end
@@ -36,7 +36,7 @@ module ApiHelpers
36
36
  # --------------------------------------------
37
37
  # SILA-POST-SIGNED ---------------------------
38
38
  # --------------------------------------------
39
- def sila_post_signed(api_group, header={}, message={}, params={}, user_key)
39
+ def sila_post_signed(api_group, header={}, message={}, params={}, user_key, business_key)
40
40
  # Set the post URL
41
41
  url = "#{sila_uri}/0.2/#{api_group}"
42
42
  # Create the header
@@ -58,9 +58,14 @@ module ApiHelpers
58
58
  user_key = Eth::Key.new priv: user_key
59
59
  user_signature = sila_personal_sign(user_key, bodyJSON)
60
60
  end
61
+ # Sign the business request
62
+ unless business_key.nil?
63
+ business_key = Eth::Key.new priv: business_key
64
+ business_signature = sila_personal_sign(business_key, bodyJSON)
65
+ end
61
66
  # Post to the API endpoint
62
67
  begin
63
- response = HTTParty.post(url, { "body": bodyJSON, "headers": { "authsignature": auth_signature, "usersignature": user_signature }})
68
+ response = HTTParty.post(url, { "body": bodyJSON, "headers": { "authsignature": auth_signature, "usersignature": user_signature, "businesssignature": business_signature }})
64
69
  res_hash(response)
65
70
  rescue => e
66
71
  e.inspect
@@ -20,7 +20,7 @@ module SilaRuby
20
20
  def self.check_handle(handle)
21
21
  header = { user_handle: handle }
22
22
  message = 'header_msg'
23
- sila_post_signed('check_handle', header, message, nil, nil)
23
+ sila_post_signed('check_handle', header, message, nil, nil, nil)
24
24
  end
25
25
 
26
26
  # --------------------------------------------
@@ -99,7 +99,7 @@ module SilaRuby
99
99
  # }
100
100
  # }
101
101
 
102
- sila_post_signed('register', header, message, params, nil)
102
+ sila_post_signed('register', header, message, params, nil, nil)
103
103
  end
104
104
 
105
105
  # --------------------------------------------
@@ -124,7 +124,7 @@ module SilaRuby
124
124
  # email: "test@silamoney.com"
125
125
  # }
126
126
 
127
- sila_post_signed('add/' + valid_path, header, message, params, user_key)
127
+ sila_post_signed('add/' + valid_path, header, message, params, user_key, nil)
128
128
  end
129
129
 
130
130
  # --------------------------------------------
@@ -151,7 +151,7 @@ module SilaRuby
151
151
  # email: "test@silamoney.com"
152
152
  # }
153
153
 
154
- sila_post_signed('update/' + valid_path, header, message, params, user_key)
154
+ sila_post_signed('update/' + valid_path, header, message, params, user_key, nil)
155
155
  end
156
156
 
157
157
  # --------------------------------------------
@@ -176,14 +176,14 @@ module SilaRuby
176
176
  # uuid: "7f83044b-63c8-4d56-b107-d52fa7ae2d7a"
177
177
  # }
178
178
 
179
- sila_post_signed('delete/' + valid_path, header, message, params, user_key)
179
+ sila_post_signed('delete/' + valid_path, header, message, params, user_key, nil)
180
180
  end
181
181
 
182
182
  # --------------------------------------------
183
183
  # LINK-BUSINESS-MEMBER -----------------------
184
184
  # --------------------------------------------
185
185
  #
186
- def self.link_business_member(handle, params={}, user_key, business_handle)
186
+ def self.link_business_member(handle, params={}, user_key, business_handle, business_key)
187
187
  header = { user_handle: handle, business_handle: business_handle }
188
188
  message = 'header_msg'
189
189
 
@@ -194,7 +194,7 @@ module SilaRuby
194
194
  # member_handle: "your_individual_user_handle"
195
195
  # }
196
196
 
197
- sila_post_signed('link_business_member', header, message, params, user_key)
197
+ sila_post_signed('link_business_member', header, message, params, user_key, business_key)
198
198
  end
199
199
 
200
200
  # --------------------------------------------
@@ -216,7 +216,7 @@ module SilaRuby
216
216
  # kyc_level: "NONE"
217
217
  # }
218
218
 
219
- sila_post_signed('request_kyc', header, message, params, user_key)
219
+ sila_post_signed('request_kyc', header, message, params, user_key, nil)
220
220
  end
221
221
 
222
222
  # --------------------------------------------
@@ -226,18 +226,37 @@ module SilaRuby
226
226
  def self.check_kyc(handle, user_key)
227
227
  header = { user_handle: handle }
228
228
  message = 'header_msg'
229
- sila_post_signed('check_kyc', header, message, nil, user_key)
229
+ sila_post_signed('check_kyc', header, message, nil, user_key, nil)
230
230
  end
231
231
 
232
232
  # --------------------------------------------
233
233
  # CERTIFY-BENEFICIAL-OWNER -------------------
234
234
  # --------------------------------------------
235
235
  #
236
+ def self.certify_beneficial_owner(handle, params={}, user_key, business_handle, business_key)
237
+ header = { user_handle: handle, business_handle: business_handle }
238
+ message = 'header_msg'
239
+
240
+ # Example of params passed
241
+ #
242
+ # params = {
243
+ # member_handle: "your_beneficial_owner_member.silamoney.eth",
244
+ # certification_token: "889288b15f686baa1f782ba6f51f3594fcfc72cb"
245
+ # }
246
+
247
+ sila_post_signed('certify_beneficial_owner', header, message, params, user_key, business_key)
248
+ end
236
249
 
237
250
  # --------------------------------------------
238
251
  # CERTIFY-BUSINESS ---------------------------
239
252
  # --------------------------------------------
240
253
  #
254
+ def self.certify_business(handle, user_key, business_handle, business_key)
255
+ header = { user_handle: handle, business_handle: business_handle }
256
+ message = 'header_msg'
257
+
258
+ sila_post_signed('certify_business', header, message, nil, user_key, business_key)
259
+ end
241
260
 
242
261
  # --------------------------------------------
243
262
  # GET-ENTITIES -------------------------------
@@ -251,7 +270,7 @@ module SilaRuby
251
270
  # entity_type: "individual"
252
271
  # }
253
272
 
254
- sila_post_signed('get_entities', {}, message, params, nil)
273
+ sila_post_signed('get_entities', {}, message, params, nil, nil)
255
274
  end
256
275
 
257
276
  # --------------------------------------------
@@ -260,7 +279,9 @@ module SilaRuby
260
279
  # Gets identifying information about a registered entity.
261
280
  def self.get_entity(handle, user_key)
262
281
  header = { user_handle: handle }
263
- sila_post_signed('check_handle', header, nil, nil, user_key)
282
+ message = 'header_msg'
283
+
284
+ sila_post_signed('get_entity', header, message, nil, user_key, nil)
264
285
  end
265
286
 
266
287
  # --------------------------------------------
@@ -297,7 +318,7 @@ module SilaRuby
297
318
  # query_user_handle: "PARTNER_USER_HANDLE"
298
319
  # }
299
320
 
300
- sila_post_signed('check_partner_kyc', {}, message, params, nil)
321
+ sila_post_signed('check_partner_kyc', {}, message, params, nil, nil)
301
322
  end
302
323
 
303
324
  end
@@ -31,7 +31,7 @@ module SilaRuby
31
31
  # processing_type: "STANDARD_ACH" # SAME_DAY_ACH
32
32
  # }
33
33
 
34
- sila_post_signed('issue_sila', header, message, params, user_key)
34
+ sila_post_signed('issue_sila', header, message, params, user_key, nil)
35
35
  end
36
36
 
37
37
  # --------------------------------------------
@@ -51,7 +51,7 @@ module SilaRuby
51
51
  # business_uuid: "UUID of a business with an approved ACH name"
52
52
  # }
53
53
 
54
- sila_post_signed('transfer_sila', header, message, params, user_key)
54
+ sila_post_signed('transfer_sila', header, message, params, user_key, nil)
55
55
  end
56
56
 
57
57
  # --------------------------------------------
@@ -72,7 +72,7 @@ module SilaRuby
72
72
  # processing_type: "STANDARD_ACH" # SAME_DAY_ACH
73
73
  # }
74
74
 
75
- sila_post_signed('redeem_sila', header, message, params, user_key)
75
+ sila_post_signed('redeem_sila', header, message, params, user_key, nil)
76
76
  end
77
77
 
78
78
  # --------------------------------------------
@@ -102,7 +102,7 @@ module SilaRuby
102
102
  # }
103
103
  # }
104
104
 
105
- sila_post_signed('get_transactions', header, message, params, user_key)
105
+ sila_post_signed('get_transactions', header, message, params, user_key, nil)
106
106
  end
107
107
 
108
108
  # --------------------------------------------
@@ -119,7 +119,7 @@ module SilaRuby
119
119
  # transaction_id: "80aea226-76a3-4b60-a629-25a2db572ec8"
120
120
  # }
121
121
 
122
- sila_post_signed('cancel_transaction', header, message, params, user_key)
122
+ sila_post_signed('cancel_transaction', header, message, params, user_key, nil)
123
123
  end
124
124
 
125
125
  end
@@ -1,3 +1,3 @@
1
1
  module SilaRuby
2
- VERSION = '0.0.21'
2
+ VERSION = '0.0.22'
3
3
  end
@@ -27,7 +27,7 @@ module SilaRuby
27
27
  header = { user_handle: handle }
28
28
  message = 'header_msg'
29
29
 
30
- sila_post_signed('get_wallet', header, message, nil, user_key)
30
+ sila_post_signed('get_wallet', header, message, nil, user_key, nil)
31
31
  end
32
32
 
33
33
  # --------------------------------------------
@@ -51,7 +51,7 @@ module SilaRuby
51
51
  # }
52
52
  # }
53
53
 
54
- sila_post_signed('get_wallets', header, message, params, user_key)
54
+ sila_post_signed('get_wallets', header, message, params, user_key, nil)
55
55
  end
56
56
 
57
57
  # --------------------------------------------
@@ -71,7 +71,7 @@ module SilaRuby
71
71
  # address: "0x..."
72
72
  # }
73
73
 
74
- sila_post_signed('get_sila_balance', nil, nil, params, nil)
74
+ sila_post_signed('get_sila_balance', nil, nil, params, nil, nil)
75
75
  end
76
76
 
77
77
  # --------------------------------------------
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sila-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sequoir
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-17 00:00:00.000000000 Z
11
+ date: 2021-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable