sila-ruby 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -23
- data/lib/sila-ruby/accounts.rb +40 -52
- data/lib/sila-ruby/entities.rb +244 -0
- data/lib/sila-ruby/transactions.rb +32 -8
- data/lib/sila-ruby/version.rb +1 -1
- data/lib/sila-ruby/wallets.rb +81 -0
- data/lib/sila_ruby.rb +2 -1
- data/sila-ruby.gemspec +3 -3
- metadata +8 -7
- data/lib/sila-ruby/banks.rb +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b18754716f1d8491153d8f834e4730af47e8e914f0b524e68afa1c0ffdc8dfd1
|
4
|
+
data.tar.gz: 636e21a7128e4c209845c01f0921dfc8530edc21b106266ef570a1365575472a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8569dffce3378202c0c574faf64b7878f0fa42f6a0891b6e8cf6f8d400bdd0267c6a33bf3b78e34f72eb039c1943850d92d17bdadf7fd9930f75c6450ac12d5c
|
7
|
+
data.tar.gz: b14c31b64380024e6729698b5702d61abfb16e2fd7adbc26d65a1c0cd9bdf10067ffe76cbe4b1acbeb5f0d9a267f992750bb345d601950d71219392fefd29fbc
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sila-ruby (0.0.
|
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.
|
18
|
+
digest-sha3-patched (1.1.1)
|
19
19
|
docile (1.3.2)
|
20
20
|
dotenv (2.7.5)
|
21
|
-
eth (0.4.
|
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.
|
27
|
+
ffi (1.12.2)
|
28
28
|
ffi-compiler (1.0.1)
|
29
29
|
ffi (>= 1.0.0)
|
30
30
|
rake
|
31
|
-
httparty (0.
|
31
|
+
httparty (0.18.0)
|
32
32
|
mime-types (~> 3.0)
|
33
33
|
multi_xml (>= 0.5.2)
|
34
|
-
json (2.
|
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.
|
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.
|
41
|
+
public_suffix (4.0.5)
|
42
42
|
rake (10.5.0)
|
43
43
|
rlp (0.7.3)
|
44
|
-
rspec (3.
|
45
|
-
rspec-core (~> 3.
|
46
|
-
rspec-expectations (~> 3.
|
47
|
-
rspec-mocks (~> 3.
|
48
|
-
rspec-core (3.
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-expectations (3.
|
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.
|
53
|
-
rspec-mocks (3.
|
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.
|
56
|
-
rspec-support (3.
|
57
|
-
scrypt (3.0.
|
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.
|
70
|
+
unicode-display_width (1.7.0)
|
71
71
|
|
72
72
|
PLATFORMS
|
73
73
|
ruby
|
data/lib/sila-ruby/accounts.rb
CHANGED
@@ -14,78 +14,66 @@ module SilaRuby
|
|
14
14
|
include ApiHelpers
|
15
15
|
|
16
16
|
# --------------------------------------------
|
17
|
-
#
|
17
|
+
# LINK-ACCOUNT -------------------------------
|
18
18
|
# --------------------------------------------
|
19
|
-
#
|
20
|
-
def self.
|
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 = '
|
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
|
-
#
|
38
|
-
#
|
39
|
-
#
|
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('
|
32
|
+
sila_post_signed('link_account', header, message, params, user_key)
|
69
33
|
end
|
70
34
|
|
71
35
|
# --------------------------------------------
|
72
|
-
#
|
36
|
+
# GET-ACCOUNTS -------------------------------
|
73
37
|
# --------------------------------------------
|
74
|
-
#
|
75
|
-
def self.
|
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
|
-
|
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
|
-
#
|
63
|
+
# PLAID-SAMEDAY-AUTH -------------------------
|
83
64
|
# --------------------------------------------
|
84
|
-
#
|
85
|
-
def self.
|
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
|
-
|
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,244 @@
|
|
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
|
+
|
112
|
+
# Valid path options
|
113
|
+
#
|
114
|
+
# email
|
115
|
+
# phone
|
116
|
+
# identity
|
117
|
+
# address
|
118
|
+
#
|
119
|
+
#
|
120
|
+
# Example of params passed
|
121
|
+
#
|
122
|
+
# params = {
|
123
|
+
# email: "test@silamoney.com"
|
124
|
+
# }
|
125
|
+
|
126
|
+
sila_post_signed('add/' + valid_path, header, message, params, user_key)
|
127
|
+
end
|
128
|
+
|
129
|
+
# --------------------------------------------
|
130
|
+
# UPDATE-REGISTRATION ------------------------
|
131
|
+
# --------------------------------------------
|
132
|
+
# Update an existing email, phone number, street address, identity, or entity (name, birthdate, or business data).
|
133
|
+
def self.update_registration(handle, params={}, valid_path, user_key)
|
134
|
+
header = { user_handle: handle }
|
135
|
+
|
136
|
+
# Valid path options
|
137
|
+
#
|
138
|
+
# email
|
139
|
+
# phone
|
140
|
+
# identity
|
141
|
+
# address
|
142
|
+
# entity
|
143
|
+
#
|
144
|
+
#
|
145
|
+
# Example of params passed
|
146
|
+
#
|
147
|
+
# params = {
|
148
|
+
# uuid: "7f83044b-63c8-4d56-b107-d52fa7ae2d7a",
|
149
|
+
# email: "test@silamoney.com"
|
150
|
+
# }
|
151
|
+
|
152
|
+
sila_post_signed('update/' + valid_path, header, message, params, user_key)
|
153
|
+
end
|
154
|
+
|
155
|
+
# --------------------------------------------
|
156
|
+
# DELETE-REGISTRATION ------------------------
|
157
|
+
# --------------------------------------------
|
158
|
+
# Delete an existing email, phone number, street address, or identity.
|
159
|
+
def self.delete_registration(handle, params={}, valid_path, user_key)
|
160
|
+
header = { user_handle: handle }
|
161
|
+
|
162
|
+
# Valid path options
|
163
|
+
#
|
164
|
+
# email
|
165
|
+
# phone
|
166
|
+
# identity
|
167
|
+
# address
|
168
|
+
#
|
169
|
+
#
|
170
|
+
# Example of params passed
|
171
|
+
#
|
172
|
+
# params = {
|
173
|
+
# uuid: "7f83044b-63c8-4d56-b107-d52fa7ae2d7a"
|
174
|
+
# }
|
175
|
+
|
176
|
+
sila_post_signed('delete/' + valid_path, header, message, params, user_key)
|
177
|
+
end
|
178
|
+
|
179
|
+
# --------------------------------------------
|
180
|
+
# LINK-BUSINESS-MEMBER -----------------------
|
181
|
+
# --------------------------------------------
|
182
|
+
#
|
183
|
+
|
184
|
+
# --------------------------------------------
|
185
|
+
# UNLINK-BUSINESS-MEMBER ---------------------
|
186
|
+
# --------------------------------------------
|
187
|
+
#
|
188
|
+
|
189
|
+
# --------------------------------------------
|
190
|
+
# REQUEST-KYC --------------------------------
|
191
|
+
# --------------------------------------------
|
192
|
+
# Start KYC verification process on a registered user handle
|
193
|
+
def self.request_kyc(handle, user_key)
|
194
|
+
header = { user_handle: handle }
|
195
|
+
message = 'header_msg'
|
196
|
+
sila_post_signed('request_kyc', header, message, nil, user_key)
|
197
|
+
end
|
198
|
+
|
199
|
+
# --------------------------------------------
|
200
|
+
# CHECK-KYC ----------------------------------
|
201
|
+
# --------------------------------------------
|
202
|
+
# Whether entity attached to user handle is verified, not valid, or pending
|
203
|
+
def self.check_kyc(handle, user_key)
|
204
|
+
header = { user_handle: handle }
|
205
|
+
message = 'header_msg'
|
206
|
+
sila_post_signed('check_kyc', header, message, nil, user_key)
|
207
|
+
end
|
208
|
+
|
209
|
+
# --------------------------------------------
|
210
|
+
# CERTIFY-BENEFICIAL-OWNER -------------------
|
211
|
+
# --------------------------------------------
|
212
|
+
#
|
213
|
+
|
214
|
+
# --------------------------------------------
|
215
|
+
# CERTIFY-BUSINESS ---------------------------
|
216
|
+
# --------------------------------------------
|
217
|
+
#
|
218
|
+
|
219
|
+
# --------------------------------------------
|
220
|
+
# GET-ENTITIES -------------------------------
|
221
|
+
# --------------------------------------------
|
222
|
+
# Return all end-user and legal entities (businesses) associated with a customer application.
|
223
|
+
# This endpoint allows the listing of all entities registered to an application.
|
224
|
+
def self.get_entities(params={})
|
225
|
+
message = 'header_msg'
|
226
|
+
|
227
|
+
# params = {
|
228
|
+
# entity_type: "individual"
|
229
|
+
# }
|
230
|
+
|
231
|
+
sila_post_signed('get_entities', nil, message, params, nil)
|
232
|
+
end
|
233
|
+
|
234
|
+
# --------------------------------------------
|
235
|
+
# GET-ENTITY ---------------------------------
|
236
|
+
# --------------------------------------------
|
237
|
+
# Gets identifying information about a registered entity.
|
238
|
+
def self.get_entity(handle, user_key)
|
239
|
+
header = { user_handle: handle }
|
240
|
+
sila_post_signed('check_handle', header, nil, nil, user_key)
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
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
|
-
#
|
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: ["
|
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
|
data/lib/sila-ruby/version.rb
CHANGED
@@ -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
|
data/lib/sila_ruby.rb
CHANGED
@@ -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 ======================================
|
data/sila-ruby.gemspec
CHANGED
@@ -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 = ['
|
11
|
-
spec.email = ['
|
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/
|
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.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Sequoir
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -152,7 +152,7 @@ dependencies:
|
|
152
152
|
version: 0.5.0
|
153
153
|
description: Ruby implementation of the Sila API
|
154
154
|
email:
|
155
|
-
-
|
155
|
+
- engineering@sequoir.com
|
156
156
|
executables: []
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
@@ -170,12 +170,13 @@ files:
|
|
170
170
|
- lib/sila-ruby.rb
|
171
171
|
- lib/sila-ruby/accounts.rb
|
172
172
|
- lib/sila-ruby/api_helpers.rb
|
173
|
-
- lib/sila-ruby/
|
173
|
+
- lib/sila-ruby/entities.rb
|
174
174
|
- lib/sila-ruby/transactions.rb
|
175
175
|
- lib/sila-ruby/version.rb
|
176
|
+
- lib/sila-ruby/wallets.rb
|
176
177
|
- lib/sila_ruby.rb
|
177
178
|
- sila-ruby.gemspec
|
178
|
-
homepage: https://github.com/
|
179
|
+
homepage: https://github.com/sequoir/sila-ruby
|
179
180
|
licenses:
|
180
181
|
- MIT
|
181
182
|
metadata: {}
|
@@ -194,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
195
|
- !ruby/object:Gem::Version
|
195
196
|
version: '0'
|
196
197
|
requirements: []
|
197
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.1.2
|
198
199
|
signing_key:
|
199
200
|
specification_version: 4
|
200
201
|
summary: Ruby implementation of the Sila API
|
data/lib/sila-ruby/banks.rb
DELETED
@@ -1,79 +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
|
-
# GET-ACCOUNTS-BALANCE -----------------------
|
47
|
-
# --------------------------------------------
|
48
|
-
# Gets basic bank account names linked to user handle
|
49
|
-
def self.get_account_balance(handle, params={}, user_key)
|
50
|
-
header = { user_handle: handle }
|
51
|
-
message = 'header_msg'
|
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)
|
60
|
-
end
|
61
|
-
|
62
|
-
# --------------------------------------------
|
63
|
-
# PLAID-SAMEDAY-AUTH -------------------------
|
64
|
-
# --------------------------------------------
|
65
|
-
def self.plaid_sameday_auth(handle, params={}, user_key)
|
66
|
-
header = { user_handle: handle }
|
67
|
-
message = 'header_msg'
|
68
|
-
|
69
|
-
# Example of params passed
|
70
|
-
#
|
71
|
-
# params = {
|
72
|
-
# account_name: "Custom Account Name",
|
73
|
-
# }
|
74
|
-
|
75
|
-
sila_post_signed('plaid_sameday_auth', header, message, params, user_key)
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
end
|