sila-ruby 0.0.19 → 0.0.23

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: 35481a482a5a7975d0626e5d44420ad7e66d2ba2eec7a477231dcefa8f678a8b
4
- data.tar.gz: 6bb344591630a2fbb232f827700f5a558b120a33df02bcc9aa7fde980184c5a6
3
+ metadata.gz: 1bf3d5110fbd963286f048ea3026d68f21981d9ea05a6ac11d51caf4dd02519e
4
+ data.tar.gz: b89e4ff9c9c5c0eaed889b776fcbedd9daa6a906a45ae5b701f2bfd950b53c77
5
5
  SHA512:
6
- metadata.gz: fad9fb31b92288a26030c20e69f2e834a6cee022e74c1fcf950acaadba51b8e88fdf19e3fcbdb48add31bbea641a581e4fc4beaabc8149403485fea5997cad41
7
- data.tar.gz: a60b843d29ca51e990b4d345a76b52bf28109a44ab2d2246a033d85d991861522e35e02e0ebeb3098bae2ca6f86c9a5ef29a86837f0c316191c31443c7e12363
6
+ metadata.gz: e2673276093d3c3d721fe1e01af0b50757e0a9ea7f9fc5aac9e05491fb27eb7b47c2ecd931432dac1ba26ad3158e02762e743608205b001285f46580eb67e838
7
+ data.tar.gz: 2ca0e2112982e0fa51a5fd96586b9a14ffa900b1cff49460793c72815f78d3b17e9dcd1c79dcb7db138b6b9ff0aaed0115d8914439a81474b080c4c4abdcd56b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sila-ruby (0.0.18)
4
+ sila-ruby (0.0.23)
5
5
  addressable (~> 2.6)
6
6
  dotenv (~> 2.7)
7
7
  eth
@@ -24,7 +24,7 @@ GEM
24
24
  money-tree (~> 0.10.0)
25
25
  rlp (~> 0.7.3)
26
26
  scrypt (~> 3.0.6)
27
- ffi (1.15.0)
27
+ ffi (1.15.3)
28
28
  ffi-compiler (1.0.1)
29
29
  ffi (>= 1.0.0)
30
30
  rake
@@ -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,13 +176,26 @@ 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, business_key)
187
+ header = { user_handle: handle, business_handle: business_handle }
188
+ message = 'header_msg'
189
+
190
+ # Example of params passed
191
+ #
192
+ # params = {
193
+ # role: "controlling_officer",
194
+ # member_handle: "your_individual_user_handle"
195
+ # }
196
+
197
+ sila_post_signed('link_business_member', header, message, params, user_key, business_key)
198
+ end
186
199
 
187
200
  # --------------------------------------------
188
201
  # UNLINK-BUSINESS-MEMBER ---------------------
@@ -203,7 +216,7 @@ module SilaRuby
203
216
  # kyc_level: "NONE"
204
217
  # }
205
218
 
206
- sila_post_signed('request_kyc', header, message, params, user_key)
219
+ sila_post_signed('request_kyc', header, message, params, user_key, nil)
207
220
  end
208
221
 
209
222
  # --------------------------------------------
@@ -213,18 +226,37 @@ module SilaRuby
213
226
  def self.check_kyc(handle, user_key)
214
227
  header = { user_handle: handle }
215
228
  message = 'header_msg'
216
- sila_post_signed('check_kyc', header, message, nil, user_key)
229
+ sila_post_signed('check_kyc', header, message, nil, user_key, nil)
217
230
  end
218
231
 
219
232
  # --------------------------------------------
220
233
  # CERTIFY-BENEFICIAL-OWNER -------------------
221
234
  # --------------------------------------------
222
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
223
249
 
224
250
  # --------------------------------------------
225
251
  # CERTIFY-BUSINESS ---------------------------
226
252
  # --------------------------------------------
227
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
228
260
 
229
261
  # --------------------------------------------
230
262
  # GET-ENTITIES -------------------------------
@@ -238,7 +270,7 @@ module SilaRuby
238
270
  # entity_type: "individual"
239
271
  # }
240
272
 
241
- sila_post_signed('get_entities', {}, message, params, nil)
273
+ sila_post_signed('get_entities', {}, message, params, nil, nil)
242
274
  end
243
275
 
244
276
  # --------------------------------------------
@@ -247,7 +279,9 @@ module SilaRuby
247
279
  # Gets identifying information about a registered entity.
248
280
  def self.get_entity(handle, user_key)
249
281
  header = { user_handle: handle }
250
- 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)
251
285
  end
252
286
 
253
287
  # --------------------------------------------
@@ -284,7 +318,7 @@ module SilaRuby
284
318
  # query_user_handle: "PARTNER_USER_HANDLE"
285
319
  # }
286
320
 
287
- sila_post_signed('check_partner_kyc', {}, message, params, nil)
321
+ sila_post_signed('check_partner_kyc', {}, message, params, nil, nil)
288
322
  end
289
323
 
290
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
@@ -0,0 +1,27 @@
1
+ # ================================================
2
+ # SILA-RUBY ======================================
3
+ # ================================================
4
+ module SilaRuby
5
+
6
+ # ==============================================
7
+ # UTILITIES ====================================
8
+ # ==============================================
9
+ class Utilities
10
+
11
+ # --------------------------------------------
12
+ # INCLUDES -----------------------------------
13
+ # --------------------------------------------
14
+ include ApiHelpers
15
+
16
+ # --------------------------------------------
17
+ # GET-NAICS-CATEGORIES -----------------------
18
+ # --------------------------------------------
19
+ #
20
+ def self.get_naics_categories
21
+ message = 'header_msg'
22
+
23
+ sila_post_signed('get_naics_categories', {}, message, nil, nil, nil)
24
+ end
25
+
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module SilaRuby
2
- VERSION = '0.0.19'
2
+ VERSION = '0.0.23'
3
3
  end
@@ -25,7 +25,9 @@ module SilaRuby
25
25
  # Gets details about the user wallet used to generate the usersignature header.
26
26
  def self.get_wallet(handle, user_key)
27
27
  header = { user_handle: handle }
28
- sila_post_signed('get_wallet', header, nil, nil, user_key)
28
+ message = 'header_msg'
29
+
30
+ sila_post_signed('get_wallet', header, message, nil, user_key, nil)
29
31
  end
30
32
 
31
33
  # --------------------------------------------
@@ -34,6 +36,7 @@ module SilaRuby
34
36
  # Gets array of user handle's transactions with detailed status information.
35
37
  def self.get_wallets(handle, params={}, user_key)
36
38
  header = { user_handle: handle }
39
+ message = 'header_msg'
37
40
 
38
41
  # Example of params passed
39
42
  #
@@ -48,7 +51,7 @@ module SilaRuby
48
51
  # }
49
52
  # }
50
53
 
51
- sila_post_signed('get_wallets', header, nil, params, user_key)
54
+ sila_post_signed('get_wallets', header, message, params, user_key, nil)
52
55
  end
53
56
 
54
57
  # --------------------------------------------
@@ -68,7 +71,7 @@ module SilaRuby
68
71
  # address: "0x..."
69
72
  # }
70
73
 
71
- sila_post_signed('get_sila_balance', nil, nil, params, nil)
74
+ sila_post_signed('get_sila_balance', nil, nil, params, nil, nil)
72
75
  end
73
76
 
74
77
  # --------------------------------------------
data/lib/sila_ruby.rb CHANGED
@@ -14,6 +14,7 @@ require 'sila-ruby/entities'
14
14
  require 'sila-ruby/accounts'
15
15
  require 'sila-ruby/transactions'
16
16
  require 'sila-ruby/wallets'
17
+ require 'sila-ruby/utilities'
17
18
 
18
19
  # ================================================
19
20
  # SILA-RUBY ======================================
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.19
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sequoir
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-19 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -177,6 +177,7 @@ files:
177
177
  - lib/sila-ruby/api_helpers.rb
178
178
  - lib/sila-ruby/entities.rb
179
179
  - lib/sila-ruby/transactions.rb
180
+ - lib/sila-ruby/utilities.rb
180
181
  - lib/sila-ruby/version.rb
181
182
  - lib/sila-ruby/wallets.rb
182
183
  - lib/sila_ruby.rb