sila-ruby 0.0.11 → 0.0.16

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: 26dc5c181f0fd368358f57c021d872f889e28857e2e67db7eb9e01fb494ac651
4
- data.tar.gz: 3e4923d6564629912edc2310f5422f0cea62d84a50d006fce5153738752a242d
3
+ metadata.gz: b356a093959c5e9c60bc8d1cd0c4536afc0a3fbecd15d6e3cf526af8333a496a
4
+ data.tar.gz: 938b5cc5e5c44fbea6b90f62dd51723f03c325f02c31a1b30fd3ad84c6337d6a
5
5
  SHA512:
6
- metadata.gz: 722de732ae96e7da6ec0c1e9d189bc223bfddd710076ae23bd241d7156db216cd1905e3d6132b97da018374e8ebf04199f718adf6006bd65f9dfe90ca560ee6c
7
- data.tar.gz: 7aa35fbfa6868db854595634165608eb192d8afadcc44fb62b4e3e25818c002e7b4dbc194f8e3366b1247d850d2529622c59fd1f15d227697eea0f849e85465c
6
+ metadata.gz: bded959695c50a8e5d8b7d9010c3e87742ab48626df45106146c9a498c098e44392ff85896315f27c4cd03ce2ae1d15a9d4d086fb49579c0a4655b72a0f3de77
7
+ data.tar.gz: 6769efd5297b1fc58d7b5f63cb18a77d515bc141b1c6ce8bbbf305677217af6ded229cd0dd38dd7a5f6d8b3471ae813b1bad70cefa4bbfb1f03f1cd91cf1b0f9
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Datasource local storage ignored files
5
+ /dataSources/
6
+ /dataSources.local.xml
7
+ # Editor-based HTTP Client requests
8
+ /httpRequests/
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.5.1" project-jdk-type="RUBY_SDK" />
4
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/sila-ruby.iml" filepath="$PROJECT_DIR$/.idea/sila-ruby.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="inheritedJdk" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="addressable (v2.7.0, rbenv: 2.5.1) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.3, rbenv: 2.5.1) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, rbenv: 2.5.1) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="docile (v1.3.2, rbenv: 2.5.1) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="dotenv (v2.7.6, rbenv: 2.5.1) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="ffi (v1.12.2, rbenv: 2.5.1) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="httparty (v0.18.1, rbenv: 2.5.1) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="json (v2.3.1, rbenv: 2.5.1) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="mime-types (v3.3.1, rbenv: 2.5.1) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2020.0512, rbenv: 2.5.1) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="multi_xml (v0.6.0, rbenv: 2.5.1) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="public_suffix (v4.0.5, rbenv: 2.5.1) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, rbenv: 2.5.1) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.2, rbenv: 2.5.1) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.2, rbenv: 2.5.1) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, rbenv: 2.5.1) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.3, rbenv: 2.5.1) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.16.1, rbenv: 2.5.1) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.10.2, rbenv: 2.5.1) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.7.0, rbenv: 2.5.1) [gem]" level="application" />
34
+ </component>
35
+ </module>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sila-ruby (0.0.7)
4
+ sila-ruby (0.0.12)
5
5
  addressable (~> 2.6)
6
6
  dotenv (~> 2.7)
7
7
  eth
@@ -15,46 +15,46 @@ GEM
15
15
  public_suffix (>= 2.0.2, < 5.0)
16
16
  ansi (1.5.0)
17
17
  diff-lcs (1.3)
18
- digest-sha3 (1.1.0)
18
+ digest-sha3-patched (1.1.1)
19
19
  docile (1.3.2)
20
20
  dotenv (2.7.5)
21
- eth (0.4.10)
22
- digest-sha3 (~> 1.1)
21
+ eth (0.4.12)
22
+ digest-sha3-patched (~> 1.1)
23
23
  ffi (~> 1.0)
24
24
  money-tree (~> 0.10.0)
25
25
  rlp (~> 0.7.3)
26
26
  scrypt (~> 3.0.6)
27
- ffi (1.11.1)
27
+ ffi (1.12.2)
28
28
  ffi-compiler (1.0.1)
29
29
  ffi (>= 1.0.0)
30
30
  rake
31
- httparty (0.17.1)
31
+ httparty (0.18.0)
32
32
  mime-types (~> 3.0)
33
33
  multi_xml (>= 0.5.2)
34
- json (2.2.0)
35
- mime-types (3.3)
34
+ json (2.3.0)
35
+ mime-types (3.3.1)
36
36
  mime-types-data (~> 3.2015)
37
- mime-types-data (3.2019.1009)
37
+ mime-types-data (3.2020.0512)
38
38
  money-tree (0.10.0)
39
39
  ffi
40
40
  multi_xml (0.6.0)
41
- public_suffix (4.0.1)
41
+ public_suffix (4.0.5)
42
42
  rake (10.5.0)
43
43
  rlp (0.7.3)
44
- rspec (3.8.0)
45
- rspec-core (~> 3.8.0)
46
- rspec-expectations (~> 3.8.0)
47
- rspec-mocks (~> 3.8.0)
48
- rspec-core (3.8.1)
49
- rspec-support (~> 3.8.0)
50
- rspec-expectations (3.8.4)
44
+ rspec (3.9.0)
45
+ rspec-core (~> 3.9.0)
46
+ rspec-expectations (~> 3.9.0)
47
+ rspec-mocks (~> 3.9.0)
48
+ rspec-core (3.9.2)
49
+ rspec-support (~> 3.9.3)
50
+ rspec-expectations (3.9.2)
51
51
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.8.0)
53
- rspec-mocks (3.8.1)
52
+ rspec-support (~> 3.9.0)
53
+ rspec-mocks (3.9.1)
54
54
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.8.0)
56
- rspec-support (3.8.2)
57
- scrypt (3.0.6)
55
+ rspec-support (~> 3.9.0)
56
+ rspec-support (3.9.3)
57
+ scrypt (3.0.7)
58
58
  ffi-compiler (>= 1.0, < 2.0)
59
59
  simplecov (0.16.1)
60
60
  docile (~> 1.1)
@@ -67,7 +67,7 @@ GEM
67
67
  simplecov-html (0.10.2)
68
68
  terminal-table (1.8.0)
69
69
  unicode-display_width (~> 1.1, >= 1.1.1)
70
- unicode-display_width (1.6.0)
70
+ unicode-display_width (1.7.0)
71
71
 
72
72
  PLATFORMS
73
73
  ruby
@@ -14,78 +14,66 @@ module SilaRuby
14
14
  include ApiHelpers
15
15
 
16
16
  # --------------------------------------------
17
- # CHECK-HANDLE -------------------------------
17
+ # LINK-ACCOUNT -------------------------------
18
18
  # --------------------------------------------
19
- # Check if a specific handle is taken
20
- def self.check_handle(handle)
19
+ # Uses a provided Plaid public token to link a bank account to a verified entity.
20
+ def self.link_account(handle, params={}, user_key)
21
21
  header = { user_handle: handle }
22
- message = 'header_msg'
23
- sila_post_signed('check_handle', header, message, nil, nil)
24
- end
25
-
26
- # --------------------------------------------
27
- # REGISTER -----------------------------------
28
- # --------------------------------------------
29
- # Attaches KYC and blockchain address to user handle
30
- def self.register(handle, params={})
31
- header = { user_handle: handle }
32
- message = 'entity_msg'
22
+ message = 'link_account_msg'
33
23
 
34
24
  # Example of params passed
35
25
  #
36
26
  # params = {
37
- # address: {
38
- # address_alias: "home",
39
- # street_address_1: "1265 Lombardi Ave",
40
- # city: "Green Bay",
41
- # state: "WI",
42
- # country: "US",
43
- # postal_code: "54304"
44
- # },
45
- # identity: {
46
- # identity_alias: "SSN",
47
- # identity_value: "123452222"
48
- # },
49
- # contact: {
50
- # contact_alias: "",
51
- # phone: "503-123-4567",
52
- # email: "example@silamoney.com"
53
- # },
54
- # crypto_entry: {
55
- # crypto_alias: "Address 1",
56
- # crypto_address: "0x1234567890abcdef1234567890abcdef12345678",
57
- # crypto_code: "ETH"
58
- # },
59
- # entity: {
60
- # birthdate: "1900-01-31",
61
- # entity_name: "Example User",
62
- # first_name: "Example",
63
- # last_name: "User",
64
- # relationship: "user"
65
- # }
27
+ # public_token: "public-xxx-xxx",
28
+ # account_name: "Custom Account Name",
29
+ # selected_account_id: "optional_selected_account_id"
66
30
  # }
67
31
 
68
- sila_post_signed('register', header, message, params, nil)
32
+ sila_post_signed('link_account', header, message, params, user_key)
69
33
  end
70
34
 
71
35
  # --------------------------------------------
72
- # REQUEST-KYC --------------------------------
36
+ # GET-ACCOUNTS -------------------------------
73
37
  # --------------------------------------------
74
- # Start KYC verification process on a registered user handle
75
- def self.request_kyc(handle, user_key)
38
+ # Gets basic bank account names linked to user handle.
39
+ def self.get_accounts(handle, user_key)
40
+ header = { user_handle: handle }
41
+ message = 'get_accounts_msg'
42
+ sila_post_signed('get_accounts', header, message, nil, user_key)
43
+ end
44
+
45
+ # --------------------------------------------
46
+ # GET-ACCOUNT-BALANCE ------------------------
47
+ # --------------------------------------------
48
+ # Requests bank account balance data from an end-users linked bank account.
49
+ def self.get_account_balance(handle, params={}, user_key)
76
50
  header = { user_handle: handle }
77
51
  message = 'header_msg'
78
- sila_post_signed('request_kyc', header, message, nil, user_key)
52
+
53
+ # Example of params passed
54
+ #
55
+ # params = {
56
+ # account_name: "Custom Account Name",
57
+ # }
58
+
59
+ sila_post_signed('get_account_balance', header, message, params, user_key)
79
60
  end
80
61
 
81
62
  # --------------------------------------------
82
- # CHECK-KYC ----------------------------------
63
+ # PLAID-SAMEDAY-AUTH -------------------------
83
64
  # --------------------------------------------
84
- # Whether entity attached to user handle is verified, not valid, or pending
85
- def self.check_kyc(handle, user_key)
65
+ # Handle a request for a Plaid Link public_token in order to complete Plaid's Same Day Microdeposit Authentication.
66
+ def self.plaid_sameday_auth(handle, params={}, user_key)
86
67
  header = { user_handle: handle }
87
68
  message = 'header_msg'
88
- sila_post_signed('check_kyc', header, message, nil, user_key)
69
+
70
+ # Example of params passed
71
+ #
72
+ # params = {
73
+ # account_name: "Custom Account Name",
74
+ # }
75
+
76
+ sila_post_signed('plaid_sameday_auth', header, message, params, user_key)
89
77
  end
90
78
 
91
79
  end
@@ -0,0 +1,254 @@
1
+ # ================================================
2
+ # SILA-RUBY ======================================
3
+ # ================================================
4
+ module SilaRuby
5
+
6
+ # ==============================================
7
+ # ENTITIES =====================================
8
+ # ==============================================
9
+ class Entities
10
+
11
+ # --------------------------------------------
12
+ # INCLUDES -----------------------------------
13
+ # --------------------------------------------
14
+ include ApiHelpers
15
+
16
+ # --------------------------------------------
17
+ # CHECK-HANDLE -------------------------------
18
+ # --------------------------------------------
19
+ # Check if a specific handle is taken
20
+ def self.check_handle(handle)
21
+ header = { user_handle: handle }
22
+ message = 'header_msg'
23
+ sila_post_signed('check_handle', header, message, nil, nil)
24
+ end
25
+
26
+ # --------------------------------------------
27
+ # REGISTER -----------------------------------
28
+ # --------------------------------------------
29
+ # Attaches KYC and blockchain address to user handle
30
+ def self.register(handle, params={})
31
+ header = { user_handle: handle }
32
+ message = 'entity_msg'
33
+
34
+ # Example of params passed for USER
35
+ #
36
+ # params = {
37
+ # address: {
38
+ # address_alias: "home",
39
+ # street_address_1: "123 Main Street",
40
+ # city: "New City",
41
+ # state: "OR",
42
+ # country: "US",
43
+ # postal_code: "97204-1234"
44
+ # },
45
+ # identity: {
46
+ # identity_alias: "SSN",
47
+ # identity_value: "123452222"
48
+ # },
49
+ # contact: {
50
+ # phone: "503-123-4567",
51
+ # contact_alias: "",
52
+ # email: "example@silamoney.com"
53
+ # },
54
+ # crypto_entry: {
55
+ # crypto_alias: "Address 1",
56
+ # crypto_address: "0x1234567890abcdef1234567890abcdef12345678",
57
+ # crypto_code: "ETH"
58
+ # },
59
+ # entity: {
60
+ # birthdate: "1900-01-31",
61
+ # entity_name: "Example User",
62
+ # first_name: "Example",
63
+ # last_name: "User",
64
+ # relationship: "user"
65
+ # }
66
+ # }
67
+ #
68
+ #
69
+ # Example of params passed for BUSINESS
70
+ #
71
+ # params = {
72
+ # identity: {
73
+ # identity_alias: "EIN",
74
+ # identity_value: "12-1234567"
75
+ # },
76
+ # address: {
77
+ # address_alias: "Office",
78
+ # street_address_1: "123 Candelabra Blvd.",
79
+ # city: "Portland",
80
+ # state: "OR",
81
+ # country: "US",
82
+ # postal_code: "97204"
83
+ # },
84
+ # contact: {
85
+ # phone: "1231231234",
86
+ # email: "business@businessemail.com"
87
+ # },
88
+ # entity: {
89
+ # type: "business",
90
+ # entity_name: "Your Business Customer, Inc.",
91
+ # business_type: "corporation",
92
+ # business_website: "https://www.yourbusinesscustomer.com",
93
+ # doing_business_as: "Your Business Customer Alias Co.",
94
+ # naics_code: 721
95
+ # },
96
+ # crypto_entry: {
97
+ # crypto_code: "ETH",
98
+ # crypto_address: "0x67CB...E1FB"
99
+ # }
100
+ # }
101
+
102
+ sila_post_signed('register', header, message, params, nil)
103
+ end
104
+
105
+ # --------------------------------------------
106
+ # ADD-REGISTRATION ---------------------------
107
+ # --------------------------------------------
108
+ # Add a new email, phone number, street address, or identity to a registered entity.
109
+ def self.add_registration(handle, params={}, valid_path, user_key)
110
+ header = { user_handle: handle }
111
+ message = 'header_msg'
112
+
113
+ # Valid path options
114
+ #
115
+ # email
116
+ # phone
117
+ # identity
118
+ # address
119
+ #
120
+ #
121
+ # Example of params passed
122
+ #
123
+ # params = {
124
+ # email: "test@silamoney.com"
125
+ # }
126
+
127
+ sila_post_signed('add/' + valid_path, header, message, params, user_key)
128
+ end
129
+
130
+ # --------------------------------------------
131
+ # UPDATE-REGISTRATION ------------------------
132
+ # --------------------------------------------
133
+ # Update an existing email, phone number, street address, identity, or entity (name, birthdate, or business data).
134
+ def self.update_registration(handle, params={}, valid_path, user_key)
135
+ header = { user_handle: handle }
136
+ message = 'header_msg'
137
+
138
+ # Valid path options
139
+ #
140
+ # email
141
+ # phone
142
+ # identity
143
+ # address
144
+ # entity
145
+ #
146
+ #
147
+ # Example of params passed
148
+ #
149
+ # params = {
150
+ # uuid: "7f83044b-63c8-4d56-b107-d52fa7ae2d7a",
151
+ # email: "test@silamoney.com"
152
+ # }
153
+
154
+ sila_post_signed('update/' + valid_path, header, message, params, user_key)
155
+ end
156
+
157
+ # --------------------------------------------
158
+ # DELETE-REGISTRATION ------------------------
159
+ # --------------------------------------------
160
+ # Delete an existing email, phone number, street address, or identity.
161
+ def self.delete_registration(handle, params={}, valid_path, user_key)
162
+ header = { user_handle: handle }
163
+ message = 'header_msg'
164
+
165
+ # Valid path options
166
+ #
167
+ # email
168
+ # phone
169
+ # identity
170
+ # address
171
+ #
172
+ #
173
+ # Example of params passed
174
+ #
175
+ # params = {
176
+ # uuid: "7f83044b-63c8-4d56-b107-d52fa7ae2d7a"
177
+ # }
178
+
179
+ sila_post_signed('delete/' + valid_path, header, message, params, user_key)
180
+ end
181
+
182
+ # --------------------------------------------
183
+ # LINK-BUSINESS-MEMBER -----------------------
184
+ # --------------------------------------------
185
+ #
186
+
187
+ # --------------------------------------------
188
+ # UNLINK-BUSINESS-MEMBER ---------------------
189
+ # --------------------------------------------
190
+ #
191
+
192
+ # --------------------------------------------
193
+ # REQUEST-KYC --------------------------------
194
+ # --------------------------------------------
195
+ # Start KYC verification process on a registered user handle
196
+ def self.request_kyc(handle, params={}, user_key)
197
+ header = { user_handle: handle }
198
+ message = 'header_msg'
199
+
200
+ # Optional params for requesting KYC
201
+ #
202
+ # params = {
203
+ # kyc_level: "NONE"
204
+ # }
205
+
206
+ sila_post_signed('request_kyc', header, message, params, user_key)
207
+ end
208
+
209
+ # --------------------------------------------
210
+ # CHECK-KYC ----------------------------------
211
+ # --------------------------------------------
212
+ # Whether entity attached to user handle is verified, not valid, or pending
213
+ def self.check_kyc(handle, user_key)
214
+ header = { user_handle: handle }
215
+ message = 'header_msg'
216
+ sila_post_signed('check_kyc', header, message, nil, user_key)
217
+ end
218
+
219
+ # --------------------------------------------
220
+ # CERTIFY-BENEFICIAL-OWNER -------------------
221
+ # --------------------------------------------
222
+ #
223
+
224
+ # --------------------------------------------
225
+ # CERTIFY-BUSINESS ---------------------------
226
+ # --------------------------------------------
227
+ #
228
+
229
+ # --------------------------------------------
230
+ # GET-ENTITIES -------------------------------
231
+ # --------------------------------------------
232
+ # Return all end-user and legal entities (businesses) associated with a customer application.
233
+ # This endpoint allows the listing of all entities registered to an application.
234
+ def self.get_entities(params={})
235
+ message = 'header_msg'
236
+
237
+ # params = {
238
+ # entity_type: "individual"
239
+ # }
240
+
241
+ sila_post_signed('get_entities', nil, message, params, nil)
242
+ end
243
+
244
+ # --------------------------------------------
245
+ # GET-ENTITY ---------------------------------
246
+ # --------------------------------------------
247
+ # Gets identifying information about a registered entity.
248
+ def self.get_entity(handle, user_key)
249
+ header = { user_handle: handle }
250
+ sila_post_signed('check_handle', header, nil, nil, user_key)
251
+ end
252
+
253
+ end
254
+ end
@@ -16,7 +16,7 @@ module SilaRuby
16
16
  # --------------------------------------------
17
17
  # ISSUE-SILA ---------------------------------
18
18
  # --------------------------------------------
19
- # Debits a specified account and issues tokens to the address belonging to the requested handle
19
+ # Debits a specified account and issues tokens to the address belonging to the requested handle.
20
20
  def self.issue_sila(handle, params={}, user_key)
21
21
  header = { user_handle: handle }
22
22
  message = 'issue_msg'
@@ -25,7 +25,10 @@ module SilaRuby
25
25
  #
26
26
  # params = {
27
27
  # amount: 1000,
28
- # account_name: "default"
28
+ # account_name: "default",
29
+ # descriptor: "optional transaction descriptor",
30
+ # business_uuid: "UUID of a business with an approved ACH name",
31
+ # processing_type: "STANDARD_ACH" # SAME_DAY_ACH
29
32
  # }
30
33
 
31
34
  sila_post_signed('issue_sila', header, message, params, user_key)
@@ -34,7 +37,7 @@ module SilaRuby
34
37
  # --------------------------------------------
35
38
  # TRANSFER-SILA ------------------------------
36
39
  # --------------------------------------------
37
- # Starts a transfer of the requested amount of SILA to the requested destination handle
40
+ # Starts a transfer of the requested amount of SILA to the requested destination handle.
38
41
  def self.transfer_sila(handle, params={}, user_key)
39
42
  header = { user_handle: handle }
40
43
  message = 'transfer_msg'
@@ -42,8 +45,10 @@ module SilaRuby
42
45
  # Example of params passed
43
46
  #
44
47
  # params = {
48
+ # destination_handle: "user2.silamoney.eth",
45
49
  # amount: 1000,
46
- # destination: "user2.silamoney.eth"
50
+ # descriptor: "optional transaction descriptor",
51
+ # business_uuid: "UUID of a business with an approved ACH name"
47
52
  # }
48
53
 
49
54
  sila_post_signed('transfer_sila', header, message, params, user_key)
@@ -52,7 +57,7 @@ module SilaRuby
52
57
  # --------------------------------------------
53
58
  # REDEEM-SILA --------------------------------
54
59
  # --------------------------------------------
55
- # Burns given amount of SILA at the handle's blockchain address and credits their named bank account in the equivalent monetary amount
60
+ # Burns given amount of SILA at the handle's blockchain address and credits their named bank account in the equivalent monetary amount.
56
61
  def self.redeem_sila(handle, params={}, user_key)
57
62
  header = { user_handle: handle }
58
63
  message = 'redeem_msg'
@@ -61,7 +66,10 @@ module SilaRuby
61
66
  #
62
67
  # params = {
63
68
  # amount: 1000,
64
- # account_name: "default"
69
+ # account_name: "default",
70
+ # descriptor: "optional transaction descriptor",
71
+ # business_uuid: "UUID of a business with an approved ACH name",
72
+ # processing_type: "STANDARD_ACH" # SAME_DAY_ACH
65
73
  # }
66
74
 
67
75
  sila_post_signed('redeem_sila', header, message, params, user_key)
@@ -70,7 +78,7 @@ module SilaRuby
70
78
  # --------------------------------------------
71
79
  # GET-TRANSACTIONS ---------------------------
72
80
  # --------------------------------------------
73
- # Gets array of user handle's transactions with detailed status information
81
+ # Gets array of user handle's transactions with detailed status information.
74
82
  def self.get_transactions(handle, params={}, user_key)
75
83
  header = { user_handle: handle }
76
84
  message = 'get_transactions_msg'
@@ -85,7 +93,7 @@ module SilaRuby
85
93
  # sort_ascending: false,
86
94
  # max_sila_amount: 1300,
87
95
  # min_sila_amount: 1000,
88
- # statuses: ["pending", "successful", "failed", "complete"],
96
+ # statuses: ["queued", "pending", "failed", "success", "rollback", "review"],
89
97
  # start_epoch: 1234567860,
90
98
  # end_epoch: 1234567891,
91
99
  # page: 1,
@@ -97,5 +105,21 @@ module SilaRuby
97
105
  sila_post_signed('get_transactions', header, message, params, user_key)
98
106
  end
99
107
 
108
+ # --------------------------------------------
109
+ # CANCEL-TRANSACTION -------------------------
110
+ # --------------------------------------------
111
+ # Cancel a pending transaction under certain circumstances.
112
+ def self.cancel_transaction(handle, params={}, user_key)
113
+ header = { user_handle: handle }
114
+
115
+ # Example of params passed
116
+ #
117
+ # params = {
118
+ # transaction_id: "80aea226-76a3-4b60-a629-25a2db572ec8"
119
+ # }
120
+
121
+ sila_post_signed('cancel_transaction', header, nil, params, user_key)
122
+ end
123
+
100
124
  end
101
125
  end
@@ -1,3 +1,3 @@
1
1
  module SilaRuby
2
- VERSION = '0.0.11'
3
- end
2
+ VERSION = '0.0.16'
3
+ end
@@ -0,0 +1,81 @@
1
+ # ================================================
2
+ # SILA-RUBY ======================================
3
+ # ================================================
4
+ module SilaRuby
5
+
6
+ # ==============================================
7
+ # WALLETS ======================================
8
+ # ==============================================
9
+ class Wallets
10
+
11
+ # --------------------------------------------
12
+ # INCLUDES -----------------------------------
13
+ # --------------------------------------------
14
+ include ApiHelpers
15
+
16
+ # --------------------------------------------
17
+ # REGISTER-WALLET ----------------------------
18
+ # --------------------------------------------
19
+ # Adds another "wallet"/blockchain address to a user handle.
20
+ # TODO: https://docs.silamoney.com/docs/register_wallet
21
+
22
+ # --------------------------------------------
23
+ # GET-WALLET ---------------------------------
24
+ # --------------------------------------------
25
+ # Gets details about the user wallet used to generate the usersignature header.
26
+ def self.get_wallet(handle, user_key)
27
+ header = { user_handle: handle }
28
+ sila_post_signed('get_wallet', header, nil, nil, user_key)
29
+ end
30
+
31
+ # --------------------------------------------
32
+ # GET-WALLETS --------------------------------
33
+ # --------------------------------------------
34
+ # Gets array of user handle's transactions with detailed status information.
35
+ def self.get_wallets(handle, params={}, user_key)
36
+ header = { user_handle: handle }
37
+
38
+ # Example of params passed
39
+ #
40
+ # params = {
41
+ # search_filters: {
42
+ # page: 1,
43
+ # per_page: 20,
44
+ # sort_ascending: false,
45
+ # blockchain_network: "ETH",
46
+ # blockchain_address: "",
47
+ # nickname: ""
48
+ # }
49
+ # }
50
+
51
+ sila_post_signed('get_wallets', header, nil, params, user_key)
52
+ end
53
+
54
+ # --------------------------------------------
55
+ # UPDATE-WALLET ------------------------------
56
+ # --------------------------------------------
57
+ # Updates nickname and/or default status of a wallet.
58
+ # TODO: https://docs.silamoney.com/docs/update_wallet
59
+
60
+ # --------------------------------------------
61
+ # GET-SILA-BALANCE ---------------------------
62
+ # --------------------------------------------
63
+ # Checks token balance on a blockchain address.
64
+ def self.get_sila_balance(params={})
65
+ # Example of params passed
66
+ #
67
+ # params = {
68
+ # address: "0x..."
69
+ # }
70
+
71
+ sila_post_signed('get_sila_balance', nil, nil, params, nil)
72
+ end
73
+
74
+ # --------------------------------------------
75
+ # DELETE-WALLET ------------------------------
76
+ # --------------------------------------------
77
+ # Deletes a user wallet.
78
+ # https://docs.silamoney.com/docs/delete_wallet
79
+
80
+ end
81
+ end
@@ -10,9 +10,10 @@ require 'eth'
10
10
 
11
11
  require 'sila-ruby/version'
12
12
  require 'sila-ruby/api_helpers'
13
+ require 'sila-ruby/entities'
13
14
  require 'sila-ruby/accounts'
14
- require 'sila-ruby/banks'
15
15
  require 'sila-ruby/transactions'
16
+ require 'sila-ruby/wallets'
16
17
 
17
18
  # ================================================
18
19
  # SILA-RUBY ======================================
@@ -7,12 +7,12 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'sila-ruby'
8
8
  spec.version = SilaRuby::VERSION
9
9
  spec.licenses = ['MIT']
10
- spec.authors = ['Vertbase']
11
- spec.email = ['dev@vertbase.com']
10
+ spec.authors = ['Sequoir']
11
+ spec.email = ['engineering@sequoir.com']
12
12
 
13
13
  spec.summary = 'Ruby implementation of the Sila API'
14
14
  spec.description = 'Ruby implementation of the Sila API'
15
- spec.homepage = 'https://github.com/vertbase/sila-ruby'
15
+ spec.homepage = 'https://github.com/sequoir/sila-ruby'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
18
  f.match(%r{^(test|spec|features)/})
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.11
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
- - Vertbase
7
+ - Sequoir
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-12 00:00:00.000000000 Z
11
+ date: 2021-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -152,13 +152,18 @@ dependencies:
152
152
  version: 0.5.0
153
153
  description: Ruby implementation of the Sila API
154
154
  email:
155
- - dev@vertbase.com
155
+ - engineering@sequoir.com
156
156
  executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
160
  - ".DS_Store"
161
161
  - ".gitignore"
162
+ - ".idea/.gitignore"
163
+ - ".idea/misc.xml"
164
+ - ".idea/modules.xml"
165
+ - ".idea/sila-ruby.iml"
166
+ - ".idea/vcs.xml"
162
167
  - ".rspec"
163
168
  - Gemfile
164
169
  - Gemfile.lock
@@ -170,12 +175,13 @@ files:
170
175
  - lib/sila-ruby.rb
171
176
  - lib/sila-ruby/accounts.rb
172
177
  - lib/sila-ruby/api_helpers.rb
173
- - lib/sila-ruby/banks.rb
178
+ - lib/sila-ruby/entities.rb
174
179
  - lib/sila-ruby/transactions.rb
175
180
  - lib/sila-ruby/version.rb
181
+ - lib/sila-ruby/wallets.rb
176
182
  - lib/sila_ruby.rb
177
183
  - sila-ruby.gemspec
178
- homepage: https://github.com/vertbase/sila-ruby
184
+ homepage: https://github.com/sequoir/sila-ruby
179
185
  licenses:
180
186
  - MIT
181
187
  metadata: {}
@@ -194,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
200
  - !ruby/object:Gem::Version
195
201
  version: '0'
196
202
  requirements: []
197
- rubygems_version: 3.0.4
203
+ rubygems_version: 3.1.2
198
204
  signing_key:
199
205
  specification_version: 4
200
206
  summary: Ruby implementation of the Sila API
@@ -1,62 +0,0 @@
1
- # ================================================
2
- # SILA-RUBY ======================================
3
- # ================================================
4
- module SilaRuby
5
-
6
- # ==============================================
7
- # BANKS ========================================
8
- # ==============================================
9
- class Banks
10
-
11
- # --------------------------------------------
12
- # INCLUDES -----------------------------------
13
- # --------------------------------------------
14
- include ApiHelpers
15
-
16
- # --------------------------------------------
17
- # LINK-ACCOUNT -------------------------------
18
- # --------------------------------------------
19
- # Uses a provided Plaid public token to link a bank account to a verified entity
20
- def self.link_account(handle, params={}, user_key)
21
- header = { user_handle: handle }
22
- message = 'link_account_msg'
23
-
24
- # Example of params passed
25
- #
26
- # params = {
27
- # public_token: "public-xxx-xxx",
28
- # account_name: "Custom Account Name",
29
- # selected_account_id: "optional_selected_account_id"
30
- # }
31
-
32
- sila_post_signed('link_account', header, message, params, user_key)
33
- end
34
-
35
- # --------------------------------------------
36
- # GET-ACCOUNTS -------------------------------
37
- # --------------------------------------------
38
- # Gets basic bank account names linked to user handle
39
- def self.get_accounts(handle, user_key)
40
- header = { user_handle: handle }
41
- message = 'get_accounts_msg'
42
- sila_post_signed('get_accounts', header, message, nil, user_key)
43
- end
44
-
45
- # --------------------------------------------
46
- # PLAID-SAMEDAY-AUTH -------------------------
47
- # --------------------------------------------
48
- def self.plaid_sameday_auth(handle, params={}, user_key)
49
- header = { user_handle: handle }
50
- message = 'header_msg'
51
-
52
- # Example of params passed
53
- #
54
- # params = {
55
- # account_name: "Custom Account Name",
56
- # }
57
-
58
- sila_post_signed('plaid_sameday_auth', header, message, params, user_key)
59
- end
60
-
61
- end
62
- end